diff --git a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/WorldChangeCrash.java b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/WorldChangeCrash.java index a86d561ea..ee74841b5 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/WorldChangeCrash.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/WorldChangeCrash.java @@ -60,6 +60,7 @@ public void disable() { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) private void onTeleport(EntityTeleportEvent event) { + if (event.getTo() == null) return; if (event.getFrom().getWorld().getUID().equals(event.getTo().getWorld().getUID())) return; if (recentWorldChangers.contains(event.getEntity().getUniqueId())) { diff --git a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/blockbreak/StructureGrowPermBlockRemoval.java b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/blockbreak/StructureGrowPermBlockRemoval.java index 32a81d4b7..d9c4c92ad 100644 --- a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/blockbreak/StructureGrowPermBlockRemoval.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/blockbreak/StructureGrowPermBlockRemoval.java @@ -8,6 +8,7 @@ import org.bukkit.block.BlockState; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.event.world.StructureGrowEvent; @@ -42,6 +43,11 @@ public boolean shouldEnable() { return AnarchyExploitFixes.getConfiguration().getBoolean("preventions.permanent-block-breaking.by-growing-structures.enable", true); } + @Override + public void disable() { + HandlerList.unregisterAll(this); + } + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onStructureGrow(StructureGrowEvent event) { final World world = event.getWorld(); diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/crashexploits/WorldChangeCrash.java b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/crashexploits/WorldChangeCrash.java index e35939e3f..9ec6551dd 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/crashexploits/WorldChangeCrash.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/patches/crashexploits/WorldChangeCrash.java @@ -54,6 +54,7 @@ public boolean shouldEnable() { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) private void onTeleport(EntityTeleportEvent event) { + if (event.getTo() == null) return; if (event.getFrom().getWorld().getUID().equals(event.getTo().getWorld().getUID())) return; if (recentWorldChangers.contains(event.getEntity().getUniqueId())) { diff --git a/build-logic/src/main/kotlin/me.moomoo.anarchyexploitfixes.wrapper.gradle.kts b/build-logic/src/main/kotlin/me.moomoo.anarchyexploitfixes.wrapper.gradle.kts index 965a89ef9..99ae38055 100755 --- a/build-logic/src/main/kotlin/me.moomoo.anarchyexploitfixes.wrapper.gradle.kts +++ b/build-logic/src/main/kotlin/me.moomoo.anarchyexploitfixes.wrapper.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "me.moomoo.anarchyexploitfixes" -version = "2.6.2" +version = "2.6.3" description = "Prevent many exploits that affect anarchy servers." var url: String? = "github.com/moom0o/AnarchyExploitFixes"