From 38bdab15fdd3ae15b0200fc238eaaf838e5d06f4 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 17 Oct 2015 20:53:28 +0200 Subject: [PATCH] Hopefully fixed PersistentServerData sometimes not remembering the data --- .../actuallyadditions/event/EntityConstructingEvent.java | 2 +- .../actuallyadditions/util/playerdata/PersistentServerData.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/event/EntityConstructingEvent.java b/src/main/java/ellpeck/actuallyadditions/event/EntityConstructingEvent.java index b6a65afe8..42b6cfa8f 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/EntityConstructingEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/EntityConstructingEvent.java @@ -20,7 +20,7 @@ public class EntityConstructingEvent{ @SubscribeEvent public void onEntityConstructing(EntityEvent.EntityConstructing event){ - if(event.entity instanceof EntityPlayer){ + if(event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote){ if(PersistentServerData.get((EntityPlayer)event.entity) == null){ event.entity.registerExtendedProperties(ModUtil.MOD_ID, new PersistentServerData()); } diff --git a/src/main/java/ellpeck/actuallyadditions/util/playerdata/PersistentServerData.java b/src/main/java/ellpeck/actuallyadditions/util/playerdata/PersistentServerData.java index e8d48a82a..c7cd58aa6 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/playerdata/PersistentServerData.java +++ b/src/main/java/ellpeck/actuallyadditions/util/playerdata/PersistentServerData.java @@ -34,7 +34,7 @@ public class PersistentServerData implements IExtendedEntityProperties{ public void saveNBTData(NBTTagCompound aComp){ NBTTagCompound compound = new NBTTagCompound(); - compound.setBoolean("BookGotten", bookGottenAlready); + compound.setBoolean("BookGotten", this.bookGottenAlready); aComp.setTag(ModUtil.MOD_ID, compound); }