Browse Source

Fixed bug where falling blocks were not tracked

Fixes #2130
TfT_02 11 years ago
parent
commit
037022b175
2 changed files with 4 additions and 1 deletions
  1. 1 0
      Changelog.txt
  2. 3 1
      src/main/java/com/gmail/nossr50/listeners/EntityListener.java

+ 1 - 0
Changelog.txt

@@ -28,6 +28,7 @@ Version 1.5.01-dev
  = Fixed bug with setting custom names and lore in treasures config
  = Fixed bug which would cause a NullPointerException with getFlowerAndGrassXp()
  = Fixed bug which could cause and SQLException regarding the connection property 'maxReconnects'.
+ = Fixed bug where falling blocks were incorrectly tracked
  ! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities
  ! Changed the way mcMMO handles bonus damage, updated for the new damage event API
  ! Changed player data saving. Save tasks are now asynchronous

+ 3 - 1
src/main/java/com/gmail/nossr50/listeners/EntityListener.java

@@ -109,7 +109,9 @@ public class EntityListener implements Listener {
     public void onEntityChangeBlock(EntityChangeBlockEvent event) {
         Block block = event.getBlock();
 
-        if (!BlockUtils.shouldBeWatched(block.getState())) {
+        // When the event is fired for the falling block that changes back to a normal block
+        // event.getBlock().getType() returns AIR
+        if (!BlockUtils.shouldBeWatched(block.getState()) && block.getType() != Material.AIR) {
             return;
         }