summaryrefslogtreecommitdiff
path: root/src/main/java/lance5057/tDefense/finishingAnvil
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/lance5057/tDefense/finishingAnvil')
-rw-r--r--src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Gui_FinishingAnvil.java128
-rw-r--r--src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java493
-rw-r--r--src/main/java/lance5057/tDefense/finishingAnvil/utilities/InjectorLocations.java115
-rw-r--r--src/main/java/lance5057/tDefense/finishingAnvil/utilities/ToolCoreTip.java45
4 files changed, 518 insertions, 263 deletions
diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Gui_FinishingAnvil.java b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Gui_FinishingAnvil.java
index a4167bb..f97fdcc 100644
--- a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Gui_FinishingAnvil.java
+++ b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Gui_FinishingAnvil.java
@@ -1,7 +1,12 @@
package lance5057.tDefense.finishingAnvil.blocks.finishingAnvil;
+import java.util.ArrayList;
+import java.util.List;
+
import lance5057.tDefense.TinkersDefense;
import lance5057.tDefense.core.network.Message_FinishingAnvil;
+import lance5057.tDefense.finishingAnvil.utilities.Injector;
+import lance5057.tDefense.finishingAnvil.utilities.ToolCoreTip;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.entity.RenderItem;
@@ -12,6 +17,7 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.client.config.GuiButtonExt;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.tools.ToolCore;
@@ -36,7 +42,7 @@ public class Gui_FinishingAnvil extends GuiContainer
private int leftSelect = 0;
private int rightButtonPosX = 0;
- private int rightButtonPosY = 2;
+ private int rightButtonPosY = 0;
private int xRIcon_one, yRIcon_one;
private int xRIcon_two, yRIcon_two;
private int xRIcon_three, yRIcon_three;
@@ -63,20 +69,20 @@ public class Gui_FinishingAnvil extends GuiContainer
public void initGui()
{
super.initGui();
- this.buttonList.add(new GuiButton(1, this.guiLeft + 25, this.guiTop + 10, 10, 10, ""));
- this.buttonList.add(new GuiButton(2, this.guiLeft + 25, this.guiTop + 59, 10, 10, ""));
- this.buttonList.add(new GuiButton(3, this.guiLeft + 47, this.guiTop + 49, 18, 18, ""));
+ this.buttonList.add(new GuiButtonExt(1, this.guiLeft + 25, this.guiTop + 10, 10, 10, "⇑"));
+ this.buttonList.add(new GuiButtonExt(2, this.guiLeft + 25, this.guiTop + 59, 10, 10, "⇓"));
+ this.buttonList.add(new GuiButtonExt(3, this.guiLeft + 47, this.guiTop + 49, 18, 18, "✓"));
- this.buttonList.add(new GuiButton(4, this.guiLeft + 5, this.guiTop + 10, 20, 20, ""));
- this.buttonList.add(new GuiButton(5, this.guiLeft + 5, this.guiTop + 30, 20, 20, ""));
- this.buttonList.add(new GuiButton(6, this.guiLeft + 5, this.guiTop + 50, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(4, this.guiLeft + 5, this.guiTop + 10, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(5, this.guiLeft + 5, this.guiTop + 30, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(6, this.guiLeft + 5, this.guiTop + 50, 20, 20, ""));
- this.buttonList.add(new GuiButton(7, this.guiLeft + 120, this.guiTop + 10, 10, 10, ""));
- this.buttonList.add(new GuiButton(8, this.guiLeft + 120, this.guiTop + 59, 10, 10, ""));
+ this.buttonList.add(new GuiButtonExt(7, this.guiLeft + 120, this.guiTop + 10, 10, 10, "⇑"));
+ this.buttonList.add(new GuiButtonExt(8, this.guiLeft + 120, this.guiTop + 60, 10, 10, "⇓"));
- this.buttonList.add(new GuiButton(9, this.guiLeft + 130, this.guiTop + 10, 20, 20, ""));
- this.buttonList.add(new GuiButton(10, this.guiLeft + 130, this.guiTop + 30, 20, 20, ""));
- this.buttonList.add(new GuiButton(11, this.guiLeft + 130, this.guiTop + 50, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(9, this.guiLeft + 130, this.guiTop + 10, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(10, this.guiLeft + 130, this.guiTop + 30, 20, 20, ""));
+ this.buttonList.add(new GuiButtonExt(11, this.guiLeft + 130, this.guiTop + 50, 20, 20, ""));
}
@@ -91,7 +97,7 @@ public class Gui_FinishingAnvil extends GuiContainer
this.leftButtonPosX--;
break;
case 2:
- if(this.leftButtonPosX + 2 < ((ToolCore) bigCopy.getItem()).getPartAmount())
+ if(this.leftButtonPosX + 3 < ((ToolCore) bigCopy.getItem()).getPartAmount())
this.leftButtonPosX++;
break;
@@ -100,31 +106,43 @@ public class Gui_FinishingAnvil extends GuiContainer
break;
case 4:
- leftSelect = 0;
- rightButtonPosY = 2;
+ leftSelect = 0 + leftButtonPosX;
+ rightButtonPosY = 0 + (leftButtonPosX * 3);
break;
case 5:
- leftSelect = 1;
- rightButtonPosY = 3;
+ leftSelect = 1 + leftButtonPosX;
+ rightButtonPosY = 3 + (leftButtonPosX * 3);
break;
case 6:
- leftSelect = 2;
- rightButtonPosY = 4;
+ leftSelect = 2 + leftButtonPosX;
+ rightButtonPosY = 6 + (leftButtonPosX * 3);
break;
case 7:
if(this.rightButtonPosX > 0)
+ {
this.rightButtonPosX--;
+ }
+ else if(this.rightButtonPosY > (0 + this.leftSelect * 4))
+ {
+ this.rightButtonPosY--;
+ this.rightButtonPosX = 15;
+ }
break;
case 8:
this.rightButtonPosX++;
+ if(this.rightButtonPosX >= 16)
+ {
+ this.rightButtonPosY++;
+ this.rightButtonPosX = 0;
+ }
break;
case 9:
if(tags.hasKey("Render" + renders[leftSelect]))
{
- tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX) * TinkersDefense.config.MaterialIndex));
- if(rightButtonPosX > 0)
+ tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + ((rightButtonPosY % 3) * 16)) * TinkersDefense.config.MaterialIndex));
+ if(rightButtonPosX + (rightButtonPosY * 16) > 0)
tags.setInteger(renders[leftSelect] + "Color", TConstructRegistry.getMaterial(tags.getInteger(renders[leftSelect])).primaryColor());
else
tags.removeTag(renders[leftSelect] + "Color");
@@ -134,7 +152,7 @@ public class Gui_FinishingAnvil extends GuiContainer
case 10:
if(tags.hasKey("Render" + renders[leftSelect]))
{
- tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + 1) * TinkersDefense.config.MaterialIndex));
+ tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + 1 + ((rightButtonPosY % 3) * 16)) * TinkersDefense.config.MaterialIndex));
tags.setInteger(renders[leftSelect] + "Color", TConstructRegistry.getMaterial(tags.getInteger(renders[leftSelect])).primaryColor());
}
break;
@@ -142,14 +160,14 @@ public class Gui_FinishingAnvil extends GuiContainer
case 11:
if(tags.hasKey("Render" + renders[leftSelect]))
{
- tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + 2) * TinkersDefense.config.MaterialIndex));
+ tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + 2 + ((rightButtonPosY % 3) * 16)) * TinkersDefense.config.MaterialIndex));
tags.setInteger(renders[leftSelect] + "Color", TConstructRegistry.getMaterial(tags.getInteger(renders[leftSelect])).primaryColor());
}
break;
}
}
- public void drawScreen(int par1, int par2, float par3)
+ public void drawScreen(int x, int y, float par3)
{
if(inventory.getStackInSlot(0) != null && isNull == true
@@ -166,9 +184,10 @@ public class Gui_FinishingAnvil extends GuiContainer
isNull = true;
}
- super.drawScreen(par1, par2, par3);
- this.xSize_lo = (float) par1;
- this.ySize_lo = (float) par2;
+ super.drawScreen(x, y, par3);
+ drawTooltip(x, y);
+ this.xSize_lo = (float) x;
+ this.ySize_lo = (float) y;
}
protected void drawGuiContainerForegroundLayer(int par1, int par2)
@@ -207,11 +226,11 @@ public class Gui_FinishingAnvil extends GuiContainer
this.yLIcon_three = 0;
this.xRIcon_one = 0;
- this.yRIcon_one = 0;
+ this.yRIcon_one = 32;
this.xRIcon_two = 16;
- this.yRIcon_two = 0;
+ this.yRIcon_two = 32;
this.xRIcon_three = 32;
- this.yRIcon_three = 0;
+ this.yRIcon_three = 32;
}
}
@@ -224,8 +243,16 @@ public class Gui_FinishingAnvil extends GuiContainer
this.drawTexturedModalRect(7, 52, this.xLIcon_three + (this.leftButtonPosX * 16), this.yLIcon_three + (this.leftButtonPosY * 16), 16, 16);
this.drawTexturedModalRect(132, 12, this.xRIcon_one + (this.rightButtonPosX * 16), this.yRIcon_one + (this.rightButtonPosY * 16), 16, 16);
- this.drawTexturedModalRect(132, 32, this.xRIcon_two + (this.rightButtonPosX * 16), this.yRIcon_two + (this.rightButtonPosY * 16), 16, 16);
- this.drawTexturedModalRect(132, 52, this.xRIcon_three + (this.rightButtonPosX * 16), this.yRIcon_three + (this.rightButtonPosY * 16), 16, 16);
+
+ if(this.rightButtonPosX + 1 < 16)
+ this.drawTexturedModalRect(132, 32, this.xRIcon_two + (this.rightButtonPosX * 16), this.yRIcon_two + (this.rightButtonPosY * 16), 16, 16);
+ else
+ this.drawTexturedModalRect(132, 32, this.xRIcon_two + ((this.rightButtonPosX - 16) * 16), this.yRIcon_two + ((this.rightButtonPosY + 1) * 16), 16, 16);
+
+ if(this.rightButtonPosX + 2 < 16)
+ this.drawTexturedModalRect(132, 52, this.xRIcon_three + (this.rightButtonPosX * 16), this.yRIcon_three + (this.rightButtonPosY * 16), 16, 16);
+ else
+ this.drawTexturedModalRect(132, 52, this.xRIcon_three + ((this.rightButtonPosX - 16) * 16), this.yRIcon_three + ((this.rightButtonPosY + 1) * 16), 16, 16);
bigRender.renderItemAndEffectIntoGUI(fontRendererObj, this.mc.getTextureManager(), bigCopy, 23, 5);
@@ -244,4 +271,41 @@ public class Gui_FinishingAnvil extends GuiContainer
{
}
+
+ protected void drawTooltip(int x, int y)
+ {
+ int buttons[] = {4, 5, 6, 9, 10, 11};
+
+ for(int i = 0; i < buttons.length; i++)
+ {
+ GuiButtonExt button = ((GuiButtonExt) this.buttonList.get(buttons[i] - 1));
+ boolean mousehover = x >= button.xPosition && y >= button.yPosition && x < button.xPosition + button.width && y < button.yPosition + button.height;
+ int test = button.getHoverState(mousehover);
+ if(test == 2)
+ {
+ if(bigCopy != null)
+ {
+ ToolCore tool = (ToolCore) bigCopy.getItem();
+ ToolCoreTip tt = ((Injector) TinkersDefense.tcInject).tools.get(tool.getToolName());
+ List<String> list = new ArrayList();
+
+ switch(i)
+ {
+ case 0: list.add(tt.getPart(1 + this.leftButtonPosX)); break;
+ case 1: list.add(tt.getPart(3 + this.leftButtonPosX)); break;
+ case 2: list.add(tt.getPart(2 + this.leftButtonPosX)); break;
+
+ case 3: list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + ((rightButtonPosY % 3) * 16)))); break;
+ case 4: list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + 1 + ((rightButtonPosY % 3) * 16)))); break;
+ case 5: list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + 2 + ((rightButtonPosY % 3) * 16)))); break;
+ }
+
+ if(list.get(0).contains("Metallurgy"))
+ list.add(" -by Shadowclaimer");
+ func_146283_a(list, x, y);
+
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java
index da9b672..84cd4de 100644
--- a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java
+++ b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java
@@ -1,6 +1,7 @@
package lance5057.tDefense.finishingAnvil.utilities;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,145 +9,87 @@ import lance5057.tDefense.TinkersDefense;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
-import net.minecraft.util.ResourceLocation;
+import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
import tconstruct.library.tools.ToolCore;
public class Injector extends ToolCore
{
+ List<String> heads = new ArrayList<String>();
+ List<String> accessories = new ArrayList<String>();
+ List<String> handles = new ArrayList<String>();
+ List<String> extras = new ArrayList<String>();
- ToolCore tool;
+ public HashMap<String, ToolCoreTip> tools = new HashMap<String, ToolCoreTip>();
- InjectorLocations injectLoc;
-
- List<String> heads = new ArrayList<String>();
- List<String> accessorys = new ArrayList<String>();
- List<String> handles = new ArrayList<String>();
- List<String> extras = new ArrayList<String>();
-
- public Injector(int baseDamage, ToolCore tool, InjectorLocations injLoc)
+ public Injector(int baseDamage)
{
super(0);
- this.tool = tool;
-
- injectLoc = injLoc;
-
- List<String> temp = injectLoc.getList(tool.getUnlocalizedName().substring(tool.getUnlocalizedName().lastIndexOf('.') + 1, tool.getUnlocalizedName().length()));
-
- if(!temp.isEmpty())
- {
- for(int i = 0; i < temp.size(); i++)
- {
- if(temp.get(i).contains("head"))
- {
- heads.add(temp.get(i));
- }
- if(temp.get(i).contains("accessory"))
- {
- accessorys.add(temp.get(i));
- }
- if(temp.get(i).contains("handle"))
- {
- handles.add(temp.get(i));
- }
- if(temp.get(i).contains("extra"))
- {
- extras.add(temp.get(i));
- }
- }
- }
}
protected void loadHeads(IIconRegister iconRegister)
{
- IIcon origHead = tool.headIcons.get(-1);
- IIcon origAccessory = tool.accessoryIcons.get(-1);
- IIcon origHandle = tool.handleIcons.get(-1);
- IIcon origExtra = tool.handleIcons.get(-1);
-
- //File[] icons = new File("tinkersdefense:items/" + tool.getDefaultFolder()).listFiles();
-
- ResourceLocation icons = new ResourceLocation("tinkersdefense", tool.getDefaultFolder());
- String test = icons.toString();
- for(int i = 0; i < heads.size(); i++)
+ int toolLength = TConstructRegistry.tools.size();
+ for(int i = 0; i < toolLength; i++)
{
- PatternBuilder pb = PatternBuilder.instance;
- for(Map.Entry<String, MaterialSet> entry : pb.materialSets.entrySet())
- {
- String icon = "tinkersdefense:";
- icon += tool.getDefaultFolder() + "/" + entry.getKey().toLowerCase() + "/" + heads.get(i);
- //toolIcons[i] = icon;
- headStrings.put(entry.getValue().materialID + (TinkersDefense.config.MaterialIndex * (i + 1)), icon);
- }
-
- addIcons(tool.headStrings, headIcons, iconRegister, heads.get(i), false);
-
- for(int j = (i + 1) * TinkersDefense.config.MaterialIndex; j < TinkersDefense.config.MaterialIndex + ((i + 1) * TinkersDefense.config.MaterialIndex); j++)
- {
- if(!headIcons.containsKey(j))
- {
- headIcons.put(j, headIcons.get(-1));
- }
- }
+ heads.clear();
+ accessories.clear();
+ handles.clear();
+ extras.clear();
+
+ this.headStrings.clear();
+ this.headIcons.clear();
+ this.accessoryStrings.clear();
+ this.accessoryIcons.clear();
+ this.handleStrings.clear();
+ this.handleIcons.clear();
+ this.extraStrings.clear();
+ this.extraIcons.clear();
+
+ ToolCore tool = TConstructRegistry.tools.get(i);
+
+ IIcon origHead = tool.headIcons.get(-1);
+ IIcon origAccessory = tool.accessoryIcons.get(-1);
+ IIcon origHandle = tool.handleIcons.get(-1);
+ IIcon origExtra = tool.extraIcons.get(-1);
+
+ if(tool.getToolName().equals("Battleaxe"))
+ BattleAxe();
+ if(tool.getToolName().equals("Arrow"))
+ Arrow();
+ if(tool.getToolName().equals("Broadsword"))
+ Broadsword();
+ if(tool.getToolName().equals("Battlesign"))
+ Battlesign();
+ if(tool.getToolName().equals("Hatchet"))
+ Axe();
+ if(tool.getToolName().equals("Mattock"))
+ Mattock();
+ if(tool.getToolName().equals("Longbow"))
+ Longbow();
+ setupIcons(tool, iconRegister, heads, this.headStrings, this.headIcons);
+ setupIcons(tool, iconRegister, accessories, this.accessoryStrings, this.accessoryIcons);
+ setupIcons(tool, iconRegister, handles, this.handleStrings, this.handleIcons);
+ setupIcons(tool, iconRegister, extras, this.extraStrings, this.extraIcons);
tool.headStrings.putAll(headStrings);
tool.headIcons.putAll(headIcons);
- }
-
- for(int i = 0; i < accessorys.size(); i++)
- {
- PatternBuilder pb = PatternBuilder.instance;
- for(Map.Entry<String, MaterialSet> entry : pb.materialSets.entrySet())
- {
- String icon = "tinkersdefense:";
- icon += tool.getDefaultFolder() + "/" + entry.getKey().toLowerCase() + "/" + accessorys.get(i);
- //toolIcons[i] = icon;
- accessoryStrings.put(entry.getValue().materialID + (TinkersDefense.config.MaterialIndex * (i + 1)), icon);
- }
-
- addIcons(accessoryStrings, accessoryIcons, iconRegister, accessorys.get(i), false);
-
- for(int j = (i + 1) * TinkersDefense.config.MaterialIndex; j < TinkersDefense.config.MaterialIndex + ((i + 1) * TinkersDefense.config.MaterialIndex); j++)
- {
- if(!accessoryIcons.containsKey(j))
- {
- accessoryIcons.put(j, accessoryIcons.get(-1));
- }
- }
tool.accessoryStrings.putAll(accessoryStrings);
tool.accessoryIcons.putAll(accessoryIcons);
- }
-
- for(int i = 0; i < handles.size(); i++)
- {
- PatternBuilder pb = PatternBuilder.instance;
- for(Map.Entry<String, MaterialSet> entry : pb.materialSets.entrySet())
- {
- String icon = "tinkersdefense:";
- icon += tool.getDefaultFolder() + "/" + entry.getKey().toLowerCase() + "/" + handles.get(i);
- //toolIcons[i] = icon;
- handleStrings.put(entry.getValue().materialID + (TinkersDefense.config.MaterialIndex * (i + 1)), icon);
- }
-
- addIcons(handleStrings, handleIcons, iconRegister, handles.get(i), false);
-
- for(int j = (i + 1) * TinkersDefense.config.MaterialIndex; j < TinkersDefense.config.MaterialIndex + ((i + 1) * TinkersDefense.config.MaterialIndex); j++)
- {
- if(!handleIcons.containsKey(j))
- {
- handleIcons.put(j, handleIcons.get(-1));
- }
- }
tool.handleStrings.putAll(handleStrings);
tool.handleIcons.putAll(handleIcons);
- }
- tool.headIcons.put(-1, origHead);
- tool.accessoryIcons.put(-1, origAccessory);
- tool.handleIcons.put(-1, origHandle);
+ tool.extraStrings.putAll(extraStrings);
+ tool.extraIcons.putAll(extraIcons);
+
+ tool.headIcons.put(-1, origHead);
+ tool.accessoryIcons.put(-1, origAccessory);
+ tool.handleIcons.put(-1, origHandle);
+ tool.extraIcons.put(-1, origExtra);
+ }
}
@Override
@@ -172,8 +115,7 @@ public class Injector extends ToolCore
public String getDefaultFolder()
{
// TODO Auto-generated method stub
- String s = tool.getDefaultFolder();
- return s;
+ return null;
}
@Override
@@ -203,4 +145,323 @@ public class Injector extends ToolCore
// TODO Auto-generated method stub
return null;
}
+
+ public void setupIcons(ToolCore tool, IIconRegister iconRegister, List<String> newList, HashMap<Integer, String> toolStrings, HashMap<Integer, IIcon> toolIcons)
+ {
+ for(int i = 0; i < newList.size(); i++)
+ {
+ PatternBuilder pb = PatternBuilder.instance;
+ for(Map.Entry<String, MaterialSet> entry : pb.materialSets.entrySet())
+ {
+ String icon = "tinkersdefense:";
+ icon += tool.getDefaultFolder() + "/" + newList.get(i);
+ //toolIcons[i] = icon;
+ toolStrings.put(entry.getValue().materialID + (TinkersDefense.config.MaterialIndex * (i + 1)), icon);
+ }
+ }
+
+ addIcons(toolStrings, toolIcons, iconRegister, null, false);
+ }
+
+ void BattleAxe()
+ {
+ ToolCoreTip tt = new ToolCoreTip();
+
+ tt.accessory = "Front Head";
+ tt.head = "Back Head";
+ tt.handle = "Handle";
+ tt.extra = "Binding";
+
+ heads.add("_halbard_head");
+ heads.add("_magic_head");
+ heads.add("_scythe_head");
+
+ tt.headTT.add("Halbard Backhead");
+ tt.headTT.add("Magic Backhead");
+ tt.headTT.add("Scythe Backhead");
+
+ extras.add("_magic_extra");
+ extras.add("_scythe_extra");
+ extras.add("_halbard_extra");
+ extras.add("_ornate_extra");
+
+ tt.extraTT.add("Halbard Head");
+ tt.extraTT.add("Magic Head");
+ tt.extraTT.add("Scythe Head");
+ tt.extraTT.add("Ornate Head");
+
+ accessories.add("_magic_accessory");
+ accessories.add("_halbard_accessory");
+ accessories.add("_knob_accessory");
+
+ //Metallurgy 5
+
+ tools.put("Battleaxe", tt);
+ }
+
+ void Axe()
+ {
+ ToolCoreTip tt = new ToolCoreTip();
+
+ tt.head = "Head";
+ tt.handle = "Handle";
+
+ heads.add("_thin_head");
+ tt.headTT.add("Thin Head");
+ heads.add("_minecraft_head");
+ tt.headTT.add("Vanilla Head");
+ heads.add("_m5zinc_head");
+ tt.headTT.add("Metallurgy 5 Zinc Head");
+ heads.add("_m5whitegold_head");
+ tt.headTT.add("Metallurgy 5 WhiteGold Head");
+ heads.add("_m5tin_head");
+ tt.headTT.add("Metallurgy 5 Tin Head");
+ heads.add("_m5silver_head");
+ tt.headTT.add("Metallurgy 5 Silver Head");
+ heads.add("_m5rosegold_head");
+ tt.headTT.add("Metallurgy 5 RoseGold Head");
+ heads.add("_m5platinum_head");
+ tt.headTT.add("Metallurgy 5 Platinum Head");
+ heads.add("_m5pewter_head");
+ tt.headTT.add("Metallurgy 5 Pewter Head");
+ heads.add("_m5nickelsteel_head");
+ tt.headTT.add("Metallurgy 5 NickelSteel Head");
+ heads.add("_m5nickel_head");
+ tt.headTT.add("Metallurgy 5 Nickel Head");
+ heads.add("_m5monel_head");
+ tt.headTT.add("Metallurgy 5 Monel Head");
+ heads.add("_m5molybdochalkos_head");
+ tt.headTT.add("Metallurgy 5 Molybdochalkos Head");
+ heads.add("_m5manganesesteel_head");
+ tt.headTT.add("Metallurgy 5 ManganeseSteel Head");
+ heads.add("_m5manganese_head");
+ tt.headTT.add("Metallurgy 5 Manganese Head");
+ heads.add("_m5lead_head");
+ tt.headTT.add("Metallurgy 5 Lead Head");
+ heads.add("_m5iron_head");
+ tt.headTT.add("Metallurgy 5 Iron Head");
+ heads.add("_m5ignatius_head");
+ tt.headTT.add("Metallurgy 5 Ignatius Head");
+ heads.add("_m5hepatizon_head");
+ tt.headTT.add("Metallurgy 5 Hepatizon Head");
+ heads.add("_m5heavysteel_head");
+ tt.headTT.add("Metallurgy 5 HeavySteel Head");
+ heads.add("_m5gold_head");
+ tt.headTT.add("Metallurgy 5 Gold Head");
+ heads.add("_m5fungalsteel_head");
+ tt.headTT.add("Metallurgy 5 FungalSteel Head");
+ heads.add("_m5electrum_head");
+ tt.headTT.add("Metallurgy 5 Electrum Head");
+ heads.add("_m5diamond_head");
+ tt.headTT.add("Metallurgy 5 Diamond Head");
+ heads.add("_m5damascussteel_head");
+ tt.headTT.add("Metallurgy 5 DamascusSteel Head");
+ heads.add("_m5cupronickel_head");
+ tt.headTT.add("Metallurgy 5 Cupronickel Head");
+ heads.add("_m5crowngold_head");
+ tt.headTT.add("Metallurgy 5 CrownGold Head");
+ heads.add("_m5copper_head");
+ tt.headTT.add("Metallurgy 5 Copper Head");
+ heads.add("_m5bronze_head");
+ tt.headTT.add("Metallurgy 5 Bronze Head");
+ heads.add("_m5brass_head");
+ tt.headTT.add("Metallurgy 5 Brass Head");
+ heads.add("_m5angmallen_head");
+ tt.headTT.add("Metallurgy 5 Angmallen Head");
+ heads.add("_broad_head");
+ tt.headTT.add("Broad Head");
+ heads.add("_bearded_head");
+ tt.headTT.add("Bearded Head");
+
+ handles.add("_long_handle");
+ tt.handleTT.add("Long Handle");
+ handles.add("_ornate_handle");
+ tt.handleTT.add("Ornate Handle");
+ handles.add("_longornate_handle");
+ tt.handleTT.add("Long Ornate Handle");
+ handles.add("_offset_handle");
+ tt.handleTT.add("Offset Handle");
+ handles.add("_offsetlong_handle");
+ tt.handleTT.add("Offset Long Handle");
+ handles.add("_offsetornate_handle");
+ tt.handleTT.add("Offset Ornate Handle");
+ handles.add("_offsetlongornate_handle");
+ tt.handleTT.add("Offset Long Ornate Handle");
+
+ tools.put("Hatchet", tt);
+ }
+
+ void Battlesign()
+ {
+ handles.add("_small_handle");
+ handles.add("_smalllong_handle");
+
+ heads.add("_arrow_head");
+ heads.add("_caution_head");
+ heads.add("_noentry_head");
+ heads.add("_railroad_head");
+ heads.add("_stop_head");
+ heads.add("_X_head");
+ }
+
+ void Arrow()
+ {
+ heads.add("_broad_head");
+ heads.add("_elven_head");
+ heads.add("_horned_head");
+ heads.add("_trident_head");
+ heads.add("_winged_head");
+
+ handles.add("_bulbous_handle");
+ handles.add("_natural_handle");
+
+ accessories.add("_matted_accessory");
+ accessories.add("_magic_accessory");
+ accessories.add("_pixie_accessory");
+ accessories.add("_small_accessory");
+ }
+
+ void Broadsword()
+ {
+ ToolCoreTip tt = new ToolCoreTip();
+
+ tt.head = "Blade";
+ tt.accessory = "Guard";
+ tt.handle = "Handle";
+
+ tt.headTT.add("Standard Blade");
+ heads.add("_tapered_head");
+ tt.headTT.add("Tapered Blade");
+ heads.add("_dull_head");
+ tt.headTT.add("Dull Blade");
+ heads.add("_glass_head");
+ tt.headTT.add("Glass Blade");
+ heads.add("_plumed_head");
+ tt.headTT.add("Plumed Blade");
+ heads.add("_spiked_head");
+ tt.headTT.add("Spiked Blade");
+ heads.add("_widebase_head");
+ tt.headTT.add("Widebase Blade");
+ heads.add("_mace_head");
+ tt.headTT.add("Mace \"Blade\"");
+ heads.add("_elusive_head");
+ tt.headTT.add("Elusive Blade");
+ heads.add("_repulsive_head");
+ tt.headTT.add("Repulsive Blade");
+ heads.add("_falchion_head");
+ tt.headTT.add("Falchion Blade");
+ heads.add("_big_head");
+ tt.headTT.add("Big Blade");
+ heads.add("_nofuller_head");
+ tt.headTT.add("No Fuller Blade");
+ heads.add("_segmented_head");
+ tt.headTT.add("Segmented Blade");
+ heads.add("_hourglass_head");
+ tt.headTT.add("Hourglass Blade");
+ heads.add("_flat_head");
+ tt.headTT.add("Flat Tip Blade");
+
+ heads.add("_m5zinc_head");
+ tt.headTT.add("Metallurgy 5 Zinc Blade");
+ heads.add("_m5whitegold_head");
+ tt.headTT.add("Metallurgy 5 WhiteGold Blade");
+ heads.add("_m5tin_head");
+ tt.headTT.add("Metallurgy 5 Tin Blade");
+ heads.add("_m5silver_head");
+ tt.headTT.add("Metallurgy 5 Silver Blade");
+ heads.add("_m5rosegold_head");
+ tt.headTT.add("Metallurgy 5 RoseGold Blade");
+ heads.add("_m5platinum_head");
+ tt.headTT.add("Metallurgy 5 Platinum Blade");
+ heads.add("_m5pewter_head");
+ tt.headTT.add("Metallurgy 5 Pewter Blade");
+ heads.add("_m5nickelsteel_head");
+ tt.headTT.add("Metallurgy 5 NickelSteel Blade");
+ heads.add("_m5nickel_head");
+ tt.headTT.add("Metallurgy 5 Nickel Blade");
+ heads.add("_m5monel_head");
+ tt.headTT.add("Metallurgy 5 Monel Blade");
+ heads.add("_m5molybdochalkos_head");
+ tt.headTT.add("Metallurgy 5 Molybdochalkos Blade");
+ heads.add("_m5manganesesteel_head");
+ tt.headTT.add("Metallurgy 5 ManganeseSteel Blade");
+ heads.add("_m5manganese_head");
+ tt.headTT.add("Metallurgy 5 Manganese Blade");
+ heads.add("_m5lead_head");
+ tt.headTT.add("Metallurgy 5 Lead Blade");
+ heads.add("_m5iron_head");
+ tt.headTT.add("Metallurgy 5 Iron Blade");
+ heads.add("_m5ignatius_head");
+ tt.headTT.add("Metallurgy 5 Ignatius Blade");
+ heads.add("_m5hepatizon_head");
+ tt.headTT.add("Metallurgy 5 Hepatizon Blade");
+ heads.add("_m5heavysteel_head");
+ tt.headTT.add("Metallurgy 5 HeavySteel Blade");
+ heads.add("_m5gold_head");
+ tt.headTT.add("Metallurgy 5 Gold Blade");
+ heads.add("_m5fungalsteel_head");
+ tt.headTT.add("Metallurgy 5 FungalSteel Blade");
+ heads.add("_m5electrum_head");
+ tt.headTT.add("Metallurgy 5 Electrum Blade");
+ heads.add("_m5diamond_head");
+ tt.headTT.add("Metallurgy 5 Diamond Blade");
+ heads.add("_m5damascussteel_head");
+ tt.headTT.add("Metallurgy 5 DamascusSteel Blade");
+ heads.add("_m5cupronickel_head");
+ tt.headTT.add("Metallurgy 5 Cupronickel Blade");
+ heads.add("_m5crowngold_head");
+ tt.headTT.add("Metallurgy 5 CrownGold Blade");
+ heads.add("_m5copper_head");
+ tt.headTT.add("Metallurgy 5 Copper Blade");
+ heads.add("_m5bronze_head");
+ tt.headTT.add("Metallurgy 5 Bronze Blade");
+ heads.add("_m5brass_head");
+ tt.headTT.add("Metallurgy 5 Brass Blade");
+ heads.add("_m5angmallen_head");
+ tt.headTT.add("Metallurgy 5 Angmallen Blade");
+
+ accessories.add("_basket_accessory");
+ accessories.add("_curved_accessory");
+ accessories.add("_elusive_accessory");
+ accessories.add("_extended_accessory");
+ accessories.add("_legendary_accessory");
+ accessories.add("_no_accessory");
+ accessories.add("_basket_accessory");
+ accessories.add("_repulsive_accessory");
+ accessories.add("_square_accessory");
+ accessories.add("_straight_accessory");
+ accessories.add("_straight_accessory");
+ accessories.add("_bulbous_accessory");
+ accessories.add("_sun_accessory");
+ accessories.add("_lamenting_accessory");
+ accessories.add("_pixie_accessory");
+ accessories.add("_forked_accessory");
+
+ handles.add("_ornate_handle");
+ handles.add("_thick_handle");
+ handles.add("_short_handle");
+
+ tools.put("Broadsword", tt);
+ }
+
+ void Mattock()
+ {
+ heads.add("_head_bearded");
+ heads.add("_head_magic");
+ heads.add("_head_scythe");
+ heads.add("head_wide");
+
+ accessories.add("_back_straight");
+
+ heads.add("_m5copper_head");
+ accessories.add("_m5copper_accessory");
+ }
+
+ void Longbow()
+ {
+ heads.add("_m5copper_head");
+ accessories.add("_m5copper_accessory");
+ handles.add("_m5copper_handle");
+ extras.add("_m5copper_extra");
+ }
}
diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/InjectorLocations.java b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/InjectorLocations.java
deleted file mode 100644
index f3693c1..0000000
--- a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/InjectorLocations.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package lance5057.tDefense.finishingAnvil.utilities;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class InjectorLocations
-{
- List<String> list;
-
- public InjectorLocations()
- {
- list = new ArrayList<String>();
-
- //BroadSword
- list.add("broadsword_dull_head");
- list.add("broadsword_elusive_head");
- list.add("broadsword_glass_head");
- list.add("broadsword_mace_head");
- list.add("broadsword_plumed_head");
- list.add("broadsword_repulsive_head");
- list.add("broadsword_spiked_head");
- list.add("broadsword_tapered_head");
- list.add("broadsword_widebase_head");
- list.add("broadsword_falchion_head");
- list.add("broadsword_big_head");
- list.add("broadsword_segmented_head");
- list.add("broadsword_nofuller_head");
- list.add("broadsword_hourglass_head");
- list.add("broadsword_flat_head");
-
- list.add("broadsword_basket_accessory");
- list.add("broadsword_curved_accessory");
- list.add("broadsword_elusive_accessory");
- list.add("broadsword_extended_accessory");
- list.add("broadsword_legendary_accessory");
- list.add("broadsword_no_accessory");
- list.add("broadsword_basket_accessory");
- list.add("broadsword_repulsive_accessory");
- list.add("broadsword_square_accessory");
- list.add("broadsword_straight_accessory");
- list.add("broadsword_straight_accessory");
- list.add("broadsword_bulbous_accessory");
- list.add("broadsword_sun_accessory");
- list.add("broadsword_lamenting_accessory");
- list.add("broadsword_pixie_accessory");
- list.add("broadsword_forked_accessory");
-
- list.add("broadsword_ornate_handle");
- list.add("broadsword_thick_handle");
- list.add("broadsword_short_handle");
-
- //Arrow
- list.add("arrow_broad_head");
- list.add("arrow_elven_head");
- list.add("arrow_horned_head");
- list.add("arrow_trident_head");
- list.add("arrow_winged_head");
-
- list.add("arrow_bulbous_handle");
- list.add("arrow_natural_handle");
-
- list.add("arrow_matted_accessory");
- list.add("arrow_magic_accessory");
- list.add("arrow_pixie_accessory");
- list.add("arrow_small_accessory");
-
- //Axe
- list.add("axe_bearded_head");
- list.add("axe_broad_head");
- list.add("axe_minecraft_head");
- list.add("axe_thin_head");
-
- //Battleaxe
- list.add("battleaxe_halbard_head");
- list.add("battleaxe_magic_head");
- list.add("battleaxe_scythe_head");
-
- list.add("battleaxe_magic_extra");
- list.add("battleaxe_scythe_extra");
- list.add("battleaxe_halbard_extra");
-
- list.add("battleaxe_magic_accessory");
- list.add("battleaxe_halbard_accessory");
- list.add("battleaxe_knob_accessory");
-
- //Battlesign
- list.add("battlesign_small_handle");
- list.add("battlesign_smalllong_handle");
-
- list.add("battlesign_arrow_head");
- list.add("battlesign_caution_head");
- list.add("battlesign_noentry_head");
- list.add("battlesign_railroad_head");
- list.add("battlesign_stop_head");
- list.add("battlesign_X_head");
- }
-
- public List getList(String part)
- {
- List<String> request = new ArrayList<String>();
-
- if(!list.isEmpty())
- {
- for(int i = 0; i < list.size(); i++)
- {
- if(list.get(i).contains(part.toLowerCase()))
- {
- request.add(list.get(i).substring(part.length(), list.get(i).length()));
- }
- }
- }
-
- return request;
- }
-}
diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/ToolCoreTip.java b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/ToolCoreTip.java
new file mode 100644
index 0000000..1948779
--- /dev/null
+++ b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/ToolCoreTip.java
@@ -0,0 +1,45 @@
+package lance5057.tDefense.finishingAnvil.utilities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ToolCoreTip
+{
+ String head;
+ String handle;
+ String accessory;
+ String extra;
+
+ List<String> headTT = new ArrayList<String>();
+ List<String> accessoryTT = new ArrayList<String>();
+ List<String> handleTT = new ArrayList<String>();
+ List<String> extraTT = new ArrayList<String>();
+
+ public ToolCoreTip()
+ {
+ }
+
+ public String getPart(int id /*1-4*/)
+ {
+ switch(id)
+ {
+ case 1: return head;
+ case 2: return handle;
+ case 3: return accessory;
+ case 4: return extra;
+ default: return "";
+ }
+ }
+
+ public String getPartName(int partId /*1-4*/, int id)
+ {
+ switch(partId)
+ {
+ case 1: return headTT.get(id);
+ case 2: return handleTT.get(id);
+ case 3: return accessoryTT.get(id);
+ case 4: return extraTT.get(id);
+ default: return "";
+ }
+ }
+}