diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-16 19:14:29 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-16 19:14:29 +0200 |
| commit | a51234bf851a4249b6d884a63b0cfa8bfea6bc0c (patch) | |
| tree | 673f67ef726079fef89e267b3eafc4e75ce36706 /common | |
| parent | f9d492fbb509e9e2b4b3a2fcf1ab04e322940bf2 (diff) | |
Minor changes
Diffstat (limited to 'common')
| -rw-r--r-- | common/darkknight/jewelrycraft/item/ItemThiefGloves.java | 36 | ||||
| -rw-r--r-- | common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java | 17 |
2 files changed, 45 insertions, 8 deletions
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<SHIFT>§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); - } } } |
