mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 18:57:32 +00:00
Fix getTopBlock
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user