Now it works
Dieser Commit ist enthalten in:
Ursprung
17ec28170a
Commit
f62ac6a1ce
@ -37,7 +37,7 @@ public class Region {
|
||||
|
||||
public Region(int minX, int minY, int minZ, int sizeX, int sizeY, int sizeZ, int extendX, int extendZ) {
|
||||
this(minX - extendX, minY, minZ - extendZ,
|
||||
sizeX + extendX * 2, sizeY, sizeZ + extendZ * 2);
|
||||
sizeX + extendX * 2, sizeY, sizeZ + extendZ * 2);
|
||||
}
|
||||
|
||||
public Region(int minX, int minY, int minZ, int sizeX, int sizeY, int sizeZ) {
|
||||
@ -96,7 +96,7 @@ public class Region {
|
||||
|
||||
public boolean chunkOutside(int cX, int cZ) {
|
||||
return getMinChunkX() > cX || cX > getMaxChunkX() ||
|
||||
getMinChunkZ() > cZ || cZ > getMaxChunkZ();
|
||||
getMinChunkZ() > cZ || cZ > getMaxChunkZ();
|
||||
}
|
||||
|
||||
public void forEachChunk(ObjIntConsumer<Integer> executor) {
|
||||
@ -144,7 +144,7 @@ public class Region {
|
||||
}
|
||||
|
||||
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>{
|
||||
|
@ -39,9 +39,8 @@ public class PistonListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
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) && !Config.RedExtendRegion.inRegion(block)){
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -50,9 +49,8 @@ public class PistonListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
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) && !Config.RedExtendRegion.inRegion(block)) {
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren