Added collision options for CNPCs.

This commit is contained in:
luisc committed 2022-01-14 19:07:41 -06:00
1 parent 4f38edc147
commit 007660f16f
5 files changed
+88 -6

No files matched your search

@@ -52,6 +52,9 @@ public class DataDisplay {
public ArrayList<UUID> invisibleToList = new ArrayList<>();
//0 - Yes, 1 - No, 2 - Only NPCs, 3 - Only Players, 4 - NPCs and Players
public int collidesWith = 1;
public DataDisplay(EntityNPCInterface npc){
this.npc = npc;
@@ -120,6 +123,8 @@ public class DataDisplay {
nbttagcompound.setBoolean("NoLivingAnimation", disableLivingAnimation);
nbttagcompound.setByte("BossBar", showBossBar);
nbttagcompound.setInteger("CollidesWith",collidesWith);
NBTTagList list = new NBTTagList();
for(UUID uuid : invisibleToList){
list.appendTag(new NBTTagString(uuid.toString()));
@@ -179,6 +184,11 @@ public class DataDisplay {
invisibleToList = new ArrayList<>();
}
if(nbttagcompound.hasKey("CollidesWith"))
collidesWith = nbttagcompound.getInteger("CollidesWith");
else
collidesWith = 1;
if(prevSkinType != skinType || !texture.equals(prevTexture))
npc.textureLocation = null;
npc.textureGlowLocation = null;