From d153e3e25c5ce3d70d8f32c456ad18278368ce0c Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 18 Jan 2013 11:52:38 -0500 Subject: [PATCH] Go on and remove the placed flag when it first falls. --- .../com/gmail/nossr50/listeners/EntityListener.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index e9671931d..b2c9fb485 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -22,6 +22,7 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.event.entity.EntityEvent; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityTameEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; @@ -53,6 +54,14 @@ public class EntityListener implements Listener { this.plugin = plugin; } + @EventHandler(priority = EventPriority.MONITOR) + public void onEntityEvent(EntityEvent event) { + if (plugin.fallingBlockIsTracked(event.getEntity().getEntityId())) { + System.out.println(event.getEntity().toString()); + System.out.println(event.getEventName()); + } + } + @EventHandler(priority = EventPriority.MONITOR) public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) { Entity entity = event.getEntity(); @@ -64,11 +73,11 @@ public class EntityListener implements Listener { if (type == Material.SAND || type == Material.GRAVEL) { if (mcMMO.placeStore.isTrue(block)) { + mcMMO.placeStore.setFalse(block); plugin.addToFallingBlockTracker(entityID, block); } if (plugin.fallingBlockIsTracked(entityID)) { - mcMMO.placeStore.setFalse(plugin.getSourceBlock(entityID)); mcMMO.placeStore.setTrue(block); plugin.removeFromFallingBlockTracker(entityID); }