mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-23 07:01:24 +01:00
Set maxBlockY from given world.
This commit is contained in:
parent
1cb9a18174
commit
cb557122b8
@ -21,6 +21,9 @@ public class BlockCacheBukkit extends BlockCache{
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world;
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2512 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2545 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2602 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2645 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2691 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2763 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2794 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2808 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCB2882 extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,12 @@ public class BlockCacheCBDev extends BlockCache implements IBlockAccess{
|
||||
|
||||
@Override
|
||||
public void setAccess(World world) {
|
||||
this.world = world == null ? null : ((CraftWorld) world).getHandle();
|
||||
if (world != null) {
|
||||
this.maxBlockY = world.getMaxHeight() - 1;
|
||||
this.world = ((CraftWorld) world).getHandle();
|
||||
} else {
|
||||
this.world = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,7 +63,7 @@ public abstract class BlockCache {
|
||||
/** Cached shape values. */
|
||||
private final CoordMap<double[]> boundsMap = new CoordMap<double[]>(23);
|
||||
|
||||
private int maxBlockY = 255;
|
||||
protected int maxBlockY = 255;
|
||||
|
||||
// TODO: switch to nodes with all details on, store a working node ?
|
||||
|
||||
|
@ -2067,7 +2067,10 @@ public class BlockProperties {
|
||||
final int iMinX = Location.locToBlock(minX);
|
||||
final int iMaxX = Location.locToBlock(maxX);
|
||||
final int iMinY = Location.locToBlock(minY - 0.5626);
|
||||
if (iMinY > maxBlockY) return false;
|
||||
if (iMinY > maxBlockY) {
|
||||
// TODO: Keep checking this, does not apply for biger values of yOnGround.
|
||||
return false;
|
||||
}
|
||||
final int iMaxY = Math.min(Location.locToBlock(maxY), maxBlockY);
|
||||
final int iMinZ = Location.locToBlock(minZ);
|
||||
final int iMaxZ = Location.locToBlock(maxZ);
|
||||
|
Loading…
Reference in New Issue
Block a user