forked from kaboomserver/extras
Temporarily disable redstone physics
This commit is contained in:
parent
5c6d4c5ab9
commit
26b10af495
1 changed files with 21 additions and 2 deletions
|
@ -69,13 +69,32 @@ public class BlockPhysics implements Listener {
|
|||
|
||||
@EventHandler
|
||||
void onBlockPhysics(BlockPhysicsEvent event) {
|
||||
if (event.getChangedType() == Material.REDSTONE_WIRE) {
|
||||
for (BlockFace face : blockFaces) {
|
||||
switch (event.getChangedType()) {
|
||||
case COMPARATOR:
|
||||
case REDSTONE_TORCH:
|
||||
case REDSTONE_WIRE:
|
||||
case REPEATER:
|
||||
/*for (BlockFace face : blockFaces) {
|
||||
if (event.getBlock().getRelative(face).getType() != event.getChangedType()) {
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}*/
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
case ACTIVATOR_RAIL:
|
||||
case DETECTOR_RAIL:
|
||||
case POWERED_RAIL:
|
||||
case RAIL:
|
||||
for (BlockFace face : blockFaces) {
|
||||
if (event.getBlock().getRelative(face).getType() != event.getChangedType()) {
|
||||
return;
|
||||
}
|
||||
event.getBlock().setType(Material.AIR, false);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue