mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 09:09:08 +00:00
Fix Rotation Get / Set for NPCs
This commit is contained in:
1 parent
44684277ba
commit
a35db3f9e5
2 files changed
+16
-2
No files matched your search
@@ -225,6 +225,16 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
|
||||
return getMCEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(){
|
||||
return entity.renderYawOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotation(float rotation){
|
||||
entity.renderYawOffset = rotation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the entity swing its hand
|
||||
*/
|
||||
|
||||
@@ -93,8 +93,12 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
}
|
||||
|
||||
public void setRotation(float rotation){
|
||||
npc.ai.orientation = (int)rotation;
|
||||
super.setRotation(rotation);
|
||||
super.setRotation(rotation);
|
||||
int r = (int) rotation;
|
||||
if(entity.ai.orientation != r) {
|
||||
entity.ai.orientation = r;
|
||||
entity.updateClient = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void setRotationType(int rotationType){
|
||||
|
||||
Reference in new issue
Block a user