SteamWar/FightSystem
Archiviert
13
1

Fix piston listener

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-09 14:18:41 +02:00
Ursprung a62d9ab48a
Commit fb7824b23b

Datei anzeigen

@ -41,7 +41,7 @@ public class PistonListener implements Listener {
public void handlePistonExtend(BlockPistonExtendEvent e){
BlockFace b = e.getDirection().getOppositeFace();
for(Block block : e.getBlocks()){
if(Config.BlueExtendRegion.inRegion(block.getRelative(b)) && Config.RedExtendRegion.inRegion(block.getRelative(b))){
if(!Config.BlueExtendRegion.inRegion(block.getRelative(b)) && !Config.RedExtendRegion.inRegion(block.getRelative(b))){
e.setCancelled(true);
return;
}
@ -52,7 +52,7 @@ public class PistonListener implements Listener {
public void handlePistonRetract(BlockPistonRetractEvent e){
BlockFace b = e.getDirection().getOppositeFace();
for(Block block : e.getBlocks()){
if(Config.BlueExtendRegion.inRegion(block.getRelative(b)) && Config.RedExtendRegion.inRegion(block.getRelative(b))) {
if(!Config.BlueExtendRegion.inRegion(block.getRelative(b)) && !Config.RedExtendRegion.inRegion(block.getRelative(b))) {
e.setCancelled(true);
return;
}