mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 16:37:45 +00:00
Fixed stored data not saving after death in singleplayer.
This commit is contained in:
1 parent
041aad48ca
commit
326447bf7a
1 file changed
+11
@@ -280,6 +280,17 @@ public class ServerEventsHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerClone(PlayerEvent.Clone event) {
|
||||
if (event.entity.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
NBTTagCompound storedData = event.original.getEntityData().getCompoundTag("CNPCStoredData");
|
||||
if (!storedData.hasNoTags()) {
|
||||
event.entityPlayer.getEntityData().setTag("CNPCStoredData", storedData);
|
||||
}
|
||||
}
|
||||
|
||||
private void doExcalibur(EntityPlayer player, EntityLivingBase entity) {
|
||||
ItemStack item = player.getCurrentEquippedItem();
|
||||
if(item == null || item.getItem() != CustomItems.excalibur)
|
||||
|
||||
Reference in new issue
Block a user