From b40a2953324c73d5b88c81032cec2c56a9d0c564 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Fri, 20 Dec 2013 22:14:31 +0200 Subject: Think I fixed the Molder render, as well as made the table work --- common/darkknight/jewelrycraft/item/ItemRing.java | 9 +++++---- .../jewelrycraft/renders/TileEntityMolderRender.java | 12 ++++-------- common/darkknight/jewelrycraft/worldGen/Generation.java | 2 -- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java index 1207bac..1c533e4 100644 --- a/common/darkknight/jewelrycraft/item/ItemRing.java +++ b/common/darkknight/jewelrycraft/item/ItemRing.java @@ -112,6 +112,7 @@ public class ItemRing extends ItemBase } NBTTagCompound potionNBT = new NBTTagCompound(); potionNBT.setInteger("potion", potion); + itemStackData.setTag("potion", potionNBT); } /** @@ -133,10 +134,10 @@ public class ItemRing extends ItemBase if (stack.getTagCompound().hasKey("potion")) { - NBTTagCompound potionNBT = new NBTTagCompound();; + NBTTagCompound potionNBT = (NBTTagCompound) stack.getTagCompound().getTag("potion"); int potion = 0; potion = potionNBT.getInteger("potion"); - list.add(EnumChatFormatting.GREEN + Integer.toString(potion)); + list.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal(new PotionEffect(potion, 4).getEffectName())); } } } @@ -146,12 +147,12 @@ public class ItemRing extends ItemBase { if (stack.hasTagCompound()) { - if(stack.getTagCompound().hasKey("effect")) + if(stack.getTagCompound().hasKey("potion")) { if (par3Entity instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)par3Entity; - NBTTagCompound potionNBT = new NBTTagCompound(); + NBTTagCompound potionNBT = (NBTTagCompound) stack.getTagCompound().getTag("potion"); int potion = 0; potion = potionNBT.getInteger("potion"); if(potion != 0 && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(potion, 4)); diff --git a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java index a5b6830..84d041a 100644 --- a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java +++ b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java @@ -45,14 +45,10 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer me.mold.getIconIndex().getInterpolatedU(0); int decal = -4; int decal2 = 4; -// if (me.mold.getItemDamage() == 0) -// decal = 32; -// else if (me.mold.getItemDamage() > 0) -// decal = 64; - double minu = me.mold.getIconIndex().getInterpolatedU(decal2); - double minv = me.mold.getIconIndex().getInterpolatedV(-decal); - double maxu = me.mold.getIconIndex().getInterpolatedU(256*decal2); - double maxv = me.mold.getIconIndex().getInterpolatedV(256*decal); + double minu = me.mold.getIconIndex().getInterpolatedU(decal2 + 48); + double minv = me.mold.getIconIndex().getInterpolatedV(-decal + 32); + double maxu = me.mold.getIconIndex().getInterpolatedU(256*decal2 + 48); + double maxv = me.mold.getIconIndex().getInterpolatedV(256*decal + 32); GL11.glPushMatrix(); GL11.glScalef(1f / 16f, 1f / 16f, 1f / 16f); GL11.glDisable(GL11.GL_LIGHTING); diff --git a/common/darkknight/jewelrycraft/worldGen/Generation.java b/common/darkknight/jewelrycraft/worldGen/Generation.java index 55daf7f..8e7c45b 100644 --- a/common/darkknight/jewelrycraft/worldGen/Generation.java +++ b/common/darkknight/jewelrycraft/worldGen/Generation.java @@ -4,9 +4,7 @@ import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; -import darkknight.jewelrycraft.block.BlockList; import darkknight.jewelrycraft.config.ConfigHandler; public class Generation implements IWorldGenerator -- cgit v1.2.3