SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Fix piston listener' (#254) from fix_pistons into master

Reviewed-on: #254
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-09 16:07:03 +02:00
Commit e052032c6a

Datei anzeigen

@ -41,7 +41,7 @@ public class PistonListener implements Listener {
public void handlePistonExtend(BlockPistonExtendEvent e){ public void handlePistonExtend(BlockPistonExtendEvent e){
BlockFace b = e.getDirection().getOppositeFace(); BlockFace b = e.getDirection().getOppositeFace();
for(Block block : e.getBlocks()){ 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); e.setCancelled(true);
return; return;
} }
@ -52,7 +52,7 @@ public class PistonListener implements Listener {
public void handlePistonRetract(BlockPistonRetractEvent e){ public void handlePistonRetract(BlockPistonRetractEvent e){
BlockFace b = e.getDirection().getOppositeFace(); BlockFace b = e.getDirection().getOppositeFace();
for(Block block : e.getBlocks()){ 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); e.setCancelled(true);
return; return;
} }