mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Linked the custom tint data class to the DataDisplay
This commit is contained in:
1 parent
4a7315ac8c
commit
a86ab2b84d
1 file changed
+8
@@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.CustomTintData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataSkinOverlays;
|
||||
@@ -61,12 +62,15 @@ public class DataDisplay {
|
||||
//0 - Yes, 1 - No, 2 - Only NPCs, 3 - Only Players, 4 - NPCs and Players
|
||||
public int collidesWith = 1;
|
||||
|
||||
public CustomTintData customTintData;
|
||||
|
||||
public DataDisplay(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
markovGeneratorId = new Random().nextInt(CustomNpcs.MARKOV_GENERATOR.length-1);
|
||||
skinOverlayData = new DataSkinOverlays(npc);
|
||||
name = getRandomName();
|
||||
animationData = new AnimationData(this);
|
||||
customTintData = new CustomTintData();
|
||||
}
|
||||
|
||||
public String getRandomName() {
|
||||
@@ -89,6 +93,8 @@ public class DataDisplay {
|
||||
|
||||
nbttagcompound = animationData.writeToNBT(nbttagcompound);
|
||||
|
||||
nbttagcompound = customTintData.writeToNBT(nbttagcompound);
|
||||
|
||||
if (this.playerProfile != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
@@ -166,6 +172,8 @@ public class DataDisplay {
|
||||
|
||||
animationData.readFromNBT(nbttagcompound);
|
||||
|
||||
customTintData.readFromNBT(nbttagcompound);
|
||||
|
||||
modelSize = ValueUtil.clamp(nbttagcompound.getInteger("Size"), 1, Integer.MAX_VALUE);
|
||||
if(modelSize > ConfigMain.NpcSizeLimit)
|
||||
modelSize = ConfigMain.NpcSizeLimit;
|
||||
|
||||
Reference in new issue
Block a user