Merge pull request #59 from c0508383/master

CNPC+ 1.6 Fixes
This commit is contained in:
Luis C.M authored and GitHub committed 2022-06-15 00:57:57 -05:00
commit c6cdae5106
7 files changed
+36 -3

No files matched your search

@@ -2,6 +2,7 @@ package noppes.npcs.entity.data;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import noppes.npcs.CustomNpcs;
import noppes.npcs.Server;
import noppes.npcs.constants.EnumPacketClient;
import noppes.npcs.controllers.data.PlayerData;
@@ -51,13 +52,17 @@ public class DataSkinOverlays implements IOverlayHandler {
if (parent instanceof PlayerData) {
NBTTagCompound compound = this.writeToNBT(new NBTTagCompound());
((PlayerData) parent).player.getEntityData().setTag("SkinOverlayData", compound.getTagList("SkinOverlayData",10));
Server.sendToAll(EnumPacketClient.PLAYER_UPDATE_SKIN_OVERLAYS, ((PlayerData) parent).player.getEntityId(), compound);
Server.sendToAll(EnumPacketClient.PLAYER_UPDATE_SKIN_OVERLAYS, ((PlayerData) parent).player.getCommandSenderName(), compound);
} else if (parent instanceof EntityNPCInterface) {
((EntityNPCInterface) parent).updateClient = true;
}
}
public void add(int id, ISkinOverlay data) {
if (this.overlayList.size() >= CustomNpcs.SkinOverlayLimit) {
return;
}
((SkinOverlay) data).parent = this;
this.overlayList.put(id, data);
updateClient();