diff --git a/Changelog.txt b/Changelog.txt index 68956c608..6e33ebe20 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -23,6 +23,8 @@ Version 2.0.00-dev = Fixed exploit where you could use /ptp to teleport to anyone = Fixed bug where Green Terra didn't work on Stone Brick = Fixed bug where Tree Feller could be used without permissions + = Fixed exploit where falling sand & gravel weren't tracked + ! Changed Chimera Wing failure check to use the maxWorldHeight. ! Changed inspect failed message to say inspect rather than whois ! Changed Call of the Wild to activate on left-click rather than right-click ! Changed Blast Mining to track based on Entity ID vs. Location diff --git a/src/main/java/com/gmail/nossr50/Item.java b/src/main/java/com/gmail/nossr50/Item.java index bf3e8df5b..d30c97c10 100644 --- a/src/main/java/com/gmail/nossr50/Item.java +++ b/src/main/java/com/gmail/nossr50/Item.java @@ -37,7 +37,7 @@ public class Item { if (Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && amount >= itemsUsed) { player.setItemInHand(new ItemStack(chimaeraID, amount - itemsUsed)); - for (int blockY = block.getY(); blockY < 127; blockY++) { + for (int blockY = block.getY(); blockY < player.getWorld().getMaxHeight(); blockY++) { if (player.getLocation().getWorld().getBlockAt(block.getX(), blockY, block.getZ()).getType() != Material.AIR) { player.sendMessage(mcLocale.getString("Item.ChimaeraWingFail")); player.teleport(player.getLocation().getWorld().getBlockAt(block.getX(), (blockY - 1), block.getZ()).getLocation()); diff --git a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java index e4aab4726..1c5ae4ed6 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcBlockListener.java @@ -60,7 +60,21 @@ public class mcBlockListener implements Listener { int id = block.getTypeId(); Material mat = block.getType(); - //Check if the blocks placed should be monitored so they do not give out XP in the future + /* Code to prevent issues with placed falling Sand/Gravel not being tracked */ + if (mat.equals(Material.SAND) || mat.equals(Material.GRAVEL)) { + for (int y = -1; y + block.getY() >= 0 ; y--) { + if (block.getRelative(0, y, 0).getType().equals(Material.AIR)) { + continue; + } + else { + Block newLocation = block.getRelative(0, y+1, 0); + newLocation.setData((byte) 0x5); + break; + } + } + } + + /* Check if the blocks placed should be monitored so they do not give out XP in the future */ if (BlockChecks.shouldBeWatched(mat)) { BlockChecks.watchBlock(mat, block, plugin); }