mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-15 16:38:57 +02:00
Add null check and refine preconditions for on-ground shortcut.
This commit is contained in:
parent
f20fc8575d
commit
0eaf9587d8
@ -446,9 +446,11 @@ public class PlayerLocation {
|
||||
final long flags = BlockProperties.getBlockFlags(id);
|
||||
if ((flags & BlockProperties.F_GROUND) != 0 && (flags & BlockProperties.F_VARIABLE) == 0){
|
||||
final double[] bounds = blockCache.getBounds(blockX, bY, blockZ);
|
||||
if (BlockProperties.collidesBlock(blockCache, x, minY - yOnGround, z, x, minY, z, blockX, bY, blockZ, id, bounds, flags)){
|
||||
// Check collision if not inside of the block. [Might be a problem for cauldron or similar + something solid above.]
|
||||
if (bounds != null && y - bY >= bounds[4] && BlockProperties.collidesBlock(blockCache, x, minY - yOnGround, z, x, minY, z, blockX, bY, blockZ, id, bounds, flags)){
|
||||
// TODO: passable vs maxY ?
|
||||
if (!BlockProperties.isPassableWorkaround(blockCache, blockX, bY, blockZ, minX - blockX, minY - yOnGround - bY, minZ - blockZ, id, maxX - minX, yOnGround, maxZ - minZ, 1.0)){
|
||||
// TODO: Might have to exclude on base of maxY, for case of being inside of blocks doors etc.
|
||||
onGround = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user