From 640eb3c977375c523f6701307b59b6aba0783fdb Mon Sep 17 00:00:00 2001 From: Arthur Uzulin Date: Thu, 10 Oct 2013 20:03:45 +1100 Subject: [PATCH] Wooden armor + armor cast recipes --- .../{wood_pants.png => wood_leggings.png} | Bin src/tconstruct/common/TContent.java | 29 ++++++++++++++++-- src/tconstruct/items/armor/ArmorBasic.java | 26 ++++++++++++++++ src/tconstruct/util/config/PHConstruct.java | 16 +++++----- 4 files changed, 61 insertions(+), 10 deletions(-) rename resources/assets/tinker/textures/items/armor/{wood_pants.png => wood_leggings.png} (100%) create mode 100644 src/tconstruct/items/armor/ArmorBasic.java diff --git a/resources/assets/tinker/textures/items/armor/wood_pants.png b/resources/assets/tinker/textures/items/armor/wood_leggings.png similarity index 100% rename from resources/assets/tinker/textures/items/armor/wood_pants.png rename to resources/assets/tinker/textures/items/armor/wood_leggings.png diff --git a/src/tconstruct/common/TContent.java b/src/tconstruct/common/TContent.java index 21525f35..bebcd075 100644 --- a/src/tconstruct/common/TContent.java +++ b/src/tconstruct/common/TContent.java @@ -1,5 +1,7 @@ package tconstruct.common; +import net.minecraftforge.common.EnumHelper; + import cpw.mods.fml.common.*; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.*; @@ -264,6 +266,12 @@ public class TContent implements IFuelHandler public static ChestGenHooks tinkerHouseChest; public static ChestGenHooks tinkerHousePatterns; + //Armor - basic + public static Item helmetWood; + public static Item chestplateWood; + public static Item leggingsWood; + public static Item bootsWood; + public static EnumArmorMaterial materialWood; //Temporary items //public static Item armorTest = new ArmorStandard(2445, 4, EnumArmorPart.HELMET).setCreativeTab(CreativeTabs.tabAllSearch); @@ -885,7 +893,14 @@ public class TContent implements IFuelHandler //Crystalline essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); goldHead = new GoldenHead(PHConstruct.goldHead, 4, 1.2F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 10, 0, 1.0F).setUnlocalizedName("goldenhead"); - + + LiquidCasting basinCasting = TConstruct.getBasinCasting(); + materialWood = EnumHelper.addArmorMaterial("WOOD", 2, new int[] {1, 2, 2, 1}, 3); + helmetWood = new ArmorBasic(PHConstruct.woodHelmet, materialWood, 0, "wood").setUnlocalizedName("tconstruct.helmetWood"); + chestplateWood = new ArmorBasic(PHConstruct.woodChestplate, materialWood, 1, "wood").setUnlocalizedName("tconstruct.chestplateWood"); + leggingsWood = new ArmorBasic(PHConstruct.woodPants, materialWood, 2, "wood").setUnlocalizedName("tconstruct.leggingsWood"); + bootsWood = new ArmorBasic(PHConstruct.woodBoots, materialWood, 3, "wood").setUnlocalizedName("tconstruct.bootsWood"); + // essenceCrystal = new EssenceCrystal(PHConstruct.essenceCrystal).setUnlocalizedName("tconstruct.crystal.essence"); String[] materialStrings = { "paperStack", "greenSlimeCrystal", "searedBrick", "ingotCobalt", "ingotArdite", "ingotManyullyn", "mossBall", "lavaCrystal", "necroticBone", "ingotCopper", @@ -1270,6 +1285,16 @@ public class TContent implements IFuelHandler basinCasting.addCastingRecipe(new ItemStack(Block.whiteStone), new FluidStack(moltenEnderFluid, 25), new ItemStack(Block.obsidian), true, 100); //endstone basinCasting.addCastingRecipe(new ItemStack(metalBlock.blockID, 1, 10), new FluidStack(moltenEnderFluid, 1000), null, true, 100); //ender + //Armor casts + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 0), new FluidStack(moltenAlubrassFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(helmetWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 0), new FluidStack(moltenGoldFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(helmetWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 1), new FluidStack(moltenAlubrassFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(chestplateWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 1), new FluidStack(moltenGoldFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(chestplateWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 2), new FluidStack(moltenAlubrassFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(leggingsWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 2), new FluidStack(moltenGoldFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(leggingsWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 3), new FluidStack(moltenAlubrassFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(bootsWood), 50); + basinCasting.addCastingRecipe(new ItemStack(armorPattern, 1, 3), new FluidStack(moltenGoldFluid, TConstruct.ingotLiquidValue * 10), new ItemStack(bootsWood), 50); + //TODO TEST // basinCasting.addCastingRecipe(new ItemStack(armorTest), new FluidStack(moltenIronFluid, TConstruct.ingotLiquidValue * 24), new ItemStack(armorPattern, 1, 0), false, 100, new FluidRenderProperties(0.5F, 0.575F, 0.15F, 0.85F, 0.15F, 0.85F)); @@ -1731,7 +1756,7 @@ public class TContent implements IFuelHandler GameRegistry.addShapelessRecipe(new ItemStack(slimeChannel, 1, 0), new ItemStack(slimeGel, 1, Short.MAX_VALUE), new ItemStack(Item.redstone)); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(slimePad, 1, 0), slimeChannel, new ItemStack(slimeGel, 1, Short.MAX_VALUE), "slimeBall")); - + //Slab crafters GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 6, 0), "bbb", 'b', new ItemStack(Block.workbench)); GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 1, 1), "b", 'b', new ItemStack(toolStationWood, 1, 0)); diff --git a/src/tconstruct/items/armor/ArmorBasic.java b/src/tconstruct/items/armor/ArmorBasic.java new file mode 100644 index 00000000..2f3c7522 --- /dev/null +++ b/src/tconstruct/items/armor/ArmorBasic.java @@ -0,0 +1,26 @@ +package tconstruct.items.armor; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.item.*; + +public class ArmorBasic extends ItemArmor { + + public String textureName; + + public ArmorBasic(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, String textureName) { + super(par1, par2EnumArmorMaterial, 0, par3); + this.textureName = textureName; + } + + @Override + public void registerIcons(IconRegister par1IconRegister){ + this.itemIcon = par1IconRegister.registerIcon("tinker:armor/" + textureName + "_" + (this.armorType == 0 ? "helmet" : this.armorType == 1 ? "chestplate" : this.armorType == 2 ? "leggings" : this.armorType == 3 ? "boots" : "helmet")); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer){ + return "tinker:textures/armor/" + textureName + "_" + layer + ".png"; + } + +} diff --git a/src/tconstruct/util/config/PHConstruct.java b/src/tconstruct/util/config/PHConstruct.java index 7773933a..e40de758 100644 --- a/src/tconstruct/util/config/PHConstruct.java +++ b/src/tconstruct/util/config/PHConstruct.java @@ -250,11 +250,11 @@ public class PHConstruct oreChunks = config.getItem("Patterns and Misc", "Ore Chunks", 14104).getInt(14104); heartCanister = config.getItem("Equipables", "Heart Canister", 14105).getInt(14105); - heavyHelmet = config.getItem("Equipables", "Heavy Helmet", 14106).getInt(14106); diamondApple = config.getItem("Patterns and Misc", "Jeweled Apple", 14107).getInt(14107); - heavyChestplate = config.getItem("Equipables", "Heavy Chestplate", 14108).getInt(14108); - heavyPants = config.getItem("Equipables", "Heavy Pants", 14109).getInt(14109); - heavyBoots = config.getItem("Equipables", "Heavy Boots", 14110).getInt(14110); + woodHelmet = config.getItem("Equipables", "Wooden Helmet", 14106).getInt(14106); + woodChestplate = config.getItem("Equipables", "Wooden Chestplate", 14108).getInt(14108); + woodPants = config.getItem("Equipables", "Wooden Pants", 14109).getInt(14109); + woodBoots = config.getItem("Equipables", "Wooden Boots", 14110).getInt(14110); glove = config.getItem("Equipables", "Gloves", 14111).getInt(14111); knapsack = config.getItem("Equipables", "Knapsack", 14112).getInt(14112); goldHead = config.getItem("Patterns and Misc", "Golden Head", 14113).getInt(14113); @@ -563,10 +563,10 @@ public class PHConstruct public static int fletching; //Wearables - public static int heavyHelmet; - public static int heavyChestplate; - public static int heavyPants; - public static int heavyBoots; + public static int woodHelmet; + public static int woodChestplate; + public static int woodPants; + public static int woodBoots; public static int glove; public static int knapsack;