SteamWar/FightSystem
Archiviert
13
1
Dieser Commit ist enthalten in:
Zeanon 2021-05-08 01:31:30 +02:00
Ursprung 17ec28170a
Commit f62ac6a1ce
2 geänderte Dateien mit 5 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -144,7 +144,7 @@ public class Region {
} }
public boolean inRegion(Block block){ public boolean inRegion(Block block){
return in2dRegion(block) && block.getY() >= minY - 1 && block.getY() < maxY; return in2dRegion(block) && minY <= block.getY() && block.getY() < maxY;
} }
public interface TriConsumer<T, V, U>{ public interface TriConsumer<T, V, U>{

Datei anzeigen

@ -39,9 +39,8 @@ public class PistonListener implements Listener {
@EventHandler @EventHandler
public void handlePistonExtend(BlockPistonExtendEvent e){ public void handlePistonExtend(BlockPistonExtendEvent e){
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) && !Config.RedExtendRegion.inRegion(block)){
e.setCancelled(true); e.setCancelled(true);
return; return;
} }
@ -50,9 +49,8 @@ public class PistonListener implements Listener {
@EventHandler @EventHandler
public void handlePistonRetract(BlockPistonRetractEvent e){ public void handlePistonRetract(BlockPistonRetractEvent e){
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) && !Config.RedExtendRegion.inRegion(block)) {
e.setCancelled(true); e.setCancelled(true);
return; return;
} }