Improve TNT redstone performance

This commit is contained in:
mathiascode 2019-12-22 07:25:47 +02:00
parent 673bef2212
commit 5bea9e9dff

View file

@ -93,6 +93,16 @@ public final class BlockPhysics implements Listener {
event.getBlock().setType(Material.AIR, false); event.getBlock().setType(Material.AIR, false);
event.setCancelled(true); event.setCancelled(true);
} }
break;
case TNT:
for (BlockFace face : blockFaces) {
if (event.getBlock().getRelative(face).getType() != Material.REDSTONE_BLOCK
&& event.getBlock().getRelative(face).getType() != Material.REDSTONE_TORCH) {
return;
}
event.setCancelled(true);
}
break;
default: default:
break; break;
} }