diff --git a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java index 8353809f2..82c179775 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java @@ -72,15 +72,20 @@ private void onRespawn(PlayerPostRespawnEvent event) { if (nearBedDeaths == null) { playerDeathNearBedCount.put(playerUniqueId, 1); - } else { - nearBedDeaths++; - if (nearBedDeaths > maxDeathsPerTime) { - player.getScheduler().run(AnarchyExploitFixes.getInstance(), resetBed -> { - player.setBedSpawnLocation(null, true); - if (logIsEnabled) LogUtil.moduleLog(Level.INFO, name(), - "Reset bed respawn of potentially bed-trapped player '" + player.getName() + "'"); - }, null); - } + return; } + + nearBedDeaths++; + + if (nearBedDeaths > maxDeathsPerTime) { + player.getScheduler().run(AnarchyExploitFixes.getInstance(), resetBed -> { + player.setBedSpawnLocation(null, true); + if (logIsEnabled) LogUtil.moduleLog(Level.INFO, name(), + "Reset bed respawn of potentially bed-trapped player '" + player.getName() + "'"); + }, null); + return; + } + + playerDeathNearBedCount.put(playerUniqueId, nearBedDeaths); } } \ No newline at end of file diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java index a72a91ff8..48eb6efd8 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/modules/preventions/BedTrap.java @@ -69,14 +69,19 @@ private void onDeath(PlayerDeathEvent event) { if (nearBedDeaths == null) { playerDeathNearBedCount.put(playerUniqueId, 1); - } else { - nearBedDeaths++; - if (nearBedDeaths > maxDeathsPerTime) { - player.setBedSpawnLocation(null, true); - if (logIsEnabled) LogUtil.moduleLog(Level.INFO, name(), - "Reset bed respawn of potentially bed-trapped player '" + player.getName() + "'"); - } + return; } + + nearBedDeaths++; + + if (nearBedDeaths > maxDeathsPerTime) { + player.setBedSpawnLocation(null, true); + if (logIsEnabled) LogUtil.moduleLog(Level.INFO, name(), + "Reset bed respawn of potentially bed-trapped player '" + player.getName() + "'"); + return; + } + + playerDeathNearBedCount.put(playerUniqueId, nearBedDeaths); } private boolean isNearBedSpawn(Player player) { 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 4a8fbea9c..ca00e9842 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.0" +version = "2.6.1" description = "Prevent many exploits that affect anarchy servers." var url: String? = "github.com/moom0o/AnarchyExploitFixes"