mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 06:14:52 +00:00
Refresh block bounds before reading a collision box so top slabs report the right height
This commit is contained in:
1 parent
9ff4b8ae16
commit
715b38e694
2 files changed
+3
No files matched your search
@@ -1686,6 +1686,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
break;
|
||||
}
|
||||
Block block = worldObj.getBlock(i, ii, k);
|
||||
block.setBlockBoundsBasedOnState(worldObj, i, ii, k);
|
||||
AxisAlignedBB bb = block.getCollisionBoundingBoxFromPool(worldObj, i, ii, k);
|
||||
if (bb != null) {
|
||||
yy = bb.maxY;
|
||||
@@ -1695,6 +1696,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
Block block = worldObj.getBlock(i, ii, k);
|
||||
if (block == null || block == Blocks.air)
|
||||
continue;
|
||||
block.setBlockBoundsBasedOnState(worldObj, i, ii, k);
|
||||
AxisAlignedBB bb = block.getCollisionBoundingBoxFromPool(worldObj, i, ii, k);
|
||||
if (bb == null)
|
||||
continue;
|
||||
|
||||
@@ -175,6 +175,7 @@ public class ScriptBlock implements IBlock {
|
||||
}
|
||||
|
||||
public boolean canCollide(double maxVolume) {
|
||||
block.setBlockBoundsBasedOnState(world.getMCWorld(), getX(), getY(), getZ());
|
||||
AxisAlignedBB alignedBB = block.getCollisionBoundingBoxFromPool(world.getMCWorld(), getX(), getY(), getZ());
|
||||
if (alignedBB == null) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user