Skip to content

Commit

Permalink
Clean up Glass Arrows a bit #1296
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Jan 2, 2015
1 parent 3bea7e5 commit 58db702
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -952,3 +952,6 @@ manual.page.material6=Material Trait: Reinforced
manual.page.material7=Reinforced level
manual.page.material8=Stonebound level
manual.page.material9=Splintering level

tool.glassarrows=Glass Arrows
tool.glassarrows.lore=Crafted by a legendary Glassmaker
1 change: 1 addition & 0 deletions src/main/java/tconstruct/items/tools/FryingPan.java
Expand Up @@ -56,6 +56,7 @@ public void getSubItems (Item id, CreativeTabs tab, List list)
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 2), new ItemStack(getHandleItem(), 1, 16), null, "Bane of Pigs");

NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean("Special", true);
tags.setInteger("Modifiers", 0);
tags.setInteger("Attack", Integer.MAX_VALUE / 100);
tags.setInteger("TotalDurability", Integer.MAX_VALUE / 100);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tconstruct/items/tools/Hammer.java
Expand Up @@ -158,6 +158,7 @@ public void getSubItems (Item id, CreativeTabs tab, List list)
ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 10), new ItemStack(getHandleItem(), 1, 8), new ItemStack(getAccessoryItem(), 1, 11), new ItemStack(getExtraItem(), 1, 11), "InfiMiner");

NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean("Special", true);
tags.setInteger("Modifiers", 0);
tags.setInteger("Attack", Integer.MAX_VALUE / 100);
tags.setInteger("TotalDurability", Integer.MAX_VALUE / 100);
Expand Down
20 changes: 12 additions & 8 deletions src/main/java/tconstruct/weaponry/items/GlassArrows.java
Expand Up @@ -2,10 +2,14 @@

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import tconstruct.library.client.TConstructClientRegistry;
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.util.Reference;
Expand All @@ -25,20 +29,13 @@ public float getAmmoModifier() {
return 1.0f;
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
super.addInformation(stack, player, list, par4);

list.add(EnumChatFormatting.DARK_PURPLE + "Crafted by a legendary Glassmaker");
}

@Override
public void getSubItems(Item id, CreativeTabs tab, List list) {
ItemStack headStack = new ItemStack(getHeadItem(), 1, 0);
ItemStack handleStack = new ItemStack(getHandleItem(), 1, 0); // wooden shaft
ItemStack accessoryStack = new ItemStack(getAccessoryItem(), 1, 0); // feather fletchling

ItemStack tool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, null, "");
ItemStack tool = ToolBuilder.instance.buildTool(headStack, handleStack, accessoryStack, null, this.getLocalizedToolName());
if (tool != null)
{
tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true);
Expand All @@ -48,6 +45,7 @@ public void getSubItems(Item id, CreativeTabs tab, List list) {

// now turn it into legendary glass arrows!
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
tags.setBoolean("Special", true);
tags.setInteger("TotalDurability", 100); // 100 arrows
tags.setInteger("Ammo", 100); // full ammo
tags.setFloat("Mass", 5.0f); // durp
Expand All @@ -56,6 +54,7 @@ public void getSubItems(Item id, CreativeTabs tab, List list) {
tags.setFloat("Shoddy", 0); // no stonebound/jagged
tags.setInteger("Unbreaking", 0); // no reinforced
tags.setInteger("Attack", 10); // insane damage!
tags.setInteger("Modifiers", 0);

// now make them look like glass
tags.setInteger("RenderHead", -1);
Expand All @@ -65,6 +64,11 @@ public void getSubItems(Item id, CreativeTabs tab, List list) {
tags.setInteger("HandleColor", 0xbcfff3);
tags.setInteger("AccessoryColor", 0xccfff3);

NBTTagList lore = new NBTTagList();
lore.appendTag(new NBTTagString(StatCollector.translateToLocal("tool.glassarrows.lore")));

tool.getTagCompound().getCompoundTag("display").setTag("Lore", lore);

list.add(tool);
}
}

1 comment on commit 58db702

@Adaptivity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, thanks.

Please sign in to comment.