mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
We only care about sand & gravel.
Technically this was already addressed because no other blocks would have their place store set to true, but this eliminates unnecessary overhead caused by the checking of other falling blocks - anvils, dragon eggs, and TNT.
This commit is contained in:
parent
db1c0647ed
commit
2c78bac8f7
@ -60,15 +60,18 @@ public class EntityListener implements Listener {
|
|||||||
if (entity instanceof FallingBlock) {
|
if (entity instanceof FallingBlock) {
|
||||||
int entityID = entity.getEntityId();
|
int entityID = entity.getEntityId();
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
|
Material type = block.getType();
|
||||||
|
|
||||||
if (mcMMO.placeStore.isTrue(block)) {
|
if (type == Material.SAND || type == Material.GRAVEL) {
|
||||||
plugin.addToFallingBlockTracker(entityID, block);
|
if (mcMMO.placeStore.isTrue(block)) {
|
||||||
}
|
plugin.addToFallingBlockTracker(entityID, block);
|
||||||
|
}
|
||||||
|
|
||||||
if (plugin.fallingBlockIsTracked(entityID) && block.getType() == Material.AIR) {
|
if (plugin.fallingBlockIsTracked(entityID) && block.getType() == Material.AIR) {
|
||||||
mcMMO.placeStore.setFalse(plugin.getSourceBlock(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