diff options
| author | Lance5057 <Lance5057@gmail.com> | 2016-04-06 22:06:07 -0500 |
|---|---|---|
| committer | Lance5057 <Lance5057@gmail.com> | 2016-04-06 22:06:07 -0500 |
| commit | 9d618ac01c99846faeda71bc4c4c5f5324aeef51 (patch) | |
| tree | a4037a2f58e8968dfaf568d9d4f3bcce92c408cd /src/main/java/lance5057/tDefense/finishingAnvil/utilities | |
| parent | ba8feb526da0a1ce15a179e1e5ee44582f769768 (diff) | |
Lots of new Modifiers
New -
Modifiers
Gauntlets
Metallurgy 5 in the Finishing anvil!
Fixes -
Fixed armor render to render 4x less...
Diffstat (limited to 'src/main/java/lance5057/tDefense/finishingAnvil/utilities')
3 files changed, 422 insertions, 231 deletions
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 ""; + } + } +} |
