Save the owner NBT without gameprofile properties

This commit is contained in:
mezz committed 2016-03-03 22:01:33 -08:00
1 parent 5a901ffa36
commit 86e3ae87fd
10 files changed
+49 -27

No files matched your search

+2 -3
View File
@@ -15,7 +15,6 @@ import java.util.Locale;
import java.util.UUID;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTUtil;
import com.mojang.authlib.GameProfile;
@@ -69,7 +68,7 @@ public class MailAddress implements INbtWritable, IMailAddress {
gameProfile = invalidGameProfile;
} else if (nbt.hasKey("profile")) {
NBTTagCompound profileTag = nbt.getCompoundTag("profile");
gameProfile = NBTUtil.readGameProfileFromNBT(profileTag);
gameProfile = PlayerUtil.readGameProfileFromNBT(profileTag);
}
this.type = type;
@@ -141,7 +140,7 @@ public class MailAddress implements INbtWritable, IMailAddress {
if (gameProfile != null) {
NBTTagCompound profileNbt = new NBTTagCompound();
NBTUtil.writeGameProfile(profileNbt, gameProfile);
PlayerUtil.writeGameProfile(profileNbt, gameProfile);
nbttagcompound.setTag("profile", profileNbt);
}
}
@@ -16,7 +16,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
@@ -36,6 +35,7 @@ import forestry.core.inventory.IInventoryAdapter;
import forestry.core.inventory.InventoryAdapter;
import forestry.core.utils.InventoryUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.PlayerUtil;
import forestry.core.utils.StringUtil;
import forestry.mail.inventory.InventoryTradeStation;
import forestry.mail.items.EnumStampDefinition;
@@ -86,7 +86,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
if (nbttagcompound.hasKey("owner")) {
owner = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("owner"));
owner = PlayerUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("owner"));
}
if (nbttagcompound.hasKey("address")) {
@@ -102,7 +102,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve
public void writeToNBT(NBTTagCompound nbttagcompound) {
if (owner != null) {
NBTTagCompound nbt = new NBTTagCompound();
NBTUtil.writeGameProfile(nbt, owner);
PlayerUtil.writeGameProfile(nbt, owner);
nbttagcompound.setTag("owner", nbt);
}