From a51234bf851a4249b6d884a63b0cfa8bfea6bc0c Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 16 Dec 2013 19:14:29 +0200 Subject: Minor changes --- .../jewelrycraft/item/ItemThiefGloves.java | 36 ++++++++++++++++++++++ .../jewelrycraft/tileentity/TileEntityMolder.java | 17 +++++----- 2 files changed, 45 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java index 3621dae..5e43010 100644 --- a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java +++ b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java @@ -1,9 +1,14 @@ package darkknight.jewelrycraft.item; import java.util.Iterator; +import java.util.List; import java.util.Random; +import org.lwjgl.input.Keyboard; + +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; @@ -11,6 +16,7 @@ import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; @@ -21,6 +27,7 @@ public class ItemThiefGloves extends ItemBase { super(par1); this.setCreativeTab(CreativeTabs.tabTools); + this.setMaxStackSize(1); } @Override @@ -61,5 +68,34 @@ public class ItemThiefGloves extends ItemBase return super.itemInteractionForEntity(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); } } + @SuppressWarnings("unchecked") + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if(!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions()); + else{ + list.add(EnumChatFormatting.GRAY + "Right click with the gloves,"); + list.add(EnumChatFormatting.GRAY + "while sneaking, on a villager"); + list.add(EnumChatFormatting.GRAY + "to steal his stuff."); + } + } + + public static boolean shouldAddAdditionalInfo() + { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + return true; + } + } + return false; + } + + + public static String additionalInfoInstructions() + { + String message = "§oPress §b§7§o for more information."; + return message; + } } diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java index e52aaf4..600bc0f 100644 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java @@ -69,11 +69,19 @@ public class TileEntityMolder extends TileEntity public void updateEntity() { super.updateEntity(); + if(moltenMetal.itemID != 0) + { + this.worldObj.playSoundEffect((double)((float)xCoord + 0.5F), (double)((float)yCoord + 0.5F), (double)((float)zCoord + 0.5F), "random.fizz", 0.5F, 2.6F + 0.2F * 0.8F); + 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); + this.worldObj.spawnParticle("reddust", (double)xCoord + Math.random(), (double)yCoord + 0.2F, (double)zCoord + Math.random(), 0.0D, 1.0D, 1.0D); + } + } if(this.hasMoltenMetal && !this.hasJewelBase) { ringMetal = moltenMetal; if(cooling > 0) this.cooling--; - System.out.println(mold.getItemDamage()); if(cooling == 0) { this.hasMoltenMetal = false; @@ -82,13 +90,6 @@ public class TileEntityMolder extends TileEntity this.moltenMetal = new ItemStack(0, 0, 0); this.hasJewelBase = true; } - - this.worldObj.playSoundEffect((double)((float)xCoord + 0.5F), (double)((float)yCoord + 0.5F), (double)((float)zCoord + 0.5F), "random.fizz", 0.5F, 2.6F + 0.2F * 0.8F); - for (int l = 0; l < 4; ++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); - this.worldObj.spawnParticle("reddust", (double)xCoord, (double)yCoord + 0.2F, (double)zCoord, 0.0D, 1.0D, 0.0D); - } } } -- cgit v1.2.3