diff --git a/build.gradle.kts b/build.gradle.kts index a50999b2..110e8888 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ var libraries = listOf() libraries = libraries + "cn.lunadeer:MinecraftPluginUtils:2.0.7" group = "cn.lunadeer" -version = "3.3.1-beta" +version = "3.3.2-beta" java { toolchain.languageVersion.set(JavaLanguageVersion.of(17)) diff --git a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/EnvironmentEvents.java b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/EnvironmentEvents.java index 2acabf8e..6f01fbf1 100644 --- a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/EnvironmentEvents.java +++ b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/EnvironmentEvents.java @@ -30,7 +30,7 @@ import static org.bukkit.Material.FARMLAND; public class EnvironmentEvents implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode public void onEntityExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); XLogger.debug("EntityExplodeEvent: " + entity.getType()); @@ -44,7 +44,7 @@ public void onEntityExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - bed anchor + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - bed anchor public void onBedAnchorExplosion(BlockExplodeEvent event) { BlockState block = event.getExplodedBlockState(); if (block == null) { @@ -56,7 +56,7 @@ public void onBedAnchorExplosion(BlockExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameExploded(HangingBreakByEntityEvent event) { Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.EXPLOSION) { @@ -66,7 +66,7 @@ public void onItemFrameExploded(HangingBreakByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameShot(ProjectileHitEvent event) { Entity hit = event.getHitEntity(); if (hit == null) { @@ -82,7 +82,7 @@ public void onItemFrameShot(ProjectileHitEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - armor stand + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - armor stand public void onArmorStandExploded(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ARMOR_STAND) { @@ -95,7 +95,7 @@ public void onArmorStandExploded(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_proj_damage + @EventHandler(priority = EventPriority.LOWEST) // item_frame_proj_damage public void removeSomeOnItemFrameByArrow(HangingBreakByEntityEvent event) { if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return; @@ -121,7 +121,7 @@ private static boolean isNotExplodeEntity(Entity damager) { && damager.getType() != EntityType.DRAGON_FIREBALL; } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_break_block + @EventHandler(priority = EventPriority.LOWEST) // dragon_break_block public void onDragonBreakBlock(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDER_DRAGON) { @@ -133,7 +133,7 @@ public void onDragonBreakBlock(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // fire_spread + @EventHandler(priority = EventPriority.LOWEST) // fire_spread public void onFireSpread(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player != null) { @@ -144,7 +144,7 @@ public void onFireSpread(BlockIgniteEvent event) { checkFlag(dom, Flags.FIRE_SPREAD, event); } - @EventHandler(priority = EventPriority.HIGHEST) // flow_in_protection + @EventHandler(priority = EventPriority.LOWEST) // flow_in_protection public void onLiquidFlowIn(BlockFromToEvent event) { Location from = event.getBlock().getLocation(); Location to = event.getToBlock().getLocation(); @@ -161,7 +161,7 @@ public void onLiquidFlowIn(BlockFromToEvent event) { checkFlag(dom_to, Flags.FLOW_IN_PROTECTION, event); } - @EventHandler(priority = EventPriority.HIGHEST) // mob_drop_item + @EventHandler(priority = EventPriority.LOWEST) // mob_drop_item public void onMobDropItem(EntityDeathEvent event) { Entity entity = event.getEntity(); if (entity instanceof Player) { @@ -180,7 +180,7 @@ public void onMobDropItem(EntityDeathEvent event) { event.getDrops().clear(); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode public void onTntExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.MINECART_TNT && entity.getType() != EntityType.PRIMED_TNT) { @@ -192,7 +192,7 @@ public void onTntExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - entity + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode - entity public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); Entity harmer = event.getDamager(); @@ -203,7 +203,7 @@ public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.TNT_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trample + @EventHandler(priority = EventPriority.LOWEST) // trample public void onFarmlandTrample(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -224,7 +224,7 @@ public void onFarmlandTrample(PlayerInteractEvent event) { TRIG_PRESSURE_MOB("trig_pressure_mob", "生物触发压力板", "生物(不包含玩家)是否可以触发压力板", false, true, true), TRIG_PRESSURE_DROP("trig_pressure_drop", "掉落物触发压力板", "掉落物是否可以触发压力板", false, true, true), */ - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_proj + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_proj public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { if (!(event.getEntity() instanceof Projectile)) { return; @@ -237,7 +237,7 @@ public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_PROJ, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_mob + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_mob public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { if (!(event.getEntity() instanceof Mob)) { return; @@ -250,7 +250,7 @@ public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_MOB, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_drop + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_drop public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { if (!(event.getEntity() instanceof Item)) { return; @@ -263,7 +263,7 @@ public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_DROP, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn public void onWitherSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -273,7 +273,7 @@ public void onWitherSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.WITHER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn - explode + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn - explode public void onWitherSpawnExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -285,7 +285,7 @@ public void onWitherSpawnExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man spawn + @EventHandler(priority = EventPriority.LOWEST) // ender_man spawn public void onEnderManSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -295,7 +295,7 @@ public void onEnderManSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ENDER_MAN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man escape + @EventHandler(priority = EventPriority.LOWEST) // ender_man escape public void onEnderManEscape(EntityTeleportEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -309,7 +309,7 @@ public void onEnderManEscape(EntityTeleportEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // monster_spawn + @EventHandler(priority = EventPriority.LOWEST) // monster_spawn public void onMonsterSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Monster)) { @@ -319,7 +319,7 @@ public void onMonsterSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.MONSTER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_spawn + @EventHandler(priority = EventPriority.LOWEST) // animal_spawn public void onAnimalSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Animals)) { @@ -329,7 +329,7 @@ public void onAnimalSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ANIMAL_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_spawn + @EventHandler(priority = EventPriority.LOWEST) // villager_spawn public void onVillagerSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.VILLAGER) { @@ -339,7 +339,7 @@ public void onVillagerSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.VILLAGER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onHopper(InventoryMoveItemEvent event) { // hopper_outside Inventory hopper = event.getDestination(); Inventory inventory = event.getSource(); @@ -355,7 +355,7 @@ public void onHopper(InventoryMoveItemEvent event) { // hopper_outside } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_outside Block piston = event.getBlock(); DominionDTO pistonDom = Cache.instance.getDominionByLoc(piston.getLocation()); @@ -377,7 +377,7 @@ public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_ou } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_block Entity entity = event.getEntity(); if (!(entity instanceof FallingBlock)) { diff --git a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java index 2ce5ee3a..968f9152 100644 --- a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java +++ b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/PlayerEvents.java @@ -47,7 +47,7 @@ public void onPlayerQuit(PlayerQuitEvent event) { Cache.instance.onPlayerQuit(bukkitPlayer); } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onRespawnAnchor(PlayerRespawnEvent event) { Player bukkitPlayer = event.getPlayer(); if (!event.isAnchorSpawn()) { @@ -63,7 +63,7 @@ public void onRespawnAnchor(PlayerRespawnEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onAnchorInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -81,7 +81,7 @@ public void onAnchorInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.ANCHOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_killing + @EventHandler(priority = EventPriority.LOWEST) // animal_killing public void onAnimalKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -94,7 +94,7 @@ public void onAnimalKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.ANIMAL_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // anvil + @EventHandler(priority = EventPriority.LOWEST) // anvil public void onAnvilUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ANVIL) { return; @@ -106,7 +106,7 @@ public void onAnvilUse(InventoryOpenEvent event) { checkFlag(dom, Flags.ANVIL, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // beacon + @EventHandler(priority = EventPriority.LOWEST) // beacon public void onBeaconUse(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.BEACON) { @@ -122,7 +122,7 @@ public void onBeaconUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BEACON, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // bed + @EventHandler(priority = EventPriority.LOWEST) // bed public void onBedUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -139,7 +139,7 @@ public void onBedUse(PlayerInteractEvent event) { checkFlag(dom, Flags.BED, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // brew + @EventHandler(priority = EventPriority.LOWEST) // brew public void onBrewUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.BREWING) { return; @@ -151,7 +151,7 @@ public void onBrewUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BREW, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // break + @EventHandler(priority = EventPriority.LOWEST) // break public void onBlockBreak(BlockBreakEvent event) { Player player = event.getPlayer(); if (onBreak(player, event.getBlock().getLocation())) { @@ -160,7 +160,7 @@ public void onBlockBreak(BlockBreakEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - item frame + @EventHandler(priority = EventPriority.LOWEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { if (!(event.getRemover() instanceof Player)) { return; @@ -183,7 +183,7 @@ public void onItemFrameBreak(HangingBreakByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - armor stand + @EventHandler(priority = EventPriority.LOWEST) // break - armor stand public void onArmorStandBreak(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ArmorStand)) { @@ -203,7 +203,7 @@ public static boolean onBreak(Player player, Location location) { return checkFlag(dom, Flags.BREAK_BLOCK, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // button + @EventHandler(priority = EventPriority.LOWEST) // button public void onButton(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -220,7 +220,7 @@ public void onButton(PlayerInteractEvent event) { checkFlag(dom, Flags.BUTTON, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // cake + @EventHandler(priority = EventPriority.LOWEST) // cake public void eatCake(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -249,7 +249,7 @@ private static boolean hasContainerPermission(Player player, Location loc) { return checkFlag(dom, Flags.CONTAINER, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // container + @EventHandler(priority = EventPriority.LOWEST) // container public void openContainer(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.CHEST && event.getInventory().getType() != InventoryType.BARREL && @@ -265,7 +265,7 @@ public void openContainer(InventoryOpenEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (armor stand) + @EventHandler(priority = EventPriority.LOWEST) // container (armor stand) public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { Player bukkitPlayer = event.getPlayer(); if (hasContainerPermission(bukkitPlayer, event.getRightClicked().getLocation())) { @@ -274,7 +274,7 @@ public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame put) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame put) public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -290,7 +290,7 @@ public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -308,7 +308,7 @@ public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -329,7 +329,7 @@ public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // craft + @EventHandler(priority = EventPriority.LOWEST) // craft public void onCraft(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.WORKBENCH) { @@ -342,7 +342,7 @@ public void onCraft(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // crafter + @EventHandler(priority = EventPriority.LOWEST) // crafter public void onCrafterOpen(InventoryOpenEvent event) { Inventory inv = event.getInventory(); // InventoryType.CRAFTER; @@ -356,7 +356,7 @@ public void onCrafterOpen(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFTER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // comparer + @EventHandler(priority = EventPriority.LOWEST) // comparer public void comparerChange(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -374,7 +374,7 @@ public void comparerChange(PlayerInteractEvent event) { checkFlag(dom, Flags.COMPARER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // door + @EventHandler(priority = EventPriority.LOWEST) // door public void doorUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -391,7 +391,7 @@ public void doorUse(PlayerInteractEvent event) { checkFlag(dom, Flags.DOOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_egg + @EventHandler(priority = EventPriority.LOWEST) // dragon_egg public void touchDragonEdd(PlayerInteractEvent event) { Block block = event.getClickedBlock(); if (block == null) { @@ -405,7 +405,7 @@ public void touchDragonEdd(PlayerInteractEvent event) { checkFlag(dom, Flags.DRAGON_EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dye + @EventHandler(priority = EventPriority.LOWEST) // dye public void dyeEvent(PlayerInteractEntityEvent event) { Player player = event.getPlayer(); Entity entity = event.getRightClicked(); @@ -416,7 +416,7 @@ public void dyeEvent(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.DYE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignOpen(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -433,7 +433,7 @@ public void onSignOpen(PlayerInteractEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignEdit(SignChangeEvent event) { Player player = event.getPlayer(); Block block = event.getBlock(); @@ -441,7 +441,7 @@ public void onSignEdit(SignChangeEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // egg + @EventHandler(priority = EventPriority.LOWEST) // egg public void onThrowingEgg(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -454,7 +454,7 @@ public void onThrowingEgg(ProjectileHitEvent event) { checkFlag(dom, Flags.EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // enchant + @EventHandler(priority = EventPriority.LOWEST) // enchant public void onEnchant(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ENCHANTING) { return; @@ -466,7 +466,7 @@ public void onEnchant(InventoryOpenEvent event) { checkFlag(dom, Flags.ENCHANT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_pearl + @EventHandler(priority = EventPriority.LOWEST) // ender_pearl public void onThrowingEndPearl(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -479,7 +479,7 @@ public void onThrowingEndPearl(ProjectileHitEvent event) { checkFlag(dom, Flags.ENDER_PEARL, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // feed + @EventHandler(priority = EventPriority.LOWEST) // feed public void onFeedAnimal(PlayerInteractEntityEvent event) { if (!(event.getRightClicked() instanceof Animals)) { return; @@ -493,7 +493,7 @@ public void onFeedAnimal(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.FEED, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // harvest + @EventHandler(priority = EventPriority.LOWEST) // harvest public void onHarvest(BlockBreakEvent event) { Block block = event.getBlock(); if (block.getType() != Material.COCOA && @@ -519,7 +519,7 @@ public void onHarvest(BlockBreakEvent event) { checkFlag(dom, Flags.HARVEST, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // honey + @EventHandler(priority = EventPriority.LOWEST) // honey public void honeyInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -537,7 +537,7 @@ public void honeyInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.HONEY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hook + @EventHandler(priority = EventPriority.LOWEST) // hook public void onHook(PlayerFishEvent event) { Entity caught = event.getCaught(); if (caught == null) { @@ -548,7 +548,7 @@ public void onHook(PlayerFishEvent event) { checkFlag(dom, Flags.HOOK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hopper + @EventHandler(priority = EventPriority.LOWEST) // hopper public void openHopper(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.HOPPER && event.getInventory().getType() != InventoryType.DROPPER && @@ -566,7 +566,7 @@ public void openHopper(InventoryOpenEvent event) { checkFlag(dom, Flags.HOPPER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ignite + @EventHandler(priority = EventPriority.LOWEST) // ignite public void onPlayerIgnite(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -576,7 +576,7 @@ public void onPlayerIgnite(BlockIgniteEvent event) { checkFlag(dom, Flags.IGNITE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_interactive + @EventHandler(priority = EventPriority.LOWEST) // item_frame_interactive public void onItemFrameInteractive(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -591,7 +591,7 @@ public void onItemFrameInteractive(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.ITEM_FRAME_INTERACTIVE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // lever + @EventHandler(priority = EventPriority.LOWEST) // lever public void onLever(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -609,7 +609,7 @@ public void onLever(PlayerInteractEvent event) { checkFlag(dom, Flags.LEVER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // monster_killing + @EventHandler(priority = EventPriority.LOWEST) // monster_killing public void onMonsterKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -623,7 +623,7 @@ public void onMonsterKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.MONSTER_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // move + @EventHandler(priority = EventPriority.LOWEST) // move public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getPlayerCurrentDominion(player); @@ -662,7 +662,7 @@ public void onPlayerMove(PlayerMoveEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // note_block + @EventHandler(priority = EventPriority.LOWEST) // note_block public void onNoteBlockClicked(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -680,7 +680,7 @@ public void onNoteBlockClicked(PlayerInteractEvent event) { checkFlag(dom, Flags.NOTE_BLOCK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // place + @EventHandler(priority = EventPriority.LOWEST) // place public void onPlaceBlock(BlockPlaceEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -689,7 +689,7 @@ public void onPlaceBlock(BlockPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - lava or water + @EventHandler(priority = EventPriority.LOWEST) // place - lava or water public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -698,7 +698,7 @@ public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - item frame + @EventHandler(priority = EventPriority.LOWEST) // place - item frame public void placeItemFrame(HangingPlaceEvent event) { Entity entity = event.getEntity(); Player player = event.getPlayer(); @@ -711,7 +711,7 @@ public void placeItemFrame(HangingPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - armor stand + @EventHandler(priority = EventPriority.LOWEST) // place - armor stand public void placeArmorStand(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -732,7 +732,7 @@ public static boolean onPlace(Player player, Location location) { return checkFlag(dom, Flags.PLACE, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // pressure + @EventHandler(priority = EventPriority.LOWEST) // pressure public void onPressure(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -749,7 +749,7 @@ public void onPressure(PlayerInteractEvent event) { checkFlag(dom, Flags.PRESSURE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // riding + @EventHandler(priority = EventPriority.LOWEST) // riding public void onRiding(EntityMountEvent event) { if (!(event.getEntity() instanceof Player player)) { return; @@ -758,7 +758,7 @@ public void onRiding(EntityMountEvent event) { checkFlag(dom, Flags.RIDING, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // repeater + @EventHandler(priority = EventPriority.LOWEST) // repeater public void onRepeaterChange(PlayerInteractEvent event) { if (event.getClickedBlock() == null) { return; @@ -773,14 +773,14 @@ public void onRepeaterChange(PlayerInteractEvent event) { checkFlag(dom, Flags.REPEATER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shear + @EventHandler(priority = EventPriority.LOWEST) // shear public void onShear(PlayerShearEntityEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getDominionByLoc(event.getEntity().getLocation()); checkFlag(dom, Flags.SHEAR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shoot + @EventHandler(priority = EventPriority.LOWEST) // shoot public void onShootArrowSnowball(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -793,7 +793,7 @@ public void onShootArrowSnowball(ProjectileHitEvent event) { checkFlag(dom, Flags.SHOOT, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trade + @EventHandler(priority = EventPriority.LOWEST) // trade public void onTrade(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.MERCHANT) { return; @@ -805,7 +805,7 @@ public void onTrade(InventoryOpenEvent event) { checkFlag(dom, Flags.TRADE, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_destroy + @EventHandler(priority = EventPriority.LOWEST) // vehicle_destroy public void onVehicleDestroy(VehicleDestroyEvent event) { if (!(event.getAttacker() instanceof Player player)) { return; @@ -814,7 +814,7 @@ public void onVehicleDestroy(VehicleDestroyEvent event) { checkFlag(dom, Flags.VEHICLE_DESTROY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_spawn + @EventHandler(priority = EventPriority.LOWEST) // vehicle_spawn public void onVehicleSpawn(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -828,7 +828,7 @@ public void onVehicleSpawn(EntityPlaceEvent event) { checkFlag(dom, Flags.VEHICLE_SPAWN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_killing + @EventHandler(priority = EventPriority.LOWEST) // villager_killing public void onVillagerKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player player)) { return; diff --git a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/special/Paper.java b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/special/Paper.java index 92f675a4..be6c52b1 100644 --- a/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/special/Paper.java +++ b/v1_20_1/src/main/java/cn/lunadeer/dominion/events_v1_20_1/special/Paper.java @@ -15,7 +15,7 @@ public class Paper implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) // monster_move + @EventHandler(priority = EventPriority.LOWEST) // monster_move public void onMonsterPathfinding(EntityPathfindEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Monster)) { @@ -25,7 +25,7 @@ public void onMonsterPathfinding(EntityPathfindEvent event) { checkFlag(dom, Flags.MONSTER_MOVE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_move + @EventHandler(priority = EventPriority.LOWEST) // animal_move public void onAnimalPathfinding(EntityPathfindEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Animals)) { diff --git a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/EnvironmentEvents.java b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/EnvironmentEvents.java index abc3b561..204504cf 100644 --- a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/EnvironmentEvents.java +++ b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/EnvironmentEvents.java @@ -30,7 +30,7 @@ import static org.bukkit.Material.FARMLAND; public class EnvironmentEvents implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode public void onEntityExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); XLogger.debug("EntityExplodeEvent: " + entity.getType()); @@ -44,7 +44,7 @@ public void onEntityExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - bed anchor + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - bed anchor public void onBedAnchorExplosion(BlockExplodeEvent event) { event.blockList().removeIf(blockState -> { DominionDTO dom = Cache.instance.getDominionByLoc(blockState.getLocation()); @@ -52,7 +52,7 @@ public void onBedAnchorExplosion(BlockExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameExploded(HangingBreakByEntityEvent event) { Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.EXPLOSION) { @@ -62,7 +62,7 @@ public void onItemFrameExploded(HangingBreakByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameShot(ProjectileHitEvent event) { Entity hit = event.getHitEntity(); if (hit == null) { @@ -78,7 +78,7 @@ public void onItemFrameShot(ProjectileHitEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - armor stand + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - armor stand public void onArmorStandExploded(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ARMOR_STAND) { @@ -91,7 +91,7 @@ public void onArmorStandExploded(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_proj_damage + @EventHandler(priority = EventPriority.LOWEST) // item_frame_proj_damage public void removeSomeOnItemFrameByArrow(HangingBreakByEntityEvent event) { if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return; @@ -117,7 +117,7 @@ private static boolean isNotExplodeEntity(Entity damager) { && damager.getType() != EntityType.DRAGON_FIREBALL; } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_break_block + @EventHandler(priority = EventPriority.LOWEST) // dragon_break_block public void onDragonBreakBlock(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDER_DRAGON) { @@ -129,7 +129,7 @@ public void onDragonBreakBlock(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // fire_spread + @EventHandler(priority = EventPriority.LOWEST) // fire_spread public void onFireSpread(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player != null) { @@ -140,7 +140,7 @@ public void onFireSpread(BlockIgniteEvent event) { checkFlag(dom, Flags.FIRE_SPREAD, event); } - @EventHandler(priority = EventPriority.HIGHEST) // flow_in_protection + @EventHandler(priority = EventPriority.LOWEST) // flow_in_protection public void onLiquidFlowIn(BlockFromToEvent event) { Location from = event.getBlock().getLocation(); Location to = event.getToBlock().getLocation(); @@ -157,7 +157,7 @@ public void onLiquidFlowIn(BlockFromToEvent event) { checkFlag(dom_to, Flags.FLOW_IN_PROTECTION, event); } - @EventHandler(priority = EventPriority.HIGHEST) // mob_drop_item + @EventHandler(priority = EventPriority.LOWEST) // mob_drop_item public void onMobDropItem(EntityDeathEvent event) { Entity entity = event.getEntity(); if (entity instanceof Player) { @@ -176,7 +176,7 @@ public void onMobDropItem(EntityDeathEvent event) { event.getDrops().clear(); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode public void onTntExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.TNT_MINECART && entity.getType() != EntityType.TNT) { @@ -188,7 +188,7 @@ public void onTntExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - entity + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode - entity public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); Entity harmer = event.getDamager(); @@ -199,7 +199,7 @@ public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.TNT_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trample + @EventHandler(priority = EventPriority.LOWEST) // trample public void onFarmlandTrample(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -220,7 +220,7 @@ public void onFarmlandTrample(PlayerInteractEvent event) { TRIG_PRESSURE_MOB("trig_pressure_mob", "生物触发压力板", "生物(不包含玩家)是否可以触发压力板", false, true, true), TRIG_PRESSURE_DROP("trig_pressure_drop", "掉落物触发压力板", "掉落物是否可以触发压力板", false, true, true), */ - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_proj + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_proj public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { if (!(event.getEntity() instanceof Projectile)) { return; @@ -233,7 +233,7 @@ public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_PROJ, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_mob + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_mob public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { if (!(event.getEntity() instanceof Mob)) { return; @@ -246,7 +246,7 @@ public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_MOB, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_drop + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_drop public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { if (!(event.getEntity() instanceof Item)) { return; @@ -259,7 +259,7 @@ public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_DROP, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn public void onWitherSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -269,7 +269,7 @@ public void onWitherSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.WITHER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn - explode + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn - explode public void onWitherSpawnExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -281,7 +281,7 @@ public void onWitherSpawnExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man spawn + @EventHandler(priority = EventPriority.LOWEST) // ender_man spawn public void onEnderManSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -291,7 +291,7 @@ public void onEnderManSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ENDER_MAN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man escape + @EventHandler(priority = EventPriority.LOWEST) // ender_man escape public void onEnderManEscape(EntityTeleportEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -305,7 +305,7 @@ public void onEnderManEscape(EntityTeleportEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // monster_spawn + @EventHandler(priority = EventPriority.LOWEST) // monster_spawn public void onMonsterSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Monster)) { @@ -315,7 +315,7 @@ public void onMonsterSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.MONSTER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_spawn + @EventHandler(priority = EventPriority.LOWEST) // animal_spawn public void onAnimalSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Animals)) { @@ -325,7 +325,7 @@ public void onAnimalSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ANIMAL_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_spawn + @EventHandler(priority = EventPriority.LOWEST) // villager_spawn public void onVillagerSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.VILLAGER) { @@ -336,7 +336,7 @@ public void onVillagerSpawn(CreatureSpawnEvent event) { } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onHopper(InventoryMoveItemEvent event) { // hopper_outside Inventory hopper = event.getDestination(); Inventory inventory = event.getSource(); @@ -352,7 +352,7 @@ public void onHopper(InventoryMoveItemEvent event) { // hopper_outside } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_outside Block piston = event.getBlock(); DominionDTO pistonDom = Cache.instance.getDominionByLoc(piston.getLocation()); @@ -374,7 +374,7 @@ public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_ou } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_block Entity entity = event.getEntity(); if (!(entity instanceof FallingBlock)) { @@ -406,7 +406,7 @@ public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_b } } - @EventHandler(priority = EventPriority.HIGHEST) // monster_move + @EventHandler(priority = EventPriority.LOWEST) // monster_move public void onMonsterPathfinding(EntityPathfindEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Monster)) { @@ -416,7 +416,7 @@ public void onMonsterPathfinding(EntityPathfindEvent event) { checkFlag(dom, Flags.MONSTER_MOVE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_move + @EventHandler(priority = EventPriority.LOWEST) // animal_move public void onAnimalPathfinding(EntityPathfindEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Animals)) { diff --git a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java index d9d38c46..6d074cfd 100644 --- a/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java +++ b/v1_21_paper/src/main/java/cn/lunadeer/dominion/events_v1_21_paper/PlayerEvents.java @@ -47,7 +47,7 @@ public void onPlayerQuit(PlayerQuitEvent event) { Cache.instance.onPlayerQuit(bukkitPlayer); } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onRespawnAnchor(PlayerRespawnEvent event) { Player bukkitPlayer = event.getPlayer(); if (!event.isAnchorSpawn()) { @@ -63,7 +63,7 @@ public void onRespawnAnchor(PlayerRespawnEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onAnchorInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -81,7 +81,7 @@ public void onAnchorInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.ANCHOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_killing + @EventHandler(priority = EventPriority.LOWEST) // animal_killing public void onAnimalKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -94,7 +94,7 @@ public void onAnimalKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.ANIMAL_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // anvil + @EventHandler(priority = EventPriority.LOWEST) // anvil public void onAnvilUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ANVIL) { return; @@ -106,7 +106,7 @@ public void onAnvilUse(InventoryOpenEvent event) { checkFlag(dom, Flags.ANVIL, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // beacon + @EventHandler(priority = EventPriority.LOWEST) // beacon public void onBeaconUse(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.BEACON) { @@ -122,7 +122,7 @@ public void onBeaconUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BEACON, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // bed + @EventHandler(priority = EventPriority.LOWEST) // bed public void onBedUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -139,7 +139,7 @@ public void onBedUse(PlayerInteractEvent event) { checkFlag(dom, Flags.BED, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // brew + @EventHandler(priority = EventPriority.LOWEST) // brew public void onBrewUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.BREWING) { return; @@ -151,7 +151,7 @@ public void onBrewUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BREW, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // break + @EventHandler(priority = EventPriority.LOWEST) // break public void onBlockBreak(BlockBreakEvent event) { Player player = event.getPlayer(); if (onBreak(player, event.getBlock().getLocation())) { @@ -160,7 +160,7 @@ public void onBlockBreak(BlockBreakEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - item frame + @EventHandler(priority = EventPriority.LOWEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { if (!(event.getRemover() instanceof Player)) { return; @@ -183,7 +183,7 @@ public void onItemFrameBreak(HangingBreakByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - armor stand + @EventHandler(priority = EventPriority.LOWEST) // break - armor stand public void onArmorStandBreak(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ArmorStand)) { @@ -203,7 +203,7 @@ public static boolean onBreak(Player player, Location location) { return checkFlag(dom, Flags.BREAK_BLOCK, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // button + @EventHandler(priority = EventPriority.LOWEST) // button public void onButton(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -220,7 +220,7 @@ public void onButton(PlayerInteractEvent event) { checkFlag(dom, Flags.BUTTON, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // cake + @EventHandler(priority = EventPriority.LOWEST) // cake public void eatCake(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -249,7 +249,7 @@ private static boolean hasContainerPermission(Player player, Location loc) { return checkFlag(dom, Flags.CONTAINER, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // container + @EventHandler(priority = EventPriority.LOWEST) // container public void openContainer(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.CHEST && event.getInventory().getType() != InventoryType.BARREL && @@ -265,7 +265,7 @@ public void openContainer(InventoryOpenEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (armor stand) + @EventHandler(priority = EventPriority.LOWEST) // container (armor stand) public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { Player bukkitPlayer = event.getPlayer(); if (hasContainerPermission(bukkitPlayer, event.getRightClicked().getLocation())) { @@ -274,7 +274,7 @@ public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame put) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame put) public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -290,7 +290,7 @@ public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -308,7 +308,7 @@ public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -329,7 +329,7 @@ public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // craft + @EventHandler(priority = EventPriority.LOWEST) // craft public void onCraft(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.WORKBENCH) { @@ -342,7 +342,7 @@ public void onCraft(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // crafter + @EventHandler(priority = EventPriority.LOWEST) // crafter public void onCrafterOpen(InventoryOpenEvent event) { Inventory inv = event.getInventory(); // InventoryType.CRAFTER; @@ -356,7 +356,7 @@ public void onCrafterOpen(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFTER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // comparer + @EventHandler(priority = EventPriority.LOWEST) // comparer public void comparerChange(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -374,7 +374,7 @@ public void comparerChange(PlayerInteractEvent event) { checkFlag(dom, Flags.COMPARER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // door + @EventHandler(priority = EventPriority.LOWEST) // door public void doorUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -391,7 +391,7 @@ public void doorUse(PlayerInteractEvent event) { checkFlag(dom, Flags.DOOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_egg + @EventHandler(priority = EventPriority.LOWEST) // dragon_egg public void touchDragonEdd(PlayerInteractEvent event) { Block block = event.getClickedBlock(); if (block == null) { @@ -405,7 +405,7 @@ public void touchDragonEdd(PlayerInteractEvent event) { checkFlag(dom, Flags.DRAGON_EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dye + @EventHandler(priority = EventPriority.LOWEST) // dye public void dyeEvent(PlayerInteractEntityEvent event) { Player player = event.getPlayer(); Entity entity = event.getRightClicked(); @@ -416,7 +416,7 @@ public void dyeEvent(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.DYE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignOpen(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -433,7 +433,7 @@ public void onSignOpen(PlayerInteractEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignEdit(SignChangeEvent event) { Player player = event.getPlayer(); Block block = event.getBlock(); @@ -441,7 +441,7 @@ public void onSignEdit(SignChangeEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // egg + @EventHandler(priority = EventPriority.LOWEST) // egg public void onThrowingEgg(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -454,7 +454,7 @@ public void onThrowingEgg(ProjectileHitEvent event) { checkFlag(dom, Flags.EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // enchant + @EventHandler(priority = EventPriority.LOWEST) // enchant public void onEnchant(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ENCHANTING) { return; @@ -466,7 +466,7 @@ public void onEnchant(InventoryOpenEvent event) { checkFlag(dom, Flags.ENCHANT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_pearl + @EventHandler(priority = EventPriority.LOWEST) // ender_pearl public void onThrowingEndPearl(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -479,7 +479,7 @@ public void onThrowingEndPearl(ProjectileHitEvent event) { checkFlag(dom, Flags.ENDER_PEARL, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // feed + @EventHandler(priority = EventPriority.LOWEST) // feed public void onFeedAnimal(PlayerInteractEntityEvent event) { if (!(event.getRightClicked() instanceof Animals)) { return; @@ -493,7 +493,7 @@ public void onFeedAnimal(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.FEED, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // harvest + @EventHandler(priority = EventPriority.LOWEST) // harvest public void onHarvest(BlockBreakEvent event) { Block block = event.getBlock(); if (block.getType() != Material.COCOA && @@ -519,7 +519,7 @@ public void onHarvest(BlockBreakEvent event) { checkFlag(dom, Flags.HARVEST, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // honey + @EventHandler(priority = EventPriority.LOWEST) // honey public void honeyInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -537,7 +537,7 @@ public void honeyInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.HONEY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hook + @EventHandler(priority = EventPriority.LOWEST) // hook public void onHook(PlayerFishEvent event) { Entity caught = event.getCaught(); if (caught == null) { @@ -548,7 +548,7 @@ public void onHook(PlayerFishEvent event) { checkFlag(dom, Flags.HOOK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hopper + @EventHandler(priority = EventPriority.LOWEST) // hopper public void openHopper(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.HOPPER && event.getInventory().getType() != InventoryType.DROPPER && @@ -566,7 +566,7 @@ public void openHopper(InventoryOpenEvent event) { checkFlag(dom, Flags.HOPPER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ignite + @EventHandler(priority = EventPriority.LOWEST) // ignite public void onPlayerIgnite(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -576,7 +576,7 @@ public void onPlayerIgnite(BlockIgniteEvent event) { checkFlag(dom, Flags.IGNITE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_interactive + @EventHandler(priority = EventPriority.LOWEST) // item_frame_interactive public void onItemFrameInteractive(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -591,7 +591,7 @@ public void onItemFrameInteractive(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.ITEM_FRAME_INTERACTIVE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // lever + @EventHandler(priority = EventPriority.LOWEST) // lever public void onLever(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -609,7 +609,7 @@ public void onLever(PlayerInteractEvent event) { checkFlag(dom, Flags.LEVER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // monster_killing + @EventHandler(priority = EventPriority.LOWEST) // monster_killing public void onMonsterKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -623,7 +623,7 @@ public void onMonsterKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.MONSTER_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // move + @EventHandler(priority = EventPriority.LOWEST) // move public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getPlayerCurrentDominion(player); @@ -657,7 +657,7 @@ public void onPlayerMove(PlayerMoveEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // note_block + @EventHandler(priority = EventPriority.LOWEST) // note_block public void onNoteBlockClicked(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -675,7 +675,7 @@ public void onNoteBlockClicked(PlayerInteractEvent event) { checkFlag(dom, Flags.NOTE_BLOCK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // place + @EventHandler(priority = EventPriority.LOWEST) // place public void onPlaceBlock(BlockPlaceEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -684,7 +684,7 @@ public void onPlaceBlock(BlockPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - lava or water + @EventHandler(priority = EventPriority.LOWEST) // place - lava or water public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -693,7 +693,7 @@ public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - item frame + @EventHandler(priority = EventPriority.LOWEST) // place - item frame public void placeItemFrame(HangingPlaceEvent event) { Entity entity = event.getEntity(); Player player = event.getPlayer(); @@ -706,7 +706,7 @@ public void placeItemFrame(HangingPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - armor stand + @EventHandler(priority = EventPriority.LOWEST) // place - armor stand public void placeArmorStand(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -727,7 +727,7 @@ public static boolean onPlace(Player player, Location location) { return checkFlag(dom, Flags.PLACE, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // pressure + @EventHandler(priority = EventPriority.LOWEST) // pressure public void onPressure(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -744,7 +744,7 @@ public void onPressure(PlayerInteractEvent event) { checkFlag(dom, Flags.PRESSURE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // riding + @EventHandler(priority = EventPriority.LOWEST) // riding public void onRiding(EntityMountEvent event) { if (!(event.getEntity() instanceof Player player)) { return; @@ -753,7 +753,7 @@ public void onRiding(EntityMountEvent event) { checkFlag(dom, Flags.RIDING, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // repeater + @EventHandler(priority = EventPriority.LOWEST) // repeater public void onRepeaterChange(PlayerInteractEvent event) { if (event.getClickedBlock() == null) { return; @@ -768,14 +768,14 @@ public void onRepeaterChange(PlayerInteractEvent event) { checkFlag(dom, Flags.REPEATER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shear + @EventHandler(priority = EventPriority.LOWEST) // shear public void onShear(PlayerShearEntityEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getDominionByLoc(event.getEntity().getLocation()); checkFlag(dom, Flags.SHEAR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shoot + @EventHandler(priority = EventPriority.LOWEST) // shoot public void onShootArrowSnowball(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -788,7 +788,7 @@ public void onShootArrowSnowball(ProjectileHitEvent event) { checkFlag(dom, Flags.SHOOT, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shoot - wind_charge knock back + @EventHandler(priority = EventPriority.LOWEST) // shoot - wind_charge knock back public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) { Entity entity = event.getHitBy(); if (!(entity instanceof WindCharge windCharge)) { @@ -801,7 +801,7 @@ public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) { checkFlag(dom, Flags.SHOOT, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trade + @EventHandler(priority = EventPriority.LOWEST) // trade public void onTrade(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.MERCHANT) { return; @@ -813,7 +813,7 @@ public void onTrade(InventoryOpenEvent event) { checkFlag(dom, Flags.TRADE, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_destroy + @EventHandler(priority = EventPriority.LOWEST) // vehicle_destroy public void onVehicleDestroy(VehicleDestroyEvent event) { if (!(event.getAttacker() instanceof Player player)) { return; @@ -822,7 +822,7 @@ public void onVehicleDestroy(VehicleDestroyEvent event) { checkFlag(dom, Flags.VEHICLE_DESTROY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_spawn + @EventHandler(priority = EventPriority.LOWEST) // vehicle_spawn public void onVehicleSpawn(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -836,7 +836,7 @@ public void onVehicleSpawn(EntityPlaceEvent event) { checkFlag(dom, Flags.VEHICLE_SPAWN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_killing + @EventHandler(priority = EventPriority.LOWEST) // villager_killing public void onVillagerKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player player)) { return; diff --git a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/EnvironmentEvents.java b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/EnvironmentEvents.java index e9336218..a9d0bfce 100644 --- a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/EnvironmentEvents.java +++ b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/EnvironmentEvents.java @@ -32,7 +32,7 @@ import static org.bukkit.Material.FARMLAND; public class EnvironmentEvents implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode public void onEntityExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); XLogger.debug("EntityExplodeEvent: " + entity.getType()); @@ -46,7 +46,7 @@ public void onEntityExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - bed anchor + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - bed anchor public void onBedAnchorExplosion(BlockExplodeEvent event) { event.blockList().removeIf(blockState -> { DominionDTO dom = Cache.instance.getDominionByLoc(blockState.getLocation()); @@ -54,7 +54,7 @@ public void onBedAnchorExplosion(BlockExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameExploded(HangingBreakByEntityEvent event) { Entity entity = event.getEntity(); if (event.getCause() != HangingBreakEvent.RemoveCause.EXPLOSION) { @@ -64,7 +64,7 @@ public void onItemFrameExploded(HangingBreakByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - item frame + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - item frame public void onItemFrameShot(ProjectileHitEvent event) { Entity hit = event.getHitEntity(); if (hit == null) { @@ -80,7 +80,7 @@ public void onItemFrameShot(ProjectileHitEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // creeper_explode - armor stand + @EventHandler(priority = EventPriority.LOWEST) // creeper_explode - armor stand public void onArmorStandExploded(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ARMOR_STAND) { @@ -93,7 +93,7 @@ public void onArmorStandExploded(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.CREEPER_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_proj_damage + @EventHandler(priority = EventPriority.LOWEST) // item_frame_proj_damage public void removeSomeOnItemFrameByArrow(HangingBreakByEntityEvent event) { if (event.getCause() != HangingBreakEvent.RemoveCause.ENTITY) { return; @@ -119,7 +119,7 @@ private static boolean isNotExplodeEntity(Entity damager) { && damager.getType() != EntityType.DRAGON_FIREBALL; } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_break_block + @EventHandler(priority = EventPriority.LOWEST) // dragon_break_block public void onDragonBreakBlock(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDER_DRAGON) { @@ -131,7 +131,7 @@ public void onDragonBreakBlock(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // fire_spread + @EventHandler(priority = EventPriority.LOWEST) // fire_spread public void onFireSpread(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player != null) { @@ -142,7 +142,7 @@ public void onFireSpread(BlockIgniteEvent event) { checkFlag(dom, Flags.FIRE_SPREAD, event); } - @EventHandler(priority = EventPriority.HIGHEST) // flow_in_protection + @EventHandler(priority = EventPriority.LOWEST) // flow_in_protection public void onLiquidFlowIn(BlockFromToEvent event) { Location from = event.getBlock().getLocation(); Location to = event.getToBlock().getLocation(); @@ -159,7 +159,7 @@ public void onLiquidFlowIn(BlockFromToEvent event) { checkFlag(dom_to, Flags.FLOW_IN_PROTECTION, event); } - @EventHandler(priority = EventPriority.HIGHEST) // mob_drop_item + @EventHandler(priority = EventPriority.LOWEST) // mob_drop_item public void onMobDropItem(EntityDeathEvent event) { Entity entity = event.getEntity(); if (entity instanceof Player) { @@ -178,7 +178,7 @@ public void onMobDropItem(EntityDeathEvent event) { event.getDrops().clear(); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode public void onTntExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.TNT_MINECART && entity.getType() != EntityType.TNT) { @@ -190,7 +190,7 @@ public void onTntExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // tnt_explode - entity + @EventHandler(priority = EventPriority.LOWEST) // tnt_explode - entity public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); Entity harmer = event.getDamager(); @@ -201,7 +201,7 @@ public void onArmorStandExplodedByTnt(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.TNT_EXPLODE, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trample + @EventHandler(priority = EventPriority.LOWEST) // trample public void onFarmlandTrample(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -222,7 +222,7 @@ public void onFarmlandTrample(PlayerInteractEvent event) { TRIG_PRESSURE_MOB("trig_pressure_mob", "生物触发压力板", "生物(不包含玩家)是否可以触发压力板", false, true, true), TRIG_PRESSURE_DROP("trig_pressure_drop", "掉落物触发压力板", "掉落物是否可以触发压力板", false, true, true), */ - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_proj + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_proj public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { if (!(event.getEntity() instanceof Projectile)) { return; @@ -235,7 +235,7 @@ public void onPressurePlateTriggeredByProjectile(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_PROJ, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_mob + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_mob public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { if (!(event.getEntity() instanceof Mob)) { return; @@ -248,7 +248,7 @@ public void onPressurePlateTriggeredByMob(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_MOB, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trig_pressure_drop + @EventHandler(priority = EventPriority.LOWEST) // trig_pressure_drop public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { if (!(event.getEntity() instanceof Item)) { return; @@ -261,7 +261,7 @@ public void onPressurePlateTriggeredByDrop(EntityInteractEvent event) { checkFlag(dom, Flags.TRIG_PRESSURE_DROP, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn public void onWitherSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -271,7 +271,7 @@ public void onWitherSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.WITHER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // wither_spawn - explode + @EventHandler(priority = EventPriority.LOWEST) // wither_spawn - explode public void onWitherSpawnExplode(EntityExplodeEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.WITHER) { @@ -283,7 +283,7 @@ public void onWitherSpawnExplode(EntityExplodeEvent event) { }); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man spawn + @EventHandler(priority = EventPriority.LOWEST) // ender_man spawn public void onEnderManSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -293,7 +293,7 @@ public void onEnderManSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ENDER_MAN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_man escape + @EventHandler(priority = EventPriority.LOWEST) // ender_man escape public void onEnderManEscape(EntityTeleportEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.ENDERMAN) { @@ -307,7 +307,7 @@ public void onEnderManEscape(EntityTeleportEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // monster_spawn + @EventHandler(priority = EventPriority.LOWEST) // monster_spawn public void onMonsterSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Monster)) { @@ -317,7 +317,7 @@ public void onMonsterSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.MONSTER_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_spawn + @EventHandler(priority = EventPriority.LOWEST) // animal_spawn public void onAnimalSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Animals)) { @@ -327,7 +327,7 @@ public void onAnimalSpawn(CreatureSpawnEvent event) { checkFlag(dom, Flags.ANIMAL_SPAWN, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_spawn + @EventHandler(priority = EventPriority.LOWEST) // villager_spawn public void onVillagerSpawn(CreatureSpawnEvent event) { Entity entity = event.getEntity(); if (entity.getType() != EntityType.VILLAGER) { @@ -338,7 +338,7 @@ public void onVillagerSpawn(CreatureSpawnEvent event) { } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onHopper(InventoryMoveItemEvent event) { // hopper_outside Inventory hopper = event.getDestination(); Inventory inventory = event.getSource(); @@ -354,7 +354,7 @@ public void onHopper(InventoryMoveItemEvent event) { // hopper_outside } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_outside Block piston = event.getBlock(); DominionDTO pistonDom = Cache.instance.getDominionByLoc(piston.getLocation()); @@ -376,7 +376,7 @@ public void onBlockPushedByPiston(BlockPistonExtendEvent event) { // piston_ou } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.LOWEST) public void onGravityBlockFalling(EntityChangeBlockEvent event) { // gravity_block Entity entity = event.getEntity(); if (!(entity instanceof FallingBlock)) { diff --git a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java index 076806cf..675ee0b2 100644 --- a/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java +++ b/v1_21_spigot/src/main/java/cn/lunadeer/dominion/events_v1_21_spigot/PlayerEvents.java @@ -43,7 +43,7 @@ public void onPlayerQuit(PlayerQuitEvent event) { Cache.instance.onPlayerQuit(bukkitPlayer); } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onRespawnAnchor(PlayerRespawnEvent event) { Player bukkitPlayer = event.getPlayer(); if (!event.isAnchorSpawn()) { @@ -59,7 +59,7 @@ public void onRespawnAnchor(PlayerRespawnEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // anchor + @EventHandler(priority = EventPriority.LOWEST) // anchor public void onAnchorInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -77,7 +77,7 @@ public void onAnchorInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.ANCHOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // animal_killing + @EventHandler(priority = EventPriority.LOWEST) // animal_killing public void onAnimalKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -90,7 +90,7 @@ public void onAnimalKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.ANIMAL_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // anvil + @EventHandler(priority = EventPriority.LOWEST) // anvil public void onAnvilUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ANVIL) { return; @@ -102,7 +102,7 @@ public void onAnvilUse(InventoryOpenEvent event) { checkFlag(dom, Flags.ANVIL, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // beacon + @EventHandler(priority = EventPriority.LOWEST) // beacon public void onBeaconUse(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.BEACON) { @@ -118,7 +118,7 @@ public void onBeaconUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BEACON, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // bed + @EventHandler(priority = EventPriority.LOWEST) // bed public void onBedUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -135,7 +135,7 @@ public void onBedUse(PlayerInteractEvent event) { checkFlag(dom, Flags.BED, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // brew + @EventHandler(priority = EventPriority.LOWEST) // brew public void onBrewUse(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.BREWING) { return; @@ -147,7 +147,7 @@ public void onBrewUse(InventoryOpenEvent event) { checkFlag(dom, Flags.BREW, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // break + @EventHandler(priority = EventPriority.LOWEST) // break public void onBlockBreak(BlockBreakEvent event) { Player player = event.getPlayer(); if (onBreak(player, event.getBlock().getLocation())) { @@ -156,7 +156,7 @@ public void onBlockBreak(BlockBreakEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - item frame + @EventHandler(priority = EventPriority.LOWEST) // break - item frame public void onItemFrameBreak(HangingBreakByEntityEvent event) { if (!(event.getRemover() instanceof Player)) { return; @@ -179,7 +179,7 @@ public void onItemFrameBreak(HangingBreakByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // break - armor stand + @EventHandler(priority = EventPriority.LOWEST) // break - armor stand public void onArmorStandBreak(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ArmorStand)) { @@ -199,7 +199,7 @@ public static boolean onBreak(Player player, Location location) { return checkFlag(dom, Flags.BREAK_BLOCK, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // button + @EventHandler(priority = EventPriority.LOWEST) // button public void onButton(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -216,7 +216,7 @@ public void onButton(PlayerInteractEvent event) { checkFlag(dom, Flags.BUTTON, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // cake + @EventHandler(priority = EventPriority.LOWEST) // cake public void eatCake(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -245,7 +245,7 @@ private static boolean hasContainerPermission(Player player, Location loc) { return checkFlag(dom, Flags.CONTAINER, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // container + @EventHandler(priority = EventPriority.LOWEST) // container public void openContainer(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.CHEST && event.getInventory().getType() != InventoryType.BARREL && @@ -261,7 +261,7 @@ public void openContainer(InventoryOpenEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (armor stand) + @EventHandler(priority = EventPriority.LOWEST) // container (armor stand) public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { Player bukkitPlayer = event.getPlayer(); if (hasContainerPermission(bukkitPlayer, event.getRightClicked().getLocation())) { @@ -270,7 +270,7 @@ public void manipulateArmorStand(PlayerArmorStandManipulateEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame put) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame put) public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -286,7 +286,7 @@ public void putSomeOnItemFrame(PlayerInteractEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -304,7 +304,7 @@ public void removeSomeOnItemFrame(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // container (item frame get) + @EventHandler(priority = EventPriority.LOWEST) // container (item frame get) public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -325,7 +325,7 @@ public void removeSomeOnItemFrameByArrow(EntityDamageByEntityEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // craft + @EventHandler(priority = EventPriority.LOWEST) // craft public void onCraft(InventoryOpenEvent event) { Inventory inv = event.getInventory(); if (inv.getType() != InventoryType.WORKBENCH) { @@ -338,7 +338,7 @@ public void onCraft(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // crafter + @EventHandler(priority = EventPriority.LOWEST) // crafter public void onCrafterOpen(InventoryOpenEvent event) { Inventory inv = event.getInventory(); // InventoryType.CRAFTER; @@ -352,7 +352,7 @@ public void onCrafterOpen(InventoryOpenEvent event) { checkFlag(dom, Flags.CRAFTER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // comparer + @EventHandler(priority = EventPriority.LOWEST) // comparer public void comparerChange(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -370,7 +370,7 @@ public void comparerChange(PlayerInteractEvent event) { checkFlag(dom, Flags.COMPARER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // door + @EventHandler(priority = EventPriority.LOWEST) // door public void doorUse(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -387,7 +387,7 @@ public void doorUse(PlayerInteractEvent event) { checkFlag(dom, Flags.DOOR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dragon_egg + @EventHandler(priority = EventPriority.LOWEST) // dragon_egg public void touchDragonEdd(PlayerInteractEvent event) { Block block = event.getClickedBlock(); if (block == null) { @@ -401,7 +401,7 @@ public void touchDragonEdd(PlayerInteractEvent event) { checkFlag(dom, Flags.DRAGON_EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // dye + @EventHandler(priority = EventPriority.LOWEST) // dye public void dyeEvent(PlayerInteractEntityEvent event) { Player player = event.getPlayer(); Entity entity = event.getRightClicked(); @@ -412,7 +412,7 @@ public void dyeEvent(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.DYE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignOpen(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -429,7 +429,7 @@ public void onSignOpen(PlayerInteractEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // edit sign + @EventHandler(priority = EventPriority.LOWEST) // edit sign public void onSignEdit(SignChangeEvent event) { Player player = event.getPlayer(); Block block = event.getBlock(); @@ -437,7 +437,7 @@ public void onSignEdit(SignChangeEvent event) { checkFlag(dom, Flags.EDIT_SIGN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // egg + @EventHandler(priority = EventPriority.LOWEST) // egg public void onThrowingEgg(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -450,7 +450,7 @@ public void onThrowingEgg(ProjectileHitEvent event) { checkFlag(dom, Flags.EGG, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // enchant + @EventHandler(priority = EventPriority.LOWEST) // enchant public void onEnchant(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.ENCHANTING) { return; @@ -462,7 +462,7 @@ public void onEnchant(InventoryOpenEvent event) { checkFlag(dom, Flags.ENCHANT, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ender_pearl + @EventHandler(priority = EventPriority.LOWEST) // ender_pearl public void onThrowingEndPearl(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -475,7 +475,7 @@ public void onThrowingEndPearl(ProjectileHitEvent event) { checkFlag(dom, Flags.ENDER_PEARL, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // feed + @EventHandler(priority = EventPriority.LOWEST) // feed public void onFeedAnimal(PlayerInteractEntityEvent event) { if (!(event.getRightClicked() instanceof Animals)) { return; @@ -489,7 +489,7 @@ public void onFeedAnimal(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.FEED, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // harvest + @EventHandler(priority = EventPriority.LOWEST) // harvest public void onHarvest(BlockBreakEvent event) { Block block = event.getBlock(); if (block.getType() != Material.COCOA && @@ -515,7 +515,7 @@ public void onHarvest(BlockBreakEvent event) { checkFlag(dom, Flags.HARVEST, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // honey + @EventHandler(priority = EventPriority.LOWEST) // honey public void honeyInteractive(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -533,7 +533,7 @@ public void honeyInteractive(PlayerInteractEvent event) { checkFlag(dom, Flags.HONEY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hook + @EventHandler(priority = EventPriority.LOWEST) // hook public void onHook(PlayerFishEvent event) { Entity caught = event.getCaught(); if (caught == null) { @@ -544,7 +544,7 @@ public void onHook(PlayerFishEvent event) { checkFlag(dom, Flags.HOOK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // hopper + @EventHandler(priority = EventPriority.LOWEST) // hopper public void openHopper(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.HOPPER && event.getInventory().getType() != InventoryType.DROPPER && @@ -562,7 +562,7 @@ public void openHopper(InventoryOpenEvent event) { checkFlag(dom, Flags.HOPPER, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // ignite + @EventHandler(priority = EventPriority.LOWEST) // ignite public void onPlayerIgnite(BlockIgniteEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -572,7 +572,7 @@ public void onPlayerIgnite(BlockIgniteEvent event) { checkFlag(dom, Flags.IGNITE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // item_frame_interactive + @EventHandler(priority = EventPriority.LOWEST) // item_frame_interactive public void onItemFrameInteractive(PlayerInteractEntityEvent event) { Entity entity = event.getRightClicked(); if (!(entity instanceof ItemFrame itemFrame)) { @@ -587,7 +587,7 @@ public void onItemFrameInteractive(PlayerInteractEntityEvent event) { checkFlag(dom, Flags.ITEM_FRAME_INTERACTIVE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // lever + @EventHandler(priority = EventPriority.LOWEST) // lever public void onLever(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -605,7 +605,7 @@ public void onLever(PlayerInteractEvent event) { checkFlag(dom, Flags.LEVER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // monster_killing + @EventHandler(priority = EventPriority.LOWEST) // monster_killing public void onMonsterKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player bukkitPlayer)) { return; @@ -619,7 +619,7 @@ public void onMonsterKilling(EntityDamageByEntityEvent event) { checkFlag(dom, Flags.MONSTER_KILLING, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // move + @EventHandler(priority = EventPriority.LOWEST) // move public void onPlayerMove(PlayerMoveEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getPlayerCurrentDominion(player); @@ -653,7 +653,7 @@ public void onPlayerMove(PlayerMoveEvent event) { } } - @EventHandler(priority = EventPriority.HIGHEST) // note_block + @EventHandler(priority = EventPriority.LOWEST) // note_block public void onNoteBlockClicked(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; @@ -671,7 +671,7 @@ public void onNoteBlockClicked(PlayerInteractEvent event) { checkFlag(dom, Flags.NOTE_BLOCK, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // place + @EventHandler(priority = EventPriority.LOWEST) // place public void onPlaceBlock(BlockPlaceEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -680,7 +680,7 @@ public void onPlaceBlock(BlockPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - lava or water + @EventHandler(priority = EventPriority.LOWEST) // place - lava or water public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { Player player = event.getPlayer(); if (onPlace(player, event.getBlock().getLocation())) { @@ -689,7 +689,7 @@ public void onPlaceLavaOrWater(PlayerBucketEmptyEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - item frame + @EventHandler(priority = EventPriority.LOWEST) // place - item frame public void placeItemFrame(HangingPlaceEvent event) { Entity entity = event.getEntity(); Player player = event.getPlayer(); @@ -702,7 +702,7 @@ public void placeItemFrame(HangingPlaceEvent event) { event.setCancelled(true); } - @EventHandler(priority = EventPriority.HIGHEST) // place - armor stand + @EventHandler(priority = EventPriority.LOWEST) // place - armor stand public void placeArmorStand(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -723,7 +723,7 @@ public static boolean onPlace(Player player, Location location) { return checkFlag(dom, Flags.PLACE, player, null); } - @EventHandler(priority = EventPriority.HIGHEST) // pressure + @EventHandler(priority = EventPriority.LOWEST) // pressure public void onPressure(PlayerInteractEvent event) { if (event.getAction() != Action.PHYSICAL) { return; @@ -740,7 +740,7 @@ public void onPressure(PlayerInteractEvent event) { checkFlag(dom, Flags.PRESSURE, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // riding + @EventHandler(priority = EventPriority.LOWEST) // riding public void onRiding(EntityMountEvent event) { if (!(event.getEntity() instanceof Player player)) { return; @@ -749,7 +749,7 @@ public void onRiding(EntityMountEvent event) { checkFlag(dom, Flags.RIDING, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // repeater + @EventHandler(priority = EventPriority.LOWEST) // repeater public void onRepeaterChange(PlayerInteractEvent event) { if (event.getClickedBlock() == null) { return; @@ -764,14 +764,14 @@ public void onRepeaterChange(PlayerInteractEvent event) { checkFlag(dom, Flags.REPEATER, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shear + @EventHandler(priority = EventPriority.LOWEST) // shear public void onShear(PlayerShearEntityEvent event) { Player player = event.getPlayer(); DominionDTO dom = Cache.instance.getDominionByLoc(event.getEntity().getLocation()); checkFlag(dom, Flags.SHEAR, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shoot + @EventHandler(priority = EventPriority.LOWEST) // shoot public void onShootArrowSnowball(ProjectileHitEvent event) { Projectile projectile = event.getEntity(); if (!(projectile.getShooter() instanceof Player player)) { @@ -784,7 +784,7 @@ public void onShootArrowSnowball(ProjectileHitEvent event) { checkFlag(dom, Flags.SHOOT, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // shoot - wind_charge knock back + @EventHandler(priority = EventPriority.LOWEST) // shoot - wind_charge knock back public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) { Entity entity = event.getSourceEntity(); if (!(entity instanceof WindCharge windCharge)) { @@ -797,7 +797,7 @@ public void onWindChargeKnockBack(EntityKnockbackByEntityEvent event) { checkFlag(dom, Flags.SHOOT, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // trade + @EventHandler(priority = EventPriority.LOWEST) // trade public void onTrade(InventoryOpenEvent event) { if (event.getInventory().getType() != InventoryType.MERCHANT) { return; @@ -809,7 +809,7 @@ public void onTrade(InventoryOpenEvent event) { checkFlag(dom, Flags.TRADE, bukkitPlayer, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_destroy + @EventHandler(priority = EventPriority.LOWEST) // vehicle_destroy public void onVehicleDestroy(VehicleDestroyEvent event) { if (!(event.getAttacker() instanceof Player player)) { return; @@ -818,7 +818,7 @@ public void onVehicleDestroy(VehicleDestroyEvent event) { checkFlag(dom, Flags.VEHICLE_DESTROY, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // vehicle_spawn + @EventHandler(priority = EventPriority.LOWEST) // vehicle_spawn public void onVehicleSpawn(EntityPlaceEvent event) { Player player = event.getPlayer(); if (player == null) { @@ -832,7 +832,7 @@ public void onVehicleSpawn(EntityPlaceEvent event) { checkFlag(dom, Flags.VEHICLE_SPAWN, player, event); } - @EventHandler(priority = EventPriority.HIGHEST) // villager_killing + @EventHandler(priority = EventPriority.LOWEST) // villager_killing public void onVillagerKilling(EntityDamageByEntityEvent event) { if (!(event.getDamager() instanceof Player player)) { return;