diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-20 11:47:07 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-20 11:47:07 +0200 |
| commit | 188150bf829add4418cdbb15f679d705b489ff9e (patch) | |
| tree | e7929744805fb38233697de46626b3301c8da158 /common | |
| parent | d8bcaa05a5536f76aaf3d2286d3bb1c368586d1e (diff) | |
Working stuff
Diffstat (limited to 'common')
6 files changed, 24 insertions, 3 deletions
diff --git a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java b/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java index d151808..967aa18 100644 --- a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java +++ b/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java @@ -66,12 +66,14 @@ public class BlockJewelrsCraftingTable extends BlockContainer if (te.hasModifier && entityPlayer.isSneaking()) { entityPlayer.inventory.addItemStackToInventory(new ItemStack(te.modifier.itemID, 1, te.modifier.getItemDamage())); + entityPlayer.inventory.onInventoryChanged(); te.modifier = new ItemStack(0, 0, 0); te.hasModifier = false; } if (te.hasJewel && entityPlayer.isSneaking()) { entityPlayer.inventory.addItemStackToInventory(new ItemStack(te.jewel.itemID, 1, te.jewel.getItemDamage())); + entityPlayer.inventory.onInventoryChanged(); te.jewel = new ItemStack(0, 0, 0); te.hasJewel = false; } @@ -87,6 +89,7 @@ public class BlockJewelrsCraftingTable extends BlockContainer { ItemRing.addEffect(item, Potion.fireResistance.id); player.inventory.addItemStackToInventory(item); + player.inventory.onInventoryChanged(); } } diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java index a3df95f..7967cbd 100644 --- a/common/darkknight/jewelrycraft/block/BlockMolder.java +++ b/common/darkknight/jewelrycraft/block/BlockMolder.java @@ -57,6 +57,7 @@ public class BlockMolder extends BlockContainer if (te.hasMold && entityPlayer.isSneaking() && !world.isRemote) { entityPlayer.inventory.addItemStackToInventory(new ItemStack(te.mold.itemID, 1, te.mold.getItemDamage())); + entityPlayer.inventory.onInventoryChanged(); te.mold = new ItemStack(0, 0, 0); te.hasMold = false; te.isDirty = true; @@ -121,6 +122,7 @@ public class BlockMolder extends BlockContainer ItemRing.addMetal(item, metal); } player.inventory.addItemStackToInventory(item); + player.inventory.onInventoryChanged(); } } diff --git a/common/darkknight/jewelrycraft/block/BlockSmelter.java b/common/darkknight/jewelrycraft/block/BlockSmelter.java index 8e97769..57501a2 100644 --- a/common/darkknight/jewelrycraft/block/BlockSmelter.java +++ b/common/darkknight/jewelrycraft/block/BlockSmelter.java @@ -80,7 +80,7 @@ public class BlockSmelter extends BlockContainer ItemStack item = entityPlayer.inventory.getCurrentItem(); if (te != null && !world.isRemote) { - if (!te.hasMetal && !te.hasMoltenMetal && item != null && item.getDisplayName().contains("Ingot") && !item.getDisplayName().contains("Mold")) + if (!te.hasMetal && !te.hasMoltenMetal && item != null && item.getUnlocalizedName().toLowerCase().contains("ingot") && !item.getDisplayName().contains("Mold")) { entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.jewelrycraft.smelter.nowsmeltingingot", item.getDisplayName())); te.metal = new ItemStack(item.itemID, 1, item.getItemDamage()); diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java index 3941770..1207bac 100644 --- a/common/darkknight/jewelrycraft/item/ItemRing.java +++ b/common/darkknight/jewelrycraft/item/ItemRing.java @@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class ItemRing extends ItemBase @@ -69,6 +70,21 @@ public class ItemRing extends ItemBase return 0; } + public String getItemDisplayName(ItemStack stack) + { + if (stack.hasTagCompound()) + { + if (stack.getTagCompound().hasKey("ingot")) + { + NBTTagCompound ingotNBT = (NBTTagCompound) stack.getTagCompound().getTag("ingot"); + ItemStack ingotStack = new ItemStack(0, 0, 0); + ingotStack.readFromNBT(ingotNBT); + return ingotStack.getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + } + return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); + } + public static void addMetal(ItemStack item, ItemStack metal) { NBTTagCompound itemStackData; diff --git a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java index 7806104..f026fb5 100644 --- a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java +++ b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java @@ -43,7 +43,7 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer ResourceLocation lava = new ResourceLocation("jewelrycraft", texture); Minecraft.getMinecraft().renderEngine.bindTexture(lava); me.mold.getIconIndex().getInterpolatedU(0); - int decal = 64; + int decal = 0; int decal2 = 0; // if (me.mold.getItemDamage() == 0) // decal = 32; diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index 70f0346..608ceb9 100644 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -77,7 +77,7 @@ public class TileEntityMolder extends TileEntity } if (moltenMetal.itemID != 0) { - this.worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F); + if(worldObj.rand.nextInt(20) == 0) this.worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F); for (int l = 0; l < 2; ++l) { //EntityFX entityfx = new EntityReddustFX(this.worldObj, (double)xCoord + Math.random(), (double)yCoord + 0.2D, (double)zCoord + Math.random(), 0.0F, 0.0F, 0.0F); |
