mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Go on and remove the placed flag when it first falls.
This commit is contained in:
parent
e3b3b7cfdb
commit
d153e3e25c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user