mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 10:22:25 +00:00
Fixed SkinOverlay objects not having their parent object initialized correctly.
This commit is contained in:
1 parent
6220a8ce14
commit
b6c62332ed
14 files changed
+29
-40
No files matched your search
@@ -3,7 +3,7 @@ package noppes.npcs.entity.data;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.controllers.PlayerData;
|
||||
import noppes.npcs.controllers.data.SkinOverlayData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.interfaces.ISkinOverlay;
|
||||
import noppes.npcs.scripted.interfaces.handler.IOverlayHandler;
|
||||
@@ -23,7 +23,8 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
NBTTagList skinOverlayList = nbtTagCompound.getTagList("SkinOverlayData",10);
|
||||
for (int i = 0; i < skinOverlayList.tagCount(); i++) {
|
||||
int tagID = skinOverlayList.getCompoundTagAt(i).getInteger("SkinOverlayID");
|
||||
SkinOverlayData skinOverlay = (SkinOverlayData) SkinOverlayData.overlayFromNBT(skinOverlayList.getCompoundTagAt(i));
|
||||
SkinOverlay skinOverlay = (SkinOverlay) SkinOverlay.overlayFromNBT(skinOverlayList.getCompoundTagAt(i));
|
||||
skinOverlay.parent = this;
|
||||
skinOverlays.put(tagID, skinOverlay);
|
||||
}
|
||||
|
||||
@@ -36,7 +37,7 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
for (Map.Entry<Integer,ISkinOverlay> overlayData : this.overlayList.entrySet()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setInteger("SkinOverlayID", overlayData.getKey());
|
||||
compound = ((SkinOverlayData) overlayData.getValue()).writeToNBT(compound);
|
||||
compound = ((SkinOverlay) overlayData.getValue()).writeToNBT(compound);
|
||||
overlayList.appendTag(compound);
|
||||
}
|
||||
}
|
||||
@@ -54,7 +55,7 @@ public class DataSkinOverlays implements IOverlayHandler {
|
||||
}
|
||||
|
||||
public void add(int id, ISkinOverlay data) {
|
||||
((SkinOverlayData) data).parent = this;
|
||||
((SkinOverlay) data).parent = this;
|
||||
this.overlayList.put(id, data);
|
||||
updateClient();
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ package noppes.npcs.entity.old;
|
||||
|
||||
import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.ModelData;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.controllers.data.SkinOverlayData;
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
public class EntityNPCEnderman extends EntityNpcEnderchibi
|
||||
@@ -20,7 +19,7 @@ public class EntityNPCEnderman extends EntityNpcEnderchibi
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/enderman/enderman.png";
|
||||
//display.glowTexture = ;
|
||||
display.skinOverlayData.overlayList.put(0,new SkinOverlayData(
|
||||
display.skinOverlayData.overlayList.put(0,new SkinOverlay(
|
||||
"customnpcs:textures/overlays/ender_eyes.png", true, 1.0F, 1.0F, 0.0F, 0.0F,
|
||||
1.0F, 1.0F, 0.0F, 0.0F, 0.0F
|
||||
));
|
||||
|
||||
Reference in new issue
Block a user