Added a modifiable and toggleable flying height limit to NPCs

This commit is contained in:
luisc committed 2022-01-13 05:28:20 -06:00
1 parent 04def38b63
commit 555ceb741f
5 files changed
+81 -6

No files matched your search

@@ -1040,6 +1040,23 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
return npc.ai.flyGravity;
}
public void setFlyHeightLimit(int flyHeightLimit){
if(flyHeightLimit < 0)
flyHeightLimit = 0;
this.npc.ai.flyHeightLimit = flyHeightLimit;
}
public int getFlyHeightLimit(int flyHeightLimit){
return this.npc.ai.flyHeightLimit;
}
public void limitFlyHeight(boolean limit){
this.npc.ai.hasFlyLimit = limit;
}
public boolean isFlyHeightLimited(boolean limit){
return this.npc.ai.hasFlyLimit;
}
public void setSpeed(int speed) {
npc.ai.setWalkingSpeed(speed);
}