mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36: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;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.entity.EntityDeathEvent;
|
import org.bukkit.event.entity.EntityDeathEvent;
|
||||||
|
import org.bukkit.event.entity.EntityEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityTameEvent;
|
import org.bukkit.event.entity.EntityTameEvent;
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
@ -53,6 +54,14 @@ public class EntityListener implements Listener {
|
|||||||
this.plugin = plugin;
|
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)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {
|
public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
@ -64,11 +73,11 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
if (type == Material.SAND || type == Material.GRAVEL) {
|
if (type == Material.SAND || type == Material.GRAVEL) {
|
||||||
if (mcMMO.placeStore.isTrue(block)) {
|
if (mcMMO.placeStore.isTrue(block)) {
|
||||||
|
mcMMO.placeStore.setFalse(block);
|
||||||
plugin.addToFallingBlockTracker(entityID, block);
|
plugin.addToFallingBlockTracker(entityID, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.fallingBlockIsTracked(entityID)) {
|
if (plugin.fallingBlockIsTracked(entityID)) {
|
||||||
mcMMO.placeStore.setFalse(plugin.getSourceBlock(entityID));
|
|
||||||
mcMMO.placeStore.setTrue(block);
|
mcMMO.placeStore.setTrue(block);
|
||||||
plugin.removeFromFallingBlockTracker(entityID);
|
plugin.removeFromFallingBlockTracker(entityID);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user