Skip to content

Commit

Permalink
add RF to shortbow
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 17, 2013
1 parent 8fa0894 commit 7d4625a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/tconstruct/items/tools/Shortbow.java
Expand Up @@ -96,7 +96,7 @@ public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boo
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (!stack.hasTagCompound())
if (!stack.hasTagCompound())
return;

NBTTagCompound tags = stack.getTagCompound();
Expand All @@ -119,6 +119,24 @@ else if (power > this.getMaxCharge(stack) * 2 / 3)
String charge = new StringBuilder().append(color).append(tags.getInteger("charge")).append("/").append(getMaxCharge(stack)).append(" EU").toString();
list.add(charge);
}
if (tags.hasKey("Energy"))
{
String color = "";
int RF = tags.getInteger("Energy");

if (RF != 0)
{
if (RF <= this.getMaxEnergyStored(stack) / 3)
color = "\u00a74";
else if (RF > this.getMaxEnergyStored(stack) * 2 / 3)
color = "\u00a72";
else
color = "\u00a76";
}

String energy = new StringBuilder().append(color).append(tags.getInteger("Energy")).append("/").append(getMaxEnergyStored(stack)).append(" RF").toString();
list.add(energy);
}
if (tags.hasKey("InfiTool"))
{
boolean broken = tags.getCompoundTag("InfiTool").getBoolean("Broken");
Expand Down

0 comments on commit 7d4625a

Please sign in to comment.