From d4ab829812cd7c1d88977cb32237f4f496d175d9 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 21 Sep 2020 21:20:53 -0700 Subject: [PATCH] Mark blocks always in BlockPlaceEvent --- Changelog.txt | 1 + .../nossr50/listeners/BlockListener.java | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 4ee9b23ce..d90ff305c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,5 @@ Version 2.1.146 + A dupe exploit has been patched Players no longer lose levels below the level threshold in hardcore mode Hardcore now only applies penalties to levels above threshold diff --git a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java index e5eafb665..e2a19af43 100644 --- a/src/main/java/com/gmail/nossr50/listeners/BlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/BlockListener.java @@ -205,16 +205,6 @@ public class BlockListener implements Listener { */ @EventHandler(priority = EventPriority.MONITOR) public void onBlockPlace(BlockPlaceEvent event) { - /* WORLD BLACKLIST CHECK */ - if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) - return; - - Player player = event.getPlayer(); - - if (!UserManager.hasPlayerDataKey(player)) { - return; - } - BlockState blockState = event.getBlock().getState(); /* Check if the blocks placed should be monitored so they do not give out XP in the future */ @@ -224,6 +214,18 @@ public class BlockListener implements Listener { mcMMO.getPlaceStore().setTrue(blockState); } + /* WORLD BLACKLIST CHECK */ + if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld())) { + return; + } + + Player player = event.getPlayer(); + + if (!UserManager.hasPlayerDataKey(player)) { + return; + } + + McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); if(mcMMOPlayer == null)