From 2262639182ff1b8c7bc0a11a916ea77700f9a46b Mon Sep 17 00:00:00 2001 From: KAMKEEL Date: Sat, 8 May 2021 03:51:29 -0400 Subject: [PATCH] Create Dev Branch Add Scripting for ModelType --- .../npcs/entity/EntityNPCInterface.java | 1 + .../java/noppes/npcs/scripted/ScriptNpc.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index d3a2ddcb2..e1f6e3956 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -1699,6 +1699,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti { return this.display.modelType; } + public void setModelType(int val) { this.display.modelType = val; diff --git a/src/main/java/noppes/npcs/scripted/ScriptNpc.java b/src/main/java/noppes/npcs/scripted/ScriptNpc.java index 1a07d2f77..304b5eefc 100644 --- a/src/main/java/noppes/npcs/scripted/ScriptNpc.java +++ b/src/main/java/noppes/npcs/scripted/ScriptNpc.java @@ -57,6 +57,25 @@ public class ScriptNpc extends ScriptLiving{ npc.display.modelSize = size; npc.script.clientNeedsUpdate = true; } + + /** + * @return Returns the current npcs modelType of the NPC + */ + public int getModelType(){ + return npc.display.modelType; + } + + /** + * @param modelType The modelType of the NPC. 0: Steve, 1: Steve64, 2: Alex + */ + public void setModelType(int modelType){ + if(modelType > 2) + modelType = 2; + else if(modelType < 0) + modelType = 0; + npc.display.modelType = modelType; + npc.script.clientNeedsUpdate = true; + } /** * @return The npcs name