From e86949a1ad3269ec66c9de65e2c92f5e66251411 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 23 Mar 2015 14:25:27 +0000 Subject: More stuff. I don't even know by this point.... --- java/darkknight/jewelrycraft/util/JewelrycraftUtil.java | 10 +++++----- java/darkknight/jewelrycraft/util/PlayerUtils.java | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'java/darkknight/jewelrycraft/util') diff --git a/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java b/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java index 70129f0..cd2328c 100644 --- a/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java +++ b/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java @@ -51,16 +51,16 @@ public class JewelrycraftUtil jewelry.add(new ItemStack(ItemList.earrings)); for(Object item: GameData.getItemRegistry()){ ArrayList items = new ArrayList(); - if (((Item)item).getHasSubtypes()){ - for(int i = 0; i < ((Item)item).getMaxDamage(); i++) - items.add(new ItemStack((Item)item, 1, i)); - }else objects.add(new ItemStack((Item)item)); + if (item != null && ((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, null, items); + else objects.add(new ItemStack((Item)item)); + if (!items.isEmpty()) objects.addAll(items); } } /** - * Adds curse points to a player + * Adds curse points to a player + * * @param player the player to add the points to * @param points amount of curse points */ diff --git a/java/darkknight/jewelrycraft/util/PlayerUtils.java b/java/darkknight/jewelrycraft/util/PlayerUtils.java index 159ea98..f1655c0 100644 --- a/java/darkknight/jewelrycraft/util/PlayerUtils.java +++ b/java/darkknight/jewelrycraft/util/PlayerUtils.java @@ -1,5 +1,6 @@ package darkknight.jewelrycraft.util; +import darkknight.jewelrycraft.events.ScreenHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -17,6 +18,8 @@ public class PlayerUtils */ public static NBTTagCompound getModPlayerPersistTag(EntityPlayer player, String modName) { + if (player.worldObj.isRemote && ScreenHandler.tagCache != null) return ScreenHandler.tagCache; + NBTTagCompound tag = player.getEntityData(); NBTTagCompound persistTag = null; if (tag.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) persistTag = tag.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); -- cgit v1.2.3