Fix getTopBlock

This commit is contained in:
Kam committed 2025-05-29 20:59:01 -04:00
1 parent 2b5fcc12cc
commit d119a7524e
1 file changed
+5 -1
@@ -136,7 +136,11 @@ public class ScriptWorld implements IWorld {
}
public IBlock getTopBlock(int x, int z) {
return NpcAPI.Instance().getIBlock(this, x, world.getTopSolidOrLiquidBlock(x, z), z);
int yAbove = world.getTopSolidOrLiquidBlock(x, z);
if (yAbove <= 0) {
return null;
}
return NpcAPI.Instance().getIBlock(this, x, yAbove - 1, z);
}
public IBlock getTopBlock(IPos pos) {