diff --git a/src/api b/src/api index b01571459..bbf27531e 160000 --- a/src/api +++ b/src/api @@ -1 +1 @@ -Subproject commit b015714592865effd5d1092f1b9e8ac693811cc5 +Subproject commit bbf27531eb7d01751c209072aaca0f8e675f4390 diff --git a/src/main/java/noppes/npcs/scripted/entity/ScriptEntity.java b/src/main/java/noppes/npcs/scripted/entity/ScriptEntity.java index a28b88b9d..af779cb9a 100644 --- a/src/main/java/noppes/npcs/scripted/entity/ScriptEntity.java +++ b/src/main/java/noppes/npcs/scripted/entity/ScriptEntity.java @@ -728,6 +728,11 @@ public class ScriptEntity implements IEntity { entity.rotationYaw = rotation; } + public void setRotation(float rotationYaw, float rotationPitch) { + entity.rotationYaw = rotationYaw; + entity.rotationPitch = rotationPitch; + } + /** * @return Current rotation of the entity */ diff --git a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java index b03f59077..0f9d47f34 100644 --- a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java +++ b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java @@ -99,10 +99,16 @@ public class ScriptNpc extends ScriptLiving imp return npc.display.name; } + public void setRotation(float rotationYaw, float rotationPitch) { + this.setRotation(rotationYaw); + npc.rotationPitch = rotationPitch; + } + public void setRotation(float rotation){ npc.ai.orientation = (int)rotation; super.setRotation(rotation); } + public void setRotationType(int rotationType){ for (EnumStandingType e : EnumStandingType.values()) { if (e.ordinal() == rotationType) { @@ -111,9 +117,11 @@ public class ScriptNpc extends ScriptLiving imp } } } + public int getRotationType(){ return npc.ai.standingType.ordinal(); } + /** * @param name The name of the npc */