Added get/setRotationType to ScriptNpc. Added get/setMotion for x, y, z components to ScriptEntity. Fixed an NPC wand crash.

This commit is contained in:
luisc committed 2021-12-29 16:22:05 -06:00
1 parent e676c808e3
commit e6f97784ff
6 files changed
+68 -27

No files matched your search

@@ -2,10 +2,7 @@ package noppes.npcs.scripted.entity;
import net.minecraft.item.ItemStack;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.constants.EnumAnimation;
import noppes.npcs.constants.EnumJobType;
import noppes.npcs.constants.EnumNavType;
import noppes.npcs.constants.EnumRoleType;
import noppes.npcs.constants.*;
import noppes.npcs.controllers.Line;
import noppes.npcs.entity.EntityCustomNpc;
import noppes.npcs.entity.EntityNPCInterface;
@@ -90,6 +87,17 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
npc.ai.orientation = (int)rotation;
super.setRotation(rotation);
}
public void setRotationType(int rotationType){
for (EnumStandingType e : EnumStandingType.values()) {
if (e.ordinal() == rotationType) {
npc.ai.standingType = e;
break;
}
}
}
public int getRotationType(){
return npc.ai.standingType.ordinal();
}
/**
* @param name The name of the npc
*/