From ff41fd97eb377dd1ebd78b4b56e81c59ca786667 Mon Sep 17 00:00:00 2001 From: Lance5057 Date: Fri, 29 Jul 2016 08:52:49 -0500 Subject: Prelaunch backup --- .../java/lance5057/tDefense/TDIntegration.java | 2 +- src/main/java/lance5057/tDefense/TD_Commands.java | 89 ++- src/main/java/lance5057/tDefense/TD_Config.java | 179 +++-- .../java/lance5057/tDefense/TinkersDefense.java | 888 +++++++++++---------- .../java/lance5057/tDefense/armor/ArmorCore.java | 173 +++- .../lance5057/tDefense/armor/TDArmorAddon.java | 187 +++++ .../java/lance5057/tDefense/armor/TDHelmet.java | 49 ++ .../tDefense/armor/blocks/UnstableItemBlock.java | 4 +- .../tDefense/armor/events/ArmorModEvents.java | 5 +- .../tDefense/armor/events/ArmorRenderEvent.java | 5 +- .../java/lance5057/tDefense/armor/items/Mask.java | 116 --- .../lance5057/tDefense/armor/items/Sheath.java | 57 +- .../tDefense/armor/items/TinkersGauntlets.java | 130 +++ .../tDefense/armor/items/cloth/TinkersHood.java | 69 +- .../tDefense/armor/items/cloth/TinkersRobe.java | 70 +- .../tDefense/armor/items/cloth/TinkersShawl.java | 69 +- .../tDefense/armor/items/cloth/TinkersShoes.java | 59 +- .../armor/items/heavy/TinkersBreastplate.java | 34 +- .../armor/items/heavy/TinkersGauntlets.java | 148 ---- .../tDefense/armor/items/heavy/TinkersGrieves.java | 29 +- .../tDefense/armor/items/heavy/TinkersHelm.java | 59 +- .../armor/items/heavy/TinkersSabatons.java | 33 +- .../tDefense/armor/items/light/TinkersBoots.java | 40 +- .../armor/items/light/TinkersChausses.java | 48 +- .../tDefense/armor/items/light/TinkersCoif.java | 57 +- .../tDefense/armor/items/light/TinkersHauberk.java | 34 +- .../tDefense/armor/modifiers/ArmorMods.java | 399 ++++++--- .../armor/modifiers/BloodMagic/BloodArmorMods.java | 56 ++ .../armor/modifiers/Botania/BotaniaArmorMods.java | 50 ++ .../armor/modifiers/Thaumcraft/ThaumArmorMods.java | 46 +- .../armor/modifiers/modifierBoolExclusive.java | 76 -- .../armor/modifiers/modifierIntExclusive.java | 96 --- .../tDefense/armor/renderers/ArmorRenderer.java | 79 +- .../tDefense/armor/renderers/ModelMask.java | 77 -- .../tDefense/armor/renderers/ModelScarf.java | 52 -- .../armor/renderers/ModelTinkersGauntlets.java | 214 +++++ .../armor/renderers/ModelTinkersTabard.java | 73 ++ .../armor/renderers/cloth/ModelTinkersHood.java | 177 ++-- .../armor/renderers/cloth/ModelTinkersRobe.java | 438 +++++++--- .../armor/renderers/cloth/ModelTinkersShawl.java | 258 +++--- .../armor/renderers/cloth/ModelTinkersShoes.java | 79 ++ .../renderers/heavy/ModelTinkersBreastplate.java | 242 +++--- .../renderers/heavy/ModelTinkersGauntlets.java | 104 --- .../armor/renderers/heavy/ModelTinkersGrieves.java | 255 ++++-- .../armor/renderers/heavy/ModelTinkersHelm.java | 246 ++++-- .../renderers/heavy/ModelTinkersSabatons.java | 263 +++--- .../armor/renderers/light/ModelTinkersBoots.java | 129 +-- .../renderers/light/ModelTinkersChausses.java | 187 +++-- .../armor/renderers/light/ModelTinkersCoif.java | 94 ++- .../armor/renderers/light/ModelTinkersHauberk.java | 243 +++--- .../tDefense/baubles/blocks/JewelersBench.java | 57 ++ .../baubles/models/ModelJewelersBench.java | 104 +++ .../baubles/models/Renderer_JewelersBench.java | 43 + .../tileentities/TileEntity_JewelersBench.java | 8 + .../lance5057/tDefense/blocks/JewelersBench.java | 56 -- .../tDefense/core/entity/EntityHookshotHook.java | 158 ++++ .../tDefense/core/events/TDEventHandler.java | 111 +-- .../tDefense/core/gui/GuiTDGuideBook.java | 591 ++++++++++++++ .../lance5057/tDefense/core/items/GuideBook.java | 25 + .../tDefense/core/items/MetaModifierItem.java | 63 ++ .../core/renderer/BigFlexibleToolRenderer.java | 329 -------- .../tDefense/core/renderer/HookRenderer.java | 122 +++ .../core/renderer/MoreFlexibleToolRenderer.java | 355 ++++++++ .../tDefense/core/renderer/TestSkinChanger.java | 58 ++ .../tDefense/core/tools/ModifierSoul.java | 30 + .../lance5057/tDefense/core/tools/RoundShield.java | 18 +- .../java/lance5057/tDefense/core/tools/Shears.java | 43 +- .../java/lance5057/tDefense/core/tools/Shield.java | 33 +- .../tDefense/core/tools/TinkerWrench.java | 66 +- .../tDefense/core/tools/TinkerZweihander.java | 31 +- .../tDefense/core/tools/TinkersHookshot.java | 119 +++ .../ActiveToolMods/TDefenseActiveToolMod.java | 45 +- .../tools/modifiers/BloodMagic/BloodMagicMods.java | 133 +++ .../core/tools/modifiers/Botania/BotaniaMods.java | 190 ++++- .../tools/modifiers/Botania/modifierCorpseIvy.java | 67 -- .../tools/modifiers/ModifierBoolExclusive.java | 83 ++ .../core/tools/modifiers/ModifierIntExclusive.java | 96 +++ .../core/tools/modifiers/ModifierSoulHandler.java | 389 +++++++++ .../tDefense/core/tools/modifiers/Modifiers.java | 55 +- .../core/tools/modifiers/ModifiersBase.java | 42 + .../core/tools/modifiers/TDefense/TDMods.java | 452 +++++++++++ .../modifiers/TDefense/modifierSoulBound.java | 29 - .../TDefense/shields/modifierCrestofBlades.java | 90 --- .../TDefense/shields/modifierCrestofFeathers.java | 129 --- .../TDefense/shields/modifierCrestofLegends.java | 60 -- .../TDefense/shields/modifierCrestofMirrors.java | 64 -- .../modifiers/TDefense/weapons/modifierDaze.java | 97 --- .../TDefense/weapons/modifierTorchArrow.java | 72 -- .../tools/modifiers/Thaumcraft/ThaumcraftMods.java | 9 +- .../tDefense/core/tools/modifiers/ToolMods.java | 171 ---- .../core/tools/modifiers/modLapisShears.java | 86 ++ .../finishingAnvil/Container_FinishingAnvil.java | 2 +- .../blocks/finishingAnvil/Gui_FinishingAnvil.java | 576 +++++++++---- .../finishingAnvil/RenderItem_FinishingAnvil.java | 2 +- .../finishingAnvil/utilities/Injector.java | 71 +- .../tDefense/models/ModelJewelersBench.java | 104 --- .../tDefense/models/Renderer_JewelersBench.java | 42 - .../java/lance5057/tDefense/proxy/ClientProxy.java | 103 ++- .../java/lance5057/tDefense/proxy/CommonProxy.java | 26 +- .../tileentities/TileEntity_JewelersBench.java | 8 - 100 files changed, 7769 insertions(+), 4510 deletions(-) create mode 100644 src/main/java/lance5057/tDefense/armor/TDArmorAddon.java create mode 100644 src/main/java/lance5057/tDefense/armor/TDHelmet.java delete mode 100644 src/main/java/lance5057/tDefense/armor/items/Mask.java create mode 100644 src/main/java/lance5057/tDefense/armor/items/TinkersGauntlets.java delete mode 100644 src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGauntlets.java create mode 100644 src/main/java/lance5057/tDefense/armor/modifiers/BloodMagic/BloodArmorMods.java create mode 100644 src/main/java/lance5057/tDefense/armor/modifiers/Botania/BotaniaArmorMods.java delete mode 100644 src/main/java/lance5057/tDefense/armor/modifiers/modifierBoolExclusive.java delete mode 100644 src/main/java/lance5057/tDefense/armor/modifiers/modifierIntExclusive.java delete mode 100644 src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java delete mode 100644 src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java create mode 100644 src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersGauntlets.java create mode 100644 src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersTabard.java create mode 100644 src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShoes.java delete mode 100644 src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGauntlets.java create mode 100644 src/main/java/lance5057/tDefense/baubles/blocks/JewelersBench.java create mode 100644 src/main/java/lance5057/tDefense/baubles/models/ModelJewelersBench.java create mode 100644 src/main/java/lance5057/tDefense/baubles/models/Renderer_JewelersBench.java create mode 100644 src/main/java/lance5057/tDefense/baubles/tileentities/TileEntity_JewelersBench.java delete mode 100644 src/main/java/lance5057/tDefense/blocks/JewelersBench.java create mode 100644 src/main/java/lance5057/tDefense/core/entity/EntityHookshotHook.java create mode 100644 src/main/java/lance5057/tDefense/core/gui/GuiTDGuideBook.java create mode 100644 src/main/java/lance5057/tDefense/core/items/GuideBook.java create mode 100644 src/main/java/lance5057/tDefense/core/items/MetaModifierItem.java delete mode 100644 src/main/java/lance5057/tDefense/core/renderer/BigFlexibleToolRenderer.java create mode 100644 src/main/java/lance5057/tDefense/core/renderer/HookRenderer.java create mode 100644 src/main/java/lance5057/tDefense/core/renderer/MoreFlexibleToolRenderer.java create mode 100644 src/main/java/lance5057/tDefense/core/renderer/TestSkinChanger.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/ModifierSoul.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/TinkersHookshot.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/BloodMagic/BloodMagicMods.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/modifierCorpseIvy.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierBoolExclusive.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierIntExclusive.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierSoulHandler.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/ModifiersBase.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/TDMods.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/modifierSoulBound.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofBlades.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofFeathers.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofLegends.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofMirrors.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierDaze.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierTorchArrow.java delete mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/ToolMods.java create mode 100644 src/main/java/lance5057/tDefense/core/tools/modifiers/modLapisShears.java delete mode 100644 src/main/java/lance5057/tDefense/models/ModelJewelersBench.java delete mode 100644 src/main/java/lance5057/tDefense/models/Renderer_JewelersBench.java delete mode 100644 src/main/java/lance5057/tDefense/tileentities/TileEntity_JewelersBench.java (limited to 'src/main/java') diff --git a/src/main/java/lance5057/tDefense/TDIntegration.java b/src/main/java/lance5057/tDefense/TDIntegration.java index cc7e38c..6ce662d 100644 --- a/src/main/java/lance5057/tDefense/TDIntegration.java +++ b/src/main/java/lance5057/tDefense/TDIntegration.java @@ -23,7 +23,7 @@ public final class TDIntegration { botania = true; } - if(Loader.isModLoaded("bloodmagic") && TinkersDefense.config.BloodMagicAddon) + if(Loader.isModLoaded("AWWayofTime") && TinkersDefense.config.BloodMagicAddon) { bloodMagic = true; } diff --git a/src/main/java/lance5057/tDefense/TD_Commands.java b/src/main/java/lance5057/tDefense/TD_Commands.java index 8fc4eec..ef4239d 100644 --- a/src/main/java/lance5057/tDefense/TD_Commands.java +++ b/src/main/java/lance5057/tDefense/TD_Commands.java @@ -3,21 +3,6 @@ package lance5057.tDefense; import java.util.ArrayList; import java.util.List; -import lance5057.tDefense.armor.renderers.ModelMask; -import lance5057.tDefense.armor.renderers.ModelSheath; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersHood; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersRobe; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersShawl; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersBreastplate; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGauntlets; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGrieves; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersSabatons; -import lance5057.tDefense.armor.renderers.light.ModelTinkersBoots; -import lance5057.tDefense.armor.renderers.light.ModelTinkersChausses; -import lance5057.tDefense.armor.renderers.light.ModelTinkersCoif; -import lance5057.tDefense.armor.renderers.light.ModelTinkersHauberk; -import lance5057.tDefense.proxy.ClientProxy; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; @@ -39,7 +24,9 @@ public class TD_Commands extends CommandBase implements ICommand commands = new ArrayList(); - commands.add("reloadModels"); + commands.add("reloadRenderers"); + commands.add("toggleTransparency"); + commands.add("toggleDebugMode"); } @Override @@ -75,15 +62,50 @@ public class TD_Commands extends CommandBase implements ICommand @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { - World world = p_71515_1_.getEntityWorld(); - if(p_71515_2_[0].equals("reloadModels")) + final World world = p_71515_1_.getEntityWorld(); + if(world.isRemote) { - p_71515_1_.addChatMessage(new ChatComponentText("§9[TDefense] - Reloading All Models...")); - reloadModels(); - } - else - { - p_71515_1_.addChatMessage(new ChatComponentText("§c[TDefense] - Invalid Command")); + if(p_71515_2_[0].equals("reloadRenderers")) + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§9[TDefense]§f - Reloading All Renderers...")); + reloadModels(); + } + else if(p_71515_2_[0].equals("toggleTransparency")) + { + TinkersDefense.config.transparency = !TinkersDefense.config.transparency; + if(TinkersDefense.config.transparency) + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§9[TDefense]§f - Transparency on.")); + } + else + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§9[TDefense]§f - Transparency off.")); + } + + } + else if(p_71515_2_[0].equals("toggleDebugMode")) + { + TinkersDefense.config.debug = !TinkersDefense.config.debug; + if(TinkersDefense.config.debug) + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§9[TDefense]§f - Debug Mode on.")); + } + else + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§9[TDefense]§f - Debug Mode off.")); + } + + } + else + { + p_71515_1_.addChatMessage(new ChatComponentText( + "§c[TDefense]§f - Invalid Command")); + } } } @@ -107,23 +129,6 @@ public class TD_Commands extends CommandBase implements ICommand public void reloadModels() { - ClientProxy.mask = new ModelMask(null); - ClientProxy.sheath = new ModelSheath(); - - ClientProxy.helm = new ModelTinkersHelm(); - ClientProxy.breastplate = new ModelTinkersBreastplate(); - ClientProxy.grieves = new ModelTinkersGrieves(); - ClientProxy.sabatons = new ModelTinkersSabatons(); - ClientProxy.gauntlets = new ModelTinkersGauntlets(); - - ClientProxy.hood = new ModelTinkersHood(); - ClientProxy.shawl = new ModelTinkersShawl(); - ClientProxy.robe = new ModelTinkersRobe(); - ClientProxy.shoes = new ModelTinkersBoots(); - - ClientProxy.coif = new ModelTinkersCoif(); - ClientProxy.hauberk = new ModelTinkersHauberk(); - ClientProxy.chausses = new ModelTinkersChausses(); - ClientProxy.boots = new ModelTinkersBoots(); + TinkersDefense.proxy.registerRenderers(); } } diff --git a/src/main/java/lance5057/tDefense/TD_Config.java b/src/main/java/lance5057/tDefense/TD_Config.java index a235a4f..46f301d 100644 --- a/src/main/java/lance5057/tDefense/TD_Config.java +++ b/src/main/java/lance5057/tDefense/TD_Config.java @@ -1,11 +1,17 @@ package lance5057.tDefense; -import scala.Int; import net.minecraftforge.common.config.Configuration; +import scala.Int; import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class TD_Config { + public boolean debug; + public boolean ArmorAddon; + public boolean transparency; + public boolean mossEnabled; + public boolean mossHard; + static int count = 18; public int AeonsteelMatID; public int QueensGoldMatID; @@ -16,11 +22,26 @@ public class TD_Config public int SoulBoundID; public int DazeID; public int RainbowID; - public int CrestFeathersID; - public int CrestMirrorsID; - public int CrestLegendsID; - public int CrestBladesID; public int XPBoostID; + public int ShearFortuneID; + + public int[] CrestFeathersID; + public int[] CrestMirrorsID; + public int[] CrestLegendsID; + public int[] CrestBladesID; + public int[] CrestGluttonyID; + public int[] CrestPitchID; + public int[] CrestThornsID; + public int[] CrestSanguisugaID; + public int[] CrestWindsID; + public int[] CrestRetributionID; + public int[] CrestLightID; + + //public int JokeInsultID; + public int JokePyrotechID; + //public int JokeCompensateID; + + public int SoulSteveID; public int ArmorProtectionID; public int ArmorFireProtectionID; @@ -50,7 +71,7 @@ public class TD_Config public boolean BotaniaAddon; public int CorpseIvyModID; public int ManaRepairModID; - public int TerraCoreIvyModID; + public int TerraCoreModID; public int ArmorPixieCoreModID; public int ArmorManaDiscountModID; @@ -61,67 +82,109 @@ public class TD_Config //public int SpellbindModID; public boolean BloodMagicAddon; - public int BloodLustModID; + public int SuppingModID; public int BloodOathModID; public int ScabbingModID; + public int DivinationModID; public TD_Config(FMLPreInitializationEvent e) { - Configuration config = new Configuration(e.getSuggestedConfigurationFile()); + final Configuration config = new Configuration( + e.getSuggestedConfigurationFile()); config.load(); - MaterialIndex = config.getInt("Material Index","Highest material ID" , 206, 30, Int.MaxValue(), "TDefense - 206 MFR - 1001 ExtraTIC - 1024"); - - AeonsteelMatID = config.get("Material Configs", "Aeonsteel Material ID", 201).getInt(); - QueensGoldMatID = config.get("Material Configs", "QueensGold Material ID", 202).getInt(); - DogbeariumMatID = config.get("Material Configs", "Dogbearium Material ID", 203).getInt(); - RedMintMatID = config.get("Material Configs", "RedMint Material ID", 204).getInt(); - GreenMintMatID = config.get("Material Configs", "GreenMint Material ID", 205).getInt(); - - DazeID = config.get("Modifier Configs", "Daze ID", count++).getInt(); - SoulBoundID = config.get("Modifier Configs", "Soulbound ID", count++).getInt(); - RainbowID = config.get("Modifier Configs", "Rainbow ID", count++).getInt(); - XPBoostID = config.get("Modifier Configs", "XPBoost ID", count++).getInt(); - - CrestFeathersID = config.get("Modifier Configs", "Crest of Feathers ID", count++).getInt(); - CrestMirrorsID = config.get("Modifier Configs", "Crest of Mirrors ID", count++).getInt(); - CrestLegendsID = config.get("Modifier Configs", "Crest of Legends ID", count++).getInt(); - CrestLegendsID = config.get("Modifier Configs", "Crest of Legends ID", count++).getInt(); - - - ArmorProtectionID = config.get("Armor Modifier Configs", "Protection ID", count++).getInt(); - ArmorFireProtectionID = config.get("Armor Modifier Configs", "Fire Protection ID", count++).getInt(); - ArmorBlastProtectionID = config.get("Armor Modifier Configs", "Blast Protection ID", count++).getInt(); - ArmorProjectileProtectionID = config.get("Armor Modifier Configs", "Projectile Protection ID", count++).getInt(); - ArmorFeatherfallID = config.get("Armor Modifier Configs", "Featherfall ID", count++).getInt(); - ArmorGlowstepID = config.get("Armor Modifier Configs", "Glowstep ID", count++).getInt(); - ArmorFrostwalkerID = config.get("Armor Modifier Configs", "Frostwalker ID", count++).getInt(); - ArmorFirewalkerID = config.get("Armor Modifier Configs", "Firewalker ID", count++).getInt(); - ArmorDepthstriderID = config.get("Armor Modifier Configs", "Depthstrider ID", count++).getInt(); - ArmorRebreatherID = config.get("Armor Modifier Configs", "Rebreather ID", count++).getInt(); - ArmorNightvisionID = config.get("Armor Modifier Configs", "Nightvision ID", count++).getInt(); - ArmorAntiBlindnessID = config.get("Armor Modifier Configs", "Anti Blindness ID", count++).getInt(); - ArmorPumpkinID = config.get("Armor Modifier Configs", "Pumpkin ID", count++).getInt(); - ArmorDodgeID = config.get("Armor Modifier Configs", "Dodge ID", count++).getInt(); - ArmorThornsID = config.get("Armor Modifier Configs", "Thorns ID", count++).getInt(); - ArmorAbsorptionID = config.get("Armor Modifier Configs", "Absorbtion ID", count++).getInt(); - ArmorJumpboostID = config.get("Armor Modifier Configs", "Jump Boost ID", count++).getInt(); - ArmorSpeedID = config.get("Armor Modifier Configs", "Speed ID", count++).getInt(); - ArmorHighstepID = config.get("Armor Modifier Configs", "High Step ID", count++).getInt(); - ArmorKnockbackResistID = config.get("Armor Modifier Configs", "Knockback Resistance ID", count++).getInt(); - - MineAndBladeAddon = config.getBoolean("Integration", "Enable Mine and Blade Addon", true, ""); - - BotaniaAddon = config.getBoolean("Integration", "Enable Botania Addon", true, ""); - CorpseIvyModID = config.get("Botania Addon", "Corpse Drinker Ivy Modifier ID", count++).getInt(); - - ThaumcraftAddon = config.getBoolean("Integration", "Enable Thaumcraft Addon", true, "Requires Thaumcraft to use"); - RevealingModID = config.get("Thaumcraft Addon", "Revealing Modifier ID", count++).getInt(); - VisDiscountModID = config.get("Thaumcraft Addon", "Vis Discount Modifier ID", count++).getInt(); - CapsModID = config.get("Thaumcraft Addon", "Cap Repair Modifier ID", count++).getInt(); - //SpellbindModID = config.getInt("Spellbinding Modifier ID", "Thaumcraft Addon", 73, 0, Integer.MAX_VALUE, ""); + debug = config.getBoolean("Should debug mode be enabled?", "Debug Mode", false, null); + ArmorAddon = config.getBoolean("Should the armor addon be enabled?", "Armor Addon", true, null); + transparency = config.getBoolean("Should Transparent Textures be enabled?", "General Settings", true, "May help fps if disabled"); + mossEnabled = config.getBoolean("Should the moss recipe be enabled?", "General Settings", true, null); + mossHard = config.getBoolean("Should the moss recipe be hard?", "General Settings", true, null); + + MaterialIndex = config.getInt("Material Index", "Highest material ID", 206, 30, Int.MaxValue(), "TDefense - 206 MFR - 1001 ExtraTIC - 1024"); + + AeonsteelMatID = config.getInt("Aeonsteel Material ID", "Material Configs", 201, 30, Int.MaxValue(), null); + QueensGoldMatID = config.getInt("QueensGold Material ID", "Material Configs", 202, 30, Int.MaxValue(), null); + DogbeariumMatID = config.getInt("Dogbearium Material ID", "Material Configs", 203, 30, Int.MaxValue(), null); + RedMintMatID = config.getInt("RedMint Material ID", "Material Configs", 204, 30, Int.MaxValue(), null); + GreenMintMatID = config.getInt("GreenMint Material ID", "Material Configs", 205, 30, Int.MaxValue(), null); + + DazeID = config.getInt("Daze ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + SoulBoundID = config.getInt("Soulbound ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + RainbowID = config.getInt("Rainbow ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + XPBoostID = config.getInt("XPBoost ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + ShearFortuneID = config.getInt("Fortune for Shears ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + + CrestFeathersID = ConfigCrest(config, "Feathers"); + CrestMirrorsID = ConfigCrest(config, "Mirrors"); + CrestLegendsID = ConfigCrest(config, "Legends"); + CrestBladesID = ConfigCrest(config, "Blades"); + CrestGluttonyID = ConfigCrest(config, "Gluttony"); + CrestPitchID = ConfigCrest(config, "Pitch"); + CrestThornsID = ConfigCrest(config, "Thorns"); + CrestSanguisugaID = ConfigCrest(config, "Sanguisuga"); + CrestWindsID = ConfigCrest(config, "Winds"); + CrestRetributionID = ConfigCrest(config, "Retribution"); + CrestLightID = ConfigCrest(config, "Light"); + + SoulSteveID = config.getInt("Soulstone Steve ID", "Modifier Configs", count++, 18, Int.MaxValue(), null); + + ArmorProtectionID = config.getInt("Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorFireProtectionID = config.getInt("Fire Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorBlastProtectionID = config.getInt("Blast Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorProjectileProtectionID = config.getInt("Projectile Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorFeatherfallID = config.getInt("Featherfall ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorGlowstepID = config.getInt("Glowstep ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorFrostwalkerID = config.getInt("Frostwalker ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorFirewalkerID = config.getInt("Firewalker ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorDepthstriderID = config.getInt("Depthstrider ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorRebreatherID = config.getInt("Rebreather ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorNightvisionID = config.getInt("Nightvision ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorAntiBlindnessID = config.getInt("Anti Blindness ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorPumpkinID = config.getInt("Pumpkin ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorDodgeID = config.getInt("Dodge ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorThornsID = config.getInt("Thorns ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorAbsorptionID = config.getInt("Absorbtion ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorJumpboostID = config.getInt("Jump Boost ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorSpeedID = config.getInt("Speed ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorHighstepID = config.getInt("High Step ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + ArmorKnockbackResistID = config.getInt("Knockback Resistance ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null); + + MineAndBladeAddon = config.getBoolean("Enable Mine and Blade Addon", "Integration", true, ""); + + BotaniaAddon = config.getBoolean("Enable Botania Addon", "Integration", true, ""); + CorpseIvyModID = config.getInt("Corpse Drinker Ivy Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null); + ManaRepairModID = config.getInt("Mana Repair Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null); + TerraCoreModID = config.getInt("Terra Core Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null); + ArmorPixieCoreModID = config.getInt("Elementium Core Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null); + ArmorManaDiscountModID = config.getInt("Mana Embroidery Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null); + + ThaumcraftAddon = config.getBoolean("Enable Thaumcraft Addon", "Integration", true, "Requires Thaumcraft to use"); + RevealingModID = config.getInt("Revealing Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null); + VisDiscountModID = config.getInt("Vis Discount Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null); + CapsModID = config.getInt("Cap Repair Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null); + //SpellbindModID = config.getIntInt("Spellbinding Modifier ID", "Thaumcraft Addon", 73, 0, Integer.MAX_VALUE, ""); + + BloodMagicAddon = config.getBoolean("Enable BloodMagic Addon", "Integration", true, "Requires BloodMagic to use"); + DivinationModID = config.getInt("Divination Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null); + SuppingModID = config.getInt("Supping Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null); + BloodOathModID = config.getInt("Blood Oath Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null); + ScabbingModID = config.getInt("Scabbing Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null); + + //JokeInsultID = config.getInt("Insult ID", "Joke Modifier Configs", count++, 18, Int.MaxValue(), null); + JokePyrotechID = config.getInt("Pyrotech ID", "Joke Modifier Configs", count++, 18, Int.MaxValue(), null); config.save(); } + + private int[] ConfigCrest(Configuration config, String name) + { + final int[] crest = new int[TinkersDefense.colors.length]; + + for(int i = 0; i < TinkersDefense.colors.length; i++) + { + crest[i] = config.getInt("Crest of " + name + " (" + TinkersDefense.colors[i] + ") ID", "Shield Modifier Configs", count++, 18, Int.MaxValue(), null); + } + + return crest; + } } diff --git a/src/main/java/lance5057/tDefense/TinkersDefense.java b/src/main/java/lance5057/tDefense/TinkersDefense.java index 7af72c0..36d4241 100644 --- a/src/main/java/lance5057/tDefense/TinkersDefense.java +++ b/src/main/java/lance5057/tDefense/TinkersDefense.java @@ -4,31 +4,16 @@ import static net.minecraft.util.EnumChatFormatting.DARK_RED; import static net.minecraft.util.EnumChatFormatting.GOLD; import static net.minecraft.util.EnumChatFormatting.LIGHT_PURPLE; -import java.util.Date; +import java.util.Iterator; +import java.util.List; -import lance5057.tDefense.armor.blocks.GlowstoneCrumbs; -import lance5057.tDefense.armor.blocks.UnstableBlock; -import lance5057.tDefense.armor.blocks.UnstableItemBlock; +import lance5057.tDefense.armor.TDArmorAddon; import lance5057.tDefense.armor.events.ArmorModEvents; import lance5057.tDefense.armor.events.ArmorRenderEvent; -import lance5057.tDefense.armor.items.Sheath; -import lance5057.tDefense.armor.items.cloth.TinkersHood; -import lance5057.tDefense.armor.items.cloth.TinkersRobe; -import lance5057.tDefense.armor.items.cloth.TinkersShawl; -import lance5057.tDefense.armor.items.cloth.TinkersShoes; -import lance5057.tDefense.armor.items.heavy.TinkersBreastplate; -import lance5057.tDefense.armor.items.heavy.TinkersGauntlets; -import lance5057.tDefense.armor.items.heavy.TinkersGrieves; -import lance5057.tDefense.armor.items.heavy.TinkersHelm; -import lance5057.tDefense.armor.items.heavy.TinkersSabatons; -import lance5057.tDefense.armor.items.light.TinkersBoots; -import lance5057.tDefense.armor.items.light.TinkersChausses; -import lance5057.tDefense.armor.items.light.TinkersCoif; -import lance5057.tDefense.armor.items.light.TinkersHauberk; -import lance5057.tDefense.armor.modifiers.ArmorMods; import lance5057.tDefense.armor.parts.Cloth; import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.blocks.JewelersBench; +import lance5057.tDefense.baubles.blocks.JewelersBench; +import lance5057.tDefense.baubles.tileentities.TileEntity_JewelersBench; import lance5057.tDefense.core.TD_Patterns; import lance5057.tDefense.core.blocks.AeonSteelBlock; import lance5057.tDefense.core.blocks.DogbeariumBlock; @@ -38,6 +23,7 @@ import lance5057.tDefense.core.blocks.RedMintBlock; import lance5057.tDefense.core.blocks.crestMount.CrestMount; import lance5057.tDefense.core.blocks.crestMount.TileEntity_CrestMount; import lance5057.tDefense.core.events.TDEventHandler; +import lance5057.tDefense.core.items.GuideBook; import lance5057.tDefense.core.liquids.MoltenFluid; import lance5057.tDefense.core.network.PacketHandler; import lance5057.tDefense.core.tools.HeaterShield; @@ -45,13 +31,13 @@ import lance5057.tDefense.core.tools.RoundShield; import lance5057.tDefense.core.tools.Shears; import lance5057.tDefense.core.tools.TinkerWrench; import lance5057.tDefense.core.tools.TinkerZweihander; +//import lance5057.tDefense.core.tools.TinkersHookshot; import lance5057.tDefense.core.tools.modifiers.Modifiers; import lance5057.tDefense.core.tools.modifiers.Botania.BotaniaMods; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.FinishingAnvil; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.TileEntity_FinishingAnvil; import lance5057.tDefense.finishingAnvil.utilities.Injector; import lance5057.tDefense.proxy.CommonProxy; -import lance5057.tDefense.tileentities.TileEntity_JewelersBench; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -59,6 +45,8 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.StatCollector; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; @@ -66,6 +54,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import tconstruct.TConstruct; +import tconstruct.armor.TinkerArmor; import tconstruct.library.TConstructRegistry; import tconstruct.library.client.StencilGuiElement; import tconstruct.library.client.TConstructClientRegistry; @@ -75,12 +64,12 @@ import tconstruct.library.crafting.LiquidCasting; import tconstruct.library.crafting.PatternBuilder; import tconstruct.library.crafting.Smeltery; import tconstruct.library.crafting.StencilBuilder; +import tconstruct.library.crafting.ToolBuilder; import tconstruct.library.tools.DynamicToolPart; import tconstruct.library.tools.ToolCore; import tconstruct.smeltery.TinkerSmeltery; import tconstruct.tools.TinkerTools; import tconstruct.tools.items.Pattern; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; @@ -95,23 +84,17 @@ import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = Reference.MOD_ID, version = Reference.VERSION, name = Reference.MOD_NAME) public class TinkersDefense { + public static String[] colors = {"black", "red", "green", "brown", "blue", "purple", "cyan", "lightgray", "gray", "pink", "lime", "yellow", "lightblue", "magenta", "orange", "white"}; private static int modGuiIndex = 0; public static final int GUI_CREST_INV = modGuiIndex++; public static final int GUI_ANVIL_INV = modGuiIndex++; + public static final int GUI_GUIDEBOOK = modGuiIndex++; @Instance(Reference.MOD_ID) public static TinkersDefense instance = new TinkersDefense(); - public static CreativeTabs tabName = new CreativeTabs("tabName") - { - - public Item getTabIconItem() - { - return TinkersDefense.tabIcon; - } - - }; + public static CreativeTabs tabName; public static TDEventHandler TDevents; @@ -119,12 +102,10 @@ public class TinkersDefense public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MOD_ID); - static Date date = new Date(); - - public static Item tabIcon; - public static Modifiers mods; + public static Item item_Guidebook; + public static Item item_AeonSteelIngot; public static Block block_AeonSteelBlock; public static Fluid moltenAeonsteel; @@ -153,48 +134,28 @@ public class TinkersDefense public static Fluid moltenGreenMint; public static Block moltenGreenMintBlock; - public static Item item_RawSapphire; - public static Item item_RawRuby; - public static Item item_RawAmethyst; - public static Item item_RawAmber; - - public static Block block_SapphireOre; - public static Block block_RubyOre; - public static Block block_AmethystOre; - public static Block block_AmberOre; + // public static Item item_RawSapphire; + // public static Item item_RawRuby; + // public static Item item_RawAmethyst; + // public static Item item_RawAmber; + // + // public static Block block_SapphireOre; + // public static Block block_RubyOre; + // public static Block block_AmethystOre; + // public static Block block_AmberOre; public static ToolCore tool_roundShield; public static ToolCore tool_heaterShield; public static ToolCore tool_wrench; - public static ToolCore tool_sheath; - // public static ToolCore tool_mask; public static ToolCore tool_zweihander; public static ToolCore tool_shears; + //public static ToolCore tool_hookshot; public static Block block_CrestMount; public static Block block_ArmorAnvil; public static Block block_JewelersBench; - public static Block block_Unstable; - public static Block block_GlowCrumbs; - - public static ToolCore armor_TinkerHood; - public static ToolCore armor_TinkerShawl; - public static ToolCore armor_TinkerRobe; - public static ToolCore armor_TinkerShoes; - - public static ToolCore armor_TinkerCoif; - public static ToolCore armor_TinkerHalberd; - public static ToolCore armor_TinkerChausses; - public static ToolCore armor_TinkerBoots; - - public static ToolCore armor_TinkerHelm; - public static ToolCore armor_TinkerBreastplate; - public static ToolCore armor_TinkerGrieves; - public static ToolCore armor_TinkerSabatons; - public static ToolCore armor_TinkerGauntlets; - - public static Item item_ChainArmor; + //public static Item item_ChainArmor; public static Pattern woodPattern; public static Pattern metalPattern; @@ -206,282 +167,233 @@ public class TinkersDefense public static ToolCore tcInject; - public static BotaniaMods flowermod; + public static BotaniaMods flowermod; @SidedProxy(clientSide = "lance5057.tDefense.proxy.ClientProxy", serverSide = "lance5057.tDefense.proxy.CommonProxy") public static CommonProxy proxy; public static int month; + public TDArmorAddon ArmorAddon = new TDArmorAddon(); + @EventHandler public void preInit(FMLPreInitializationEvent e) { - month = this.date.getMonth(); - - PacketHandler.init(); + tabName = new CreativeTabs("tabName") + { - TDevents = new TDEventHandler(); + @Override + public Item getTabIconItem() + { + return ToolBuilder.instance.buildTool(new ItemStack( + TinkersDefense.partArmorplate, 1, 2), new ItemStack( + TinkerTools.toughRod, 1, 2), new ItemStack( + TinkersDefense.partArmorplate, 1, 2), new ItemStack( + TinkersDefense.partRivet, 1, 2), "TDTab").getItem(); + } + + }; + + PacketHandler.init(); MinecraftForge.EVENT_BUS.register(new ArmorRenderEvent()); MinecraftForge.EVENT_BUS.register(new ArmorModEvents()); - config = new TD_Config(e); - TDIntegration.Integrate(); - NetworkRegistry.INSTANCE.registerGuiHandler(TinkersDefense.instance, new CommonProxy()); MinecraftForge.EVENT_BUS.register(this); ClientCommandHandler.instance.registerCommand(new TD_Commands()); - tabIcon = new Item().setMaxStackSize(1).setCreativeTab(tabName).setUnlocalizedName("tabIcon").setTextureName(Reference.MOD_ID + ":Icon"); - GameRegistry.registerItem(tabIcon, "tabIcon"); - + //Initializations + //Internal Classes + TDevents = new TDEventHandler(); + config = new TD_Config(e); mods = new Modifiers(); - mods.preInit(); - - // item_RawSapphire = new RawGem("sapphire"); - // item_RawRuby = new RawGem("ruby"); - // item_RawAmethyst = new RawGem("amethyst"); - // item_RawAmber = new RawGem("amber"); - // - // block_SapphireOre = new TD_Ore(Material.ground, "sapphire", item_RawSapphire); - // block_RubyOre = new TD_Ore(Material.ground, "ruby", item_RawRuby); - // block_AmethystOre = new TD_Ore(Material.ground, "amethyst", item_RawAmethyst); - // block_AmberOre = new TD_Ore(Material.ground, "amber", item_RawAmber); - // - // GameRegistry.registerItem(item_RawSapphire, "rawsapphire"); - // GameRegistry.registerItem(item_RawRuby, "rawruby"); - // GameRegistry.registerItem(item_RawAmethyst, "rawamethyst"); - // GameRegistry.registerItem(item_RawAmber, "rawamber"); - // - // GameRegistry.registerBlock(block_SapphireOre, "sapphireore"); - // GameRegistry.registerBlock(block_RubyOre, "rubyore"); - // GameRegistry.registerBlock(block_AmethystOre, "amethystore"); - // GameRegistry.registerBlock(block_AmberOre, "amber ore"); - - block_Unstable = new UnstableBlock(); - GameRegistry.registerBlock(block_Unstable, UnstableItemBlock.class, "Unstable"); - - block_GlowCrumbs = new GlowstoneCrumbs(); - GameRegistry.registerBlock(block_GlowCrumbs, "Block_GlowCrumbs"); + //Blocks block_CrestMount = new CrestMount().setHardness(4.0F).setStepSound(Block.soundTypeStone).setBlockName("CrestMount").setCreativeTab(tabName); - - GameRegistry.registerBlock(block_CrestMount, "Block_CrestMount"); - GameRegistry.registerTileEntity(TileEntity_CrestMount.class, "Tile_CrestMount"); - - GameRegistry.addShapedRecipe(new ItemStack(block_CrestMount), new Object[] {"xxx", "-i-", "---", 'x', new ItemStack(TinkerTools.toughRod, 1, 1), 'i', new ItemStack(TinkerTools.toolRod, 1, 1)}); - block_ArmorAnvil = new FinishingAnvil().setHardness(4.0F).setStepSound(Block.soundTypeAnvil).setBlockName("ArmorAnvil").setCreativeTab(tabName); - - GameRegistry.registerBlock(block_ArmorAnvil, "Block_ArmorAnvil"); - GameRegistry.registerTileEntity(TileEntity_FinishingAnvil.class, "Tile_ArmorAnvil"); - - GameRegistry.addShapedRecipe(new ItemStack(block_ArmorAnvil), new Object[] {"ai-", "lr-", "---", 'r', new ItemStack(TinkerTools.toughRod, 1, 0), 'a', Blocks.anvil, 'i', Items.iron_ingot, 'l', Blocks.log}); - block_JewelersBench = new JewelersBench().setHardness(4.0F).setStepSound(Block.soundTypeWood).setBlockName("JewelersBench").setCreativeTab(tabName); - GameRegistry.registerBlock(block_JewelersBench, "Block_JewelersBench"); - GameRegistry.registerTileEntity(TileEntity_JewelersBench.class, "Tile_JewelersBench"); - - item_AeonSteelIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("AeonsteelIngot").setTextureName(Reference.MOD_ID + ":AeonsteelIngot"); - - GameRegistry.registerItem(item_AeonSteelIngot, "AeonsteelIngot"); - block_AeonSteelBlock = new AeonSteelBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("AeonsteelBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":AeonsteelBlock"); - - GameRegistry.registerBlock(block_AeonSteelBlock, "Aeonsteelblock"); - - GameRegistry.addShapedRecipe(new ItemStack(block_AeonSteelBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_AeonSteelIngot}); - GameRegistry.addShapelessRecipe(new ItemStack(item_AeonSteelIngot, 9), new Object[] {new ItemStack(block_AeonSteelBlock)}); - - moltenAeonsteel = new Fluid("moltenAeonsteel").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); - FluidRegistry.registerFluid(moltenAeonsteel); - - moltenAeonsteelBlock = new MoltenFluid(moltenAeonsteel, "Aeonsteel"); - - GameRegistry.registerBlock(moltenAeonsteelBlock, "moltenAeonsteel"); - - item_QueensGoldIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("QueensGoldIngot").setTextureName(Reference.MOD_ID + ":QueensGoldIngot"); - - GameRegistry.registerItem(item_QueensGoldIngot, "QueensGoldIngot"); - block_QueensGoldBlock = new QueensGoldBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("QueensGoldBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":QueensGoldBlock"); - - GameRegistry.registerBlock(block_QueensGoldBlock, "QueensGoldblock"); - - GameRegistry.addShapedRecipe(new ItemStack(block_QueensGoldBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_QueensGoldIngot}); - GameRegistry.addShapelessRecipe(new ItemStack(item_QueensGoldIngot, 9), new Object[] {new ItemStack(block_QueensGoldBlock)}); - - moltenQueensGold = new Fluid("moltenQueensGold").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); - FluidRegistry.registerFluid(moltenQueensGold); - - moltenQueensGoldBlock = new MoltenFluid(moltenQueensGold, "QueensGold"); - - GameRegistry.registerBlock(moltenQueensGoldBlock, "moltenQueensGold"); - - // Dogbearium - item_DogbeariumIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("DogbeariumIngot").setTextureName(Reference.MOD_ID + ":DogbeariumIngot"); - - GameRegistry.registerItem(item_DogbeariumIngot, "DogbeariumIngot"); - block_DogbeariumBlock = new DogbeariumBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("DogbeariumBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":DogbeariumBlock"); + block_RedMintBlock = new RedMintBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("RedMintBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":redmintblock"); + block_GreenMintBlock = new GreenMintBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("GreenMintBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":greenmintblock"); - GameRegistry.registerBlock(block_DogbeariumBlock, "Dogbeariumblock"); - - GameRegistry.addShapedRecipe(new ItemStack(block_DogbeariumBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_DogbeariumIngot}); - GameRegistry.addShapelessRecipe(new ItemStack(item_DogbeariumIngot, 9), new Object[] {new ItemStack(block_DogbeariumBlock)}); - - moltenDogbearium = new Fluid("moltenDogbearium").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); - FluidRegistry.registerFluid(moltenDogbearium); - - moltenDogbeariumBlock = new MoltenFluid(moltenDogbearium, "dogbearium"); - - GameRegistry.registerBlock(moltenDogbeariumBlock, "moltenDogbearium"); - - //Candy Canes + //Items + item_Guidebook = new GuideBook(); + item_AeonSteelIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("AeonsteelIngot").setTextureName(Reference.MOD_ID + ":AeonsteelIngot"); + item_QueensGoldIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("QueensGoldIngot").setTextureName(Reference.MOD_ID + ":QueensGoldIngot"); + item_DogbeariumIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("DogbeariumIngot").setTextureName(Reference.MOD_ID + ":DogbeariumIngot"); item_RedMintcane = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("RedMintcane").setTextureName(Reference.MOD_ID + ":redmintcane"); - item_RedMintIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("RedMintIngot").setTextureName(Reference.MOD_ID + ":redmintingot"); - - GameRegistry.registerItem(item_RedMintcane, "RedMintCane"); - GameRegistry.registerItem(item_RedMintIngot, "RedMintIngot"); - - block_RedMintBlock = new RedMintBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("RedMintBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":redmintblock"); - - GameRegistry.registerBlock(block_RedMintBlock, "redmintblock"); - - GameRegistry.addShapedRecipe(new ItemStack(block_RedMintBlock), new Object[] {"xxx", "xxx", "xxx", 'x', new ItemStack(item_RedMintcane, 1, 2)}); - GameRegistry.addShapelessRecipe(new ItemStack(item_RedMintcane, 9, 2), new Object[] {new ItemStack(block_RedMintBlock)}); - - moltenRedMint = new Fluid("moltenRedMint").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); - FluidRegistry.registerFluid(moltenRedMint); - - moltenRedMintBlock = new MoltenFluid(moltenRedMint, "RedMint"); - - GameRegistry.registerBlock(moltenRedMintBlock, "moltenRedMint"); - item_GreenMintcane = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("GreenMintcane").setTextureName(Reference.MOD_ID + ":greenmintcane"); - item_GreenMintIngot = new Item().setCreativeTab(tabName).setMaxStackSize(64).setUnlocalizedName("GreenMintIngot").setTextureName(Reference.MOD_ID + ":greenmintingot"); - GameRegistry.registerItem(item_GreenMintcane, "GreenMintCane"); - GameRegistry.registerItem(item_GreenMintIngot, "GreenMintIngot"); - - block_GreenMintBlock = new GreenMintBlock(Material.iron).setHardness(4.0F).setStepSound(Block.soundTypeMetal).setBlockName("GreenMintBlock").setCreativeTab(tabName).setBlockTextureName(Reference.MOD_ID + ":greenmintblock"); - - GameRegistry.registerBlock(block_GreenMintBlock, "GreenMintblock"); - - GameRegistry.addShapedRecipe(new ItemStack(block_GreenMintBlock), new Object[] {"xxx", "xxx", "xxx", 'x', new ItemStack(item_GreenMintcane, 1, 3)}); - GameRegistry.addShapelessRecipe(new ItemStack(item_GreenMintcane, 9, 3), new Object[] {new ItemStack(block_GreenMintBlock)}); - + //Fluids + moltenAeonsteel = new Fluid("moltenAeonsteel").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); + moltenQueensGold = new Fluid("moltenQueensGold").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); + moltenDogbearium = new Fluid("moltenDogbearium").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); + moltenRedMint = new Fluid("moltenRedMint").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); moltenGreenMint = new Fluid("moltenGreenMint").setLuminosity(15).setDensity(3000).setViscosity(6000).setTemperature(1300); - FluidRegistry.registerFluid(moltenGreenMint); - - moltenGreenMintBlock = new MoltenFluid(moltenGreenMint, "GreenMint"); - - GameRegistry.registerBlock(moltenGreenMintBlock, "moltenGreenMint"); + //Tools tool_roundShield = new RoundShield(); tool_heaterShield = new HeaterShield(); - tool_shears = new Shears(); tool_wrench = new TinkerWrench(); - tool_sheath = new Sheath(); - // tool_mask = new Mask(); - tool_zweihander = new TinkerZweihander(0); + //tool_hookshot = new TinkersHookshot(); - armor_TinkerHelm = new TinkersHelm(); - armor_TinkerBreastplate = new TinkersBreastplate(); - armor_TinkerGrieves = new TinkersGrieves(); - armor_TinkerSabatons = new TinkersSabatons(); - armor_TinkerGauntlets = new TinkersGauntlets(); + //Patterns + woodPattern = new TD_Patterns("pattern_", "Pattern"); + metalPattern = new TD_Patterns("cast_", "MetalPattern"); + + //Minecraft Registrations + //Blocks + GameRegistry.registerBlock(block_CrestMount, "Block_CrestMount"); + GameRegistry.registerBlock(block_ArmorAnvil, "Block_ArmorAnvil"); + GameRegistry.registerBlock(block_JewelersBench, "Block_JewelersBench"); + GameRegistry.registerBlock(block_AeonSteelBlock, "Aeonsteelblock"); + GameRegistry.registerBlock(block_QueensGoldBlock, "QueensGoldblock"); + GameRegistry.registerBlock(block_DogbeariumBlock, "Dogbeariumblock"); + GameRegistry.registerBlock(block_RedMintBlock, "redmintblock"); + GameRegistry.registerBlock(block_GreenMintBlock, "GreenMintblock"); - armor_TinkerRobe = new TinkersRobe(); - armor_TinkerShawl = new TinkersShawl(); - armor_TinkerHood = new TinkersHood(); - armor_TinkerShoes = new TinkersShoes(); + //Items + GameRegistry.registerItem(item_Guidebook, "guidebook"); - armor_TinkerCoif = new TinkersCoif(); - armor_TinkerHalberd = new TinkersHauberk(); - armor_TinkerChausses = new TinkersChausses(); - armor_TinkerBoots = new TinkersBoots(); + GameRegistry.registerItem(item_AeonSteelIngot, "AeonsteelIngot"); + GameRegistry.registerItem(item_QueensGoldIngot, "QueensGoldIngot"); + GameRegistry.registerItem(item_DogbeariumIngot, "DogbeariumIngot"); - //Register Tools + GameRegistry.registerItem(item_RedMintcane, "RedMintCane"); + GameRegistry.registerItem(item_RedMintIngot, "RedMintIngot"); + GameRegistry.registerItem(item_GreenMintcane, "GreenMintCane"); + GameRegistry.registerItem(item_GreenMintIngot, "GreenMintIngot"); + //Tools GameRegistry.registerItem(tool_roundShield, "Round Shield"); GameRegistry.registerItem(tool_heaterShield, "Heater Shield"); GameRegistry.registerItem(tool_shears, "Tinker Shears"); GameRegistry.registerItem(tool_wrench, "Tinker Wrench"); - GameRegistry.registerItem(tool_sheath, "Sheath"); - // GameRegistry.registerItem(tool_mask, "Mask"); GameRegistry.registerItem(tool_zweihander, "Zweihander"); + //GameRegistry.registerItem(tool_hookshot, "Hookshot"); - GameRegistry.registerItem(armor_TinkerHelm, "tinkerhelm"); - GameRegistry.registerItem(armor_TinkerBreastplate, "tinkerbreastplate"); - GameRegistry.registerItem(armor_TinkerGrieves, "tinkergrieves"); - GameRegistry.registerItem(armor_TinkerSabatons, "tinkersabatons"); - GameRegistry.registerItem(armor_TinkerGauntlets, "tinkergauntlets"); + //Patterns + GameRegistry.registerItem(woodPattern, "Pattern"); + GameRegistry.registerItem(metalPattern, "Cast"); - GameRegistry.registerItem(armor_TinkerCoif, "tinkercoif"); - GameRegistry.registerItem(armor_TinkerHalberd, "tinkerhalberd"); - GameRegistry.registerItem(armor_TinkerChausses, "tinkerchausses"); - GameRegistry.registerItem(armor_TinkerBoots, "tinkerboots"); + //TileEntities + GameRegistry.registerTileEntity(TileEntity_CrestMount.class, "Tile_CrestMount"); + GameRegistry.registerTileEntity(TileEntity_FinishingAnvil.class, "Tile_ArmorAnvil"); + GameRegistry.registerTileEntity(TileEntity_JewelersBench.class, "Tile_JewelersBench"); - GameRegistry.registerItem(armor_TinkerRobe, "tinkerrobe"); - GameRegistry.registerItem(armor_TinkerShawl, "tinkershawl"); - GameRegistry.registerItem(armor_TinkerHood, "tinkerhood"); - GameRegistry.registerItem(armor_TinkerShoes, "tinkershoes"); + //Fluids + FluidRegistry.registerFluid(moltenAeonsteel); + FluidRegistry.registerFluid(moltenQueensGold); + FluidRegistry.registerFluid(moltenDogbearium); + FluidRegistry.registerFluid(moltenRedMint); + FluidRegistry.registerFluid(moltenGreenMint); + + //FluidBlocks + moltenAeonsteelBlock = new MoltenFluid(moltenAeonsteel, "Aeonsteel"); + moltenQueensGoldBlock = new MoltenFluid(moltenQueensGold, "QueensGold"); + moltenDogbeariumBlock = new MoltenFluid(moltenDogbearium, "dogbearium"); + moltenRedMintBlock = new MoltenFluid(moltenRedMint, "RedMint"); + moltenGreenMintBlock = new MoltenFluid(moltenGreenMint, "GreenMint"); - //Add Tools to TiCo directory + GameRegistry.registerBlock(moltenAeonsteelBlock, "moltenAeonsteel"); + GameRegistry.registerBlock(moltenQueensGoldBlock, "moltenQueensGold"); + GameRegistry.registerBlock(moltenDogbeariumBlock, "moltenDogbearium"); + GameRegistry.registerBlock(moltenRedMintBlock, "moltenRedMint"); + GameRegistry.registerBlock(moltenGreenMintBlock, "moltenGreenMint"); + + //Recipes + GameRegistry.addShapedRecipe(new ItemStack(block_CrestMount), new Object[] {"xxx", "-i-", "---", 'x', new ItemStack( + TinkerTools.toughRod, 1, 1), 'i', new ItemStack( + TinkerTools.toolRod, 1, 1)}); + GameRegistry.addShapedRecipe(new ItemStack(block_ArmorAnvil), new Object[] {"ai-", "lr-", "---", 'r', new ItemStack( + TinkerTools.toughRod, 1, 0), 'a', Blocks.anvil, 'i', Items.iron_ingot, 'l', Blocks.log}); + GameRegistry.addShapedRecipe(new ItemStack(block_AeonSteelBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_AeonSteelIngot}); + GameRegistry.addShapelessRecipe(new ItemStack(item_AeonSteelIngot, 9), new Object[] {new ItemStack( + block_AeonSteelBlock)}); + GameRegistry.addShapedRecipe(new ItemStack(block_QueensGoldBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_QueensGoldIngot}); + GameRegistry.addShapelessRecipe(new ItemStack(item_QueensGoldIngot, 9), new Object[] {new ItemStack( + block_QueensGoldBlock)}); + GameRegistry.addShapedRecipe(new ItemStack(block_DogbeariumBlock), new Object[] {"xxx", "xxx", "xxx", 'x', item_DogbeariumIngot}); + GameRegistry.addShapelessRecipe(new ItemStack(item_DogbeariumIngot, 9), new Object[] {new ItemStack( + block_DogbeariumBlock)}); + GameRegistry.addShapedRecipe(new ItemStack(block_RedMintBlock), new Object[] {"xxx", "xxx", "xxx", 'x', new ItemStack( + item_RedMintcane, 1, 2)}); + GameRegistry.addShapelessRecipe(new ItemStack(item_RedMintcane, 9, 2), new Object[] {new ItemStack( + block_RedMintBlock)}); + GameRegistry.addShapedRecipe(new ItemStack(block_GreenMintBlock), new Object[] {"xxx", "xxx", "xxx", 'x', new ItemStack( + item_GreenMintcane, 1, 3)}); + GameRegistry.addShapelessRecipe(new ItemStack(item_GreenMintcane, 9, 3), new Object[] {new ItemStack( + block_GreenMintBlock)}); + + //TinkersConstruct Registrations + //Tools TConstructRegistry.addItemToDirectory("Round Shield", tool_roundShield); TConstructRegistry.addItemToDirectory("Heater Shield", tool_heaterShield); + TConstructRegistry.addItemToDirectory("Tinker Shears", tool_shears); TConstructRegistry.addItemToDirectory("Tinker Wrench", tool_wrench); - TConstructRegistry.addItemToDirectory("Sheath", tool_sheath); - // TConstructRegistry.addItemToDirectory("Mask", tool_mask); TConstructRegistry.addItemToDirectory("Zweihander", tool_zweihander); + //TConstructRegistry.addItemToDirectory("Hookshot", tool_hookshot); - TConstructRegistry.addItemToDirectory("tinkerhelm", armor_TinkerHelm); - TConstructRegistry.addItemToDirectory("tinkerbreastplate", armor_TinkerBreastplate); - TConstructRegistry.addItemToDirectory("tinkergrieves", armor_TinkerGrieves); - TConstructRegistry.addItemToDirectory("tinkersabatons", armor_TinkerSabatons); - TConstructRegistry.addItemToDirectory("tinkergauntlets", armor_TinkerGauntlets); - - TConstructRegistry.addItemToDirectory("tinkercoif", armor_TinkerCoif); - TConstructRegistry.addItemToDirectory("tinkerhalberd", armor_TinkerHalberd); - TConstructRegistry.addItemToDirectory("tinkerchausses", armor_TinkerChausses); - TConstructRegistry.addItemToDirectory("tinkerboots", armor_TinkerBoots); + //Patterns + TConstructRegistry.addItemStackToDirectory("rivets Pattern", new ItemStack( + woodPattern, 1, 0)); + TConstructRegistry.addItemStackToDirectory("clasp Pattern", new ItemStack( + woodPattern, 1, 1)); + TConstructRegistry.addItemStackToDirectory("armorplate Pattern", new ItemStack( + woodPattern, 1, 2)); - TConstructRegistry.addItemToDirectory("tinkerrobe", armor_TinkerRobe); - TConstructRegistry.addItemToDirectory("tinkershawl", armor_TinkerShawl); - TConstructRegistry.addItemToDirectory("tinkerhood", armor_TinkerHood); - TConstructRegistry.addItemToDirectory("tinkershoes", armor_TinkerShoes); - - woodPattern = new TD_Patterns("pattern_", "Pattern"); - metalPattern = new TD_Patterns("cast_", "MetalPattern"); + //Entities + // EntityRegistry.registerModEntity(EntityHookshotHook.class, "EntityHookshotHook", 0, this, 64, 10, true); - GameRegistry.registerItem(woodPattern, "Pattern"); - // TConstructRegistry.addItemToDirectory("woodPattern", woodPattern); - - GameRegistry.registerItem(metalPattern, "Cast"); - - TConstructRegistry.addItemStackToDirectory("rivets Pattern", new ItemStack(woodPattern, 1, 0)); - TConstructRegistry.addItemStackToDirectory("clasp Pattern", new ItemStack(woodPattern, 1, 1)); - TConstructRegistry.addItemStackToDirectory("armorplate Pattern", new ItemStack(woodPattern, 1, 2)); + if(config.ArmorAddon) + { + ArmorAddon.preInit(e); + } - // Renderers + TDIntegration.Integrate(); + mods.preInit(); proxy.registerRenderers(); } @EventHandler public void init(FMLInitializationEvent e) { - //System.out.print(Reference.MOD_ID); - - //flowermod.RegisterRecipes(); - //flowermod.RegisterModifiers(); + //I reject your moss and substitute my own! + if(config.mossEnabled || config.mossHard) + { + final List recipes = CraftingManager.getInstance().getRecipeList(); + final Iterator recipe = recipes.iterator(); + + while(recipe.hasNext()) + { + final ItemStack next = recipe.next().getRecipeOutput(); + if(next != null) + { + if(next.getItem() == TConstructRegistry.getItemStack("mossBall").getItem() && next.getItemDamage() == TConstructRegistry.getItemStack("mossBall").getItemDamage()) + { + recipe.remove(); + } + } + } + + if(config.mossHard) + { + GameRegistry.addShapedRecipe(TConstructRegistry.getItemStack("mossBall"), new Object[] {"hmh", "msm", "hmh", 'h', new ItemStack( + TinkerArmor.heartCanister, 1, 3), 'm', new ItemStack( + Blocks.mossy_cobblestone, 1, 0), 's', new ItemStack( + Items.nether_star, 1, 0)}); + } + } StencilBuilder.registerStencil(50, woodPattern, 0); // rivets StencilBuilder.registerStencil(51, woodPattern, 1); // clasp @@ -492,18 +404,15 @@ public class TinkersDefense PatternBuilder.instance.addToolPattern(woodPattern); partRivet = new DynamicToolPart("_rivets", "Rivets"); - GameRegistry.registerItem(partRivet, "RivetPart"); - partClasp = new DynamicToolPart("_clasp", "Clasp"); - GameRegistry.registerItem(partClasp, "ClaspPart"); - partArmorplate = new DynamicToolPart("_armorplate", "Armor Plate"); - GameRegistry.registerItem(partArmorplate, "ArmorPlatePart"); - partCloth = new Cloth().setUnlocalizedName("TD.Cloth"); - GameRegistry.registerItem(partCloth, "clothPart"); - partChainmaille = new DynamicToolPart("_chainmaille", "Chainmaille"); + + GameRegistry.registerItem(partRivet, "RivetPart"); + GameRegistry.registerItem(partClasp, "ClaspPart"); + GameRegistry.registerItem(partArmorplate, "ArmorPlatePart"); + GameRegistry.registerItem(partCloth, "clothPart"); GameRegistry.registerItem(partChainmaille, "chainmaillePart"); buildParts(partRivet, 0); @@ -512,23 +421,43 @@ public class TinkersDefense //buildParts(partCloth, 3); buildParts(partChainmaille, 4); - - - PatternBuilder pb = PatternBuilder.instance; - - TConstructClientRegistry.toolButtons.add(new ToolGuiElement(1, 0, 0, new int[] {9, 0, 4, 0}, new int[] {2, 3, 2, 0}, StatCollector.translateToLocal("gui.toolstation.roundshield.name"), StatCollector.translateToLocal("gui.toolstation.roundshield.desc"), "tinkersdefense", "textures/gui/icons2.png")); - - ToolGuiElement button2 = new ToolGuiElement(5, 0, 0, new int[] {0, 0, 0, 0}, new int[] {2, 3, 2, 3}, StatCollector.translateToLocal("gui.toolstation.heatershield.name"), StatCollector.translateToLocal("gui.toolstation.heatershield.desc"), "tinkersdefense:", "textures/gui/icons2.png"); - TConstructClientRegistry.tierTwoButtons.add(button2); - - TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, 0, 50, "tinkersdefense", "textures/gui/icons.png")); - TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, 0, 51, "tinkersdefense", "textures/gui/icons.png")); - TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, 0, 52, "tinkersdefense", "textures/gui/icons.png")); - TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, 0, 53, "tinkersdefense", "textures/gui/icons.png")); - TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, 0, 54, "tinkersdefense", "textures/gui/icons.png")); + final PatternBuilder pb = PatternBuilder.instance; + + TConstructClientRegistry.toolButtons.add(new ToolGuiElement( + 1, + 0, + 0, + new int[] {9, 0, 4, 0}, + new int[] {2, 3, 2, 0}, + StatCollector.translateToLocal("gui.toolstation.roundshield.name"), + StatCollector.translateToLocal("gui.toolstation.roundshield.desc"), + "tinkersdefense", "textures/gui/icons2.png")); + + TConstructClientRegistry.tierTwoButtons.add(new ToolGuiElement( + 5, + 0, + 0, + new int[] {0, 0, 0, 0}, + new int[] {2, 3, 2, 3}, + StatCollector.translateToLocal("gui.toolstation.heatershield.name"), + StatCollector.translateToLocal("gui.toolstation.heatershield.desc"), + "tinkersdefense:", "textures/gui/icons2.png")); + + TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, + 0, 50, "tinkersdefense", "textures/gui/icons.png")); + TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, + 0, 51, "tinkersdefense", "textures/gui/icons.png")); + TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, + 0, 52, "tinkersdefense", "textures/gui/icons.png")); + TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, + 0, 53, "tinkersdefense", "textures/gui/icons.png")); + TConstructClientRegistry.stencilButtons2.add(new StencilGuiElement(0, + 0, 54, "tinkersdefense", "textures/gui/icons.png")); // Aeonsteel - pb.registerMaterialSet("aeonsteel", new ItemStack(TinkerTools.toolShard, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.AeonsteelMatID); + pb.registerMaterialSet("aeonsteel", new ItemStack( + TinkerTools.toolShard, 1, 10), new ItemStack( + TinkerTools.toolRod, 1, 10), config.AeonsteelMatID); TConstructClientRegistry.addMaterialRenderMapping(config.AeonsteelMatID, "tinker", "aeonsteel", true); @@ -539,118 +468,211 @@ public class TinkersDefense TinkerTools.registerPatternMaterial("AeonSteelIngot", 2, "AeonSteel"); TConstructRegistry.addDefaultToolPartMaterial(config.AeonsteelMatID); - Smeltery.addMelting(new ItemStack(item_AeonSteelIngot, 1, 0), block_AeonSteelBlock, 0, 500, new FluidStack(moltenAeonsteel, TConstruct.ingotLiquidValue)); - Smeltery.addMelting(block_AeonSteelBlock, 0, 500, new FluidStack(moltenAeonsteel, TConstruct.ingotLiquidValue * 9)); + Smeltery.addMelting(new ItemStack(item_AeonSteelIngot, 1, 0), block_AeonSteelBlock, 0, 500, new FluidStack( + moltenAeonsteel, TConstruct.ingotLiquidValue)); + Smeltery.addMelting(block_AeonSteelBlock, 0, 500, new FluidStack( + moltenAeonsteel, TConstruct.ingotLiquidValue * 9)); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(item_AeonSteelIngot, 1, 0), new FluidStack(moltenAeonsteel, TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + item_AeonSteelIngot, 1, 0), new FluidStack(moltenAeonsteel, + TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); - TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack(block_AeonSteelBlock, 1, 0), new FluidStack(moltenAeonsteel, TConstruct.ingotLiquidValue * 9), 100); + TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack( + block_AeonSteelBlock, 1, 0), new FluidStack(moltenAeonsteel, + TConstruct.ingotLiquidValue * 9), 100); castMolten(moltenAeonsteel, config.AeonsteelMatID); - PatternBuilder.instance.registerFullMaterial(new ItemStack(item_AeonSteelIngot, 1, 0), 2, "Aeonsteel", new ItemStack(TinkerTools.toolShard, 1, config.AeonsteelMatID), new ItemStack(TinkerTools.toolRod, 1, config.AeonsteelMatID), config.AeonsteelMatID); + PatternBuilder.instance.registerFullMaterial(new ItemStack( + item_AeonSteelIngot, 1, 0), 2, "Aeonsteel", new ItemStack( + TinkerTools.toolShard, 1, config.AeonsteelMatID), new ItemStack( + TinkerTools.toolRod, 1, config.AeonsteelMatID), config.AeonsteelMatID); - Smeltery.addAlloyMixing(new FluidStack(moltenAeonsteel, 144), new FluidStack[] {new FluidStack(TinkerSmeltery.moltenAlumiteFluid, 144), new FluidStack(TinkerSmeltery.moltenCobaltFluid, 144)}); + Smeltery.addAlloyMixing(new FluidStack(moltenAeonsteel, 144), new FluidStack[] {new FluidStack( + TinkerSmeltery.moltenAlumiteFluid, 144), new FluidStack( + TinkerSmeltery.moltenCobaltFluid, 144)}); // Queen's Gold - pb.registerMaterialSet("queensgold", new ItemStack(TinkerTools.toolShard, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.QueensGoldMatID); + pb.registerMaterialSet("queensgold", new ItemStack( + TinkerTools.toolShard, 1, 10), new ItemStack( + TinkerTools.toolRod, 1, 10), config.QueensGoldMatID); TConstructClientRegistry.addMaterialRenderMapping(config.QueensGoldMatID, "tinker", "queensgold", true); TConstructRegistry.addToolMaterial(config.QueensGoldMatID, "QueensGold", 3, 100, 500, 2, 1.0F, 0, 0f, GOLD.toString(), 0xeaee57); TinkerTools.registerPatternMaterial("QueensGoldIngot", 2, "QueensGold"); TConstructRegistry.addDefaultToolPartMaterial(config.QueensGoldMatID); - Smeltery.addMelting(new ItemStack(item_QueensGoldIngot, 1, 0), block_QueensGoldBlock, 0, 500, new FluidStack(moltenQueensGold, TConstruct.ingotLiquidValue)); - Smeltery.addMelting(block_QueensGoldBlock, 0, 500, new FluidStack(moltenQueensGold, TConstruct.ingotLiquidValue * 9)); + Smeltery.addMelting(new ItemStack(item_QueensGoldIngot, 1, 0), block_QueensGoldBlock, 0, 500, new FluidStack( + moltenQueensGold, TConstruct.ingotLiquidValue)); + Smeltery.addMelting(block_QueensGoldBlock, 0, 500, new FluidStack( + moltenQueensGold, TConstruct.ingotLiquidValue * 9)); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(item_QueensGoldIngot, 1, 0), new FluidStack(moltenQueensGold, TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + item_QueensGoldIngot, 1, 0), new FluidStack(moltenQueensGold, + TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); - TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack(block_QueensGoldBlock, 1, 0), new FluidStack(moltenQueensGold, TConstruct.ingotLiquidValue * 9), 100); + TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack( + block_QueensGoldBlock, 1, 0), new FluidStack(moltenQueensGold, + TConstruct.ingotLiquidValue * 9), 100); castMolten(moltenQueensGold, config.QueensGoldMatID); - PatternBuilder.instance.registerFullMaterial(new ItemStack(item_QueensGoldIngot, 1, 0), 2, "QueensGold", new ItemStack(TinkerTools.toolShard, 1, config.QueensGoldMatID), new ItemStack(TinkerTools.toolRod, 1, config.QueensGoldMatID), config.QueensGoldMatID); + PatternBuilder.instance.registerFullMaterial(new ItemStack( + item_QueensGoldIngot, 1, 0), 2, "QueensGold", new ItemStack( + TinkerTools.toolShard, 1, config.QueensGoldMatID), new ItemStack( + TinkerTools.toolRod, 1, config.QueensGoldMatID), config.QueensGoldMatID); - Smeltery.addAlloyMixing(new FluidStack(moltenQueensGold, 144 * 8), new FluidStack[] {new FluidStack(TinkerSmeltery.moltenGoldFluid, 144 * 8), new FluidStack(TinkerSmeltery.moltenEmeraldFluid, 80)}); + Smeltery.addAlloyMixing(new FluidStack(moltenQueensGold, 144 * 8), new FluidStack[] {new FluidStack( + TinkerSmeltery.moltenGoldFluid, 144 * 8), new FluidStack( + TinkerSmeltery.moltenEmeraldFluid, 80)}); // Dogbearium - pb.registerMaterialSet("dogbearium", new ItemStack(TinkerTools.toolShard, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.DogbeariumMatID); + pb.registerMaterialSet("dogbearium", new ItemStack( + TinkerTools.toolShard, 1, 10), new ItemStack( + TinkerTools.toolRod, 1, 10), config.DogbeariumMatID); TConstructClientRegistry.addMaterialRenderMapping(config.DogbeariumMatID, "tinker", "dogbearium", true); TConstructRegistry.addToolMaterial(config.DogbeariumMatID, "Dogbearium", 4, 600, 800, 2, 1.6F, 0, -2f, DARK_RED.toString(), 0x754200); TinkerTools.registerPatternMaterial("DogbeariumIngot", 2, "Dogbearium"); TConstructRegistry.addDefaultToolPartMaterial(config.DogbeariumMatID); - Smeltery.addMelting(new ItemStack(item_DogbeariumIngot, 1, 0), block_DogbeariumBlock, 0, 500, new FluidStack(moltenDogbearium, TConstruct.ingotLiquidValue)); - Smeltery.addMelting(block_DogbeariumBlock, 0, 500, new FluidStack(moltenDogbearium, TConstruct.ingotLiquidValue * 9)); + Smeltery.addMelting(new ItemStack(item_DogbeariumIngot, 1, 0), block_DogbeariumBlock, 0, 500, new FluidStack( + moltenDogbearium, TConstruct.ingotLiquidValue)); + Smeltery.addMelting(block_DogbeariumBlock, 0, 500, new FluidStack( + moltenDogbearium, TConstruct.ingotLiquidValue * 9)); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(item_DogbeariumIngot, 1, 0), new FluidStack(moltenDogbearium, TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + item_DogbeariumIngot, 1, 0), new FluidStack(moltenDogbearium, + TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); - TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack(block_DogbeariumBlock, 1, 0), new FluidStack(moltenDogbearium, TConstruct.ingotLiquidValue * 9), 100); + TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack( + block_DogbeariumBlock, 1, 0), new FluidStack(moltenDogbearium, + TConstruct.ingotLiquidValue * 9), 100); castMolten(moltenDogbearium, config.DogbeariumMatID); - PatternBuilder.instance.registerFullMaterial(new ItemStack(item_DogbeariumIngot, 1, 0), 2, "Dogbearium", new ItemStack(TinkerTools.toolShard, 1, config.DogbeariumMatID), new ItemStack(TinkerTools.toolRod, 1, config.DogbeariumMatID), config.DogbeariumMatID); + PatternBuilder.instance.registerFullMaterial(new ItemStack( + item_DogbeariumIngot, 1, 0), 2, "Dogbearium", new ItemStack( + TinkerTools.toolShard, 1, config.DogbeariumMatID), new ItemStack( + TinkerTools.toolRod, 1, config.DogbeariumMatID), config.DogbeariumMatID); - Smeltery.addAlloyMixing(new FluidStack(moltenDogbearium, 144 * 2), new FluidStack[] {new FluidStack(TinkerSmeltery.moltenArditeFluid, 144), new FluidStack(TinkerSmeltery.bloodFluid, 160), new FluidStack(TinkerSmeltery.moltenEnderFluid, 250)}); + Smeltery.addAlloyMixing(new FluidStack(moltenDogbearium, 144 * 2), new FluidStack[] {new FluidStack( + TinkerSmeltery.moltenArditeFluid, 144), new FluidStack( + TinkerSmeltery.bloodFluid, 160), new FluidStack( + TinkerSmeltery.moltenEnderFluid, 250)}); //Red Mint - pb.registerMaterialSet("RedMint", new ItemStack(TinkerTools.toolShard, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.RedMintMatID); + pb.registerMaterialSet("RedMint", new ItemStack(TinkerTools.toolShard, + 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.RedMintMatID); TConstructClientRegistry.addMaterialRenderMapping(config.RedMintMatID, "tinker", "RedMint", true); TConstructRegistry.addToolMaterial(config.RedMintMatID, "RedMint", 1, 50, 10, 0, 0F, 0, 0f, DARK_RED.toString(), 0xFF0000); TinkerTools.registerPatternMaterial("RedMintIngot", 2, "RedMint"); TConstructRegistry.addDefaultToolPartMaterial(config.RedMintMatID); - Smeltery.addMelting(new ItemStack(item_RedMintcane, 1, 0), block_RedMintBlock, 0, 250, new FluidStack(moltenRedMint, TConstruct.chunkLiquidValue)); - Smeltery.addMelting(new ItemStack(item_RedMintIngot, 1, 0), block_RedMintBlock, 0, 500, new FluidStack(moltenRedMint, TConstruct.ingotLiquidValue)); - Smeltery.addMelting(block_RedMintBlock, 0, 500, new FluidStack(moltenRedMint, TConstruct.ingotLiquidValue * 9)); + Smeltery.addMelting(new ItemStack(item_RedMintcane, 1, 0), block_RedMintBlock, 0, 250, new FluidStack( + moltenRedMint, TConstruct.chunkLiquidValue)); + Smeltery.addMelting(new ItemStack(item_RedMintIngot, 1, 0), block_RedMintBlock, 0, 500, new FluidStack( + moltenRedMint, TConstruct.ingotLiquidValue)); + Smeltery.addMelting(block_RedMintBlock, 0, 500, new FluidStack( + moltenRedMint, TConstruct.ingotLiquidValue * 9)); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(item_RedMintIngot, 1, 0), new FluidStack(moltenRedMint, TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + item_RedMintIngot, 1, 0), new FluidStack(moltenRedMint, + TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); - TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack(block_RedMintBlock, 1, 0), new FluidStack(moltenRedMint, TConstruct.ingotLiquidValue * 9), 100); + TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack( + block_RedMintBlock, 1, 0), new FluidStack(moltenRedMint, + TConstruct.ingotLiquidValue * 9), 100); castMolten(moltenRedMint, config.RedMintMatID); - PatternBuilder.instance.registerFullMaterial(new ItemStack(item_RedMintcane, 1, 0), 2, "RedMint", new ItemStack(TinkerTools.toolShard, 1, config.RedMintMatID), new ItemStack(TinkerTools.toolRod, 1, config.RedMintMatID), config.RedMintMatID); + PatternBuilder.instance.registerFullMaterial(new ItemStack( + item_RedMintcane, 1, 0), 2, "RedMint", new ItemStack( + TinkerTools.toolShard, 1, config.RedMintMatID), new ItemStack( + TinkerTools.toolRod, 1, config.RedMintMatID), config.RedMintMatID); //Green Mint - pb.registerMaterialSet("GreenMint", new ItemStack(TinkerTools.toolShard, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 10), config.GreenMintMatID); + pb.registerMaterialSet("GreenMint", new ItemStack( + TinkerTools.toolShard, 1, 10), new ItemStack( + TinkerTools.toolRod, 1, 10), config.GreenMintMatID); TConstructClientRegistry.addMaterialRenderMapping(config.GreenMintMatID, "tinker", "GreenMint", true); TConstructRegistry.addToolMaterial(config.GreenMintMatID, "GreenMint", 1, 50, 10, 0, 0F, 0, 0f, DARK_RED.toString(), 0x5bde4b); TinkerTools.registerPatternMaterial("GreenMintIngot", 2, "GreenMint"); TConstructRegistry.addDefaultToolPartMaterial(config.GreenMintMatID); - Smeltery.addMelting(new ItemStack(item_GreenMintcane, 1, 0), block_GreenMintBlock, 0, 250, new FluidStack(moltenGreenMint, TConstruct.chunkLiquidValue)); - Smeltery.addMelting(new ItemStack(item_GreenMintIngot, 1, 0), block_GreenMintBlock, 0, 500, new FluidStack(moltenGreenMint, TConstruct.ingotLiquidValue)); - Smeltery.addMelting(block_GreenMintBlock, 0, 500, new FluidStack(moltenGreenMint, TConstruct.ingotLiquidValue * 9)); + Smeltery.addMelting(new ItemStack(item_GreenMintcane, 1, 0), block_GreenMintBlock, 0, 250, new FluidStack( + moltenGreenMint, TConstruct.chunkLiquidValue)); + Smeltery.addMelting(new ItemStack(item_GreenMintIngot, 1, 0), block_GreenMintBlock, 0, 500, new FluidStack( + moltenGreenMint, TConstruct.ingotLiquidValue)); + Smeltery.addMelting(block_GreenMintBlock, 0, 500, new FluidStack( + moltenGreenMint, TConstruct.ingotLiquidValue * 9)); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(item_GreenMintIngot, 1, 0), new FluidStack(moltenGreenMint, TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + item_GreenMintIngot, 1, 0), new FluidStack(moltenGreenMint, + TConstruct.ingotLiquidValue), TConstructRegistry.getItemStack("ingotCast"), false, 50); - TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack(block_GreenMintBlock, 1, 0), new FluidStack(moltenGreenMint, TConstruct.ingotLiquidValue * 9), 100); + TConstructRegistry.instance.getBasinCasting().addCastingRecipe(new ItemStack( + block_GreenMintBlock, 1, 0), new FluidStack(moltenGreenMint, + TConstruct.ingotLiquidValue * 9), 100); castMolten(moltenGreenMint, config.GreenMintMatID); - PatternBuilder.instance.registerFullMaterial(new ItemStack(item_GreenMintcane, 1, 0), 2, "GreenMint", new ItemStack(TinkerTools.toolShard, 1, config.GreenMintMatID), new ItemStack(TinkerTools.toolRod, 1, config.GreenMintMatID), config.GreenMintMatID); + PatternBuilder.instance.registerFullMaterial(new ItemStack( + item_GreenMintcane, 1, 0), 2, "GreenMint", new ItemStack( + TinkerTools.toolShard, 1, config.GreenMintMatID), new ItemStack( + TinkerTools.toolRod, 1, config.GreenMintMatID), config.GreenMintMatID); //Cloth - TConstructRegistry.addCustomMaterial(new ClothMaterial(0, 2, new ItemStack(Blocks.wool, 1, 0), new ItemStack(TinkersDefense.partCloth, 1, 0), 0xffffff)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(1, 2, new ItemStack(Blocks.wool, 1, 1), new ItemStack(TinkersDefense.partCloth, 1, 1), 0xe08c54)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(2, 2, new ItemStack(Blocks.wool, 1, 2), new ItemStack(TinkersDefense.partCloth, 1, 2), 0xc16bc9)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(3, 2, new ItemStack(Blocks.wool, 1, 3), new ItemStack(TinkersDefense.partCloth, 1, 3), 0x8ba4d6)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(4, 2, new ItemStack(Blocks.wool, 1, 4), new ItemStack(TinkersDefense.partCloth, 1, 4), 0xcfc231)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(5, 2, new ItemStack(Blocks.wool, 1, 5), new ItemStack(TinkersDefense.partCloth, 1, 5), 0x50c447)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(6, 2, new ItemStack(Blocks.wool, 1, 6), new ItemStack(TinkersDefense.partCloth, 1, 6), 0xdea5b3)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(7, 2, new ItemStack(Blocks.wool, 1, 7), new ItemStack(TinkersDefense.partCloth, 1, 7), 0x494949)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(8, 2, new ItemStack(Blocks.wool, 1, 8), new ItemStack(TinkersDefense.partCloth, 1, 8), 0xb6baba)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(9, 2, new ItemStack(Blocks.wool, 1, 9), new ItemStack(TinkersDefense.partCloth, 1, 9), 0x3782a1)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(10, 2, new ItemStack(Blocks.wool, 1, 10), new ItemStack(TinkersDefense.partCloth, 1, 10), 0x9453c9)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(11, 2, new ItemStack(Blocks.wool, 1, 11), new ItemStack(TinkersDefense.partCloth, 1, 11), 0x3543a6)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(12, 2, new ItemStack(Blocks.wool, 1, 12), new ItemStack(TinkersDefense.partCloth, 1, 12), 0x5c3a24)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(13, 2, new ItemStack(Blocks.wool, 1, 13), new ItemStack(TinkersDefense.partCloth, 1, 13), 0x3e5420)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(14, 2, new ItemStack(Blocks.wool, 1, 14), new ItemStack(TinkersDefense.partCloth, 1, 14), 0xb03e38)); - TConstructRegistry.addCustomMaterial(new ClothMaterial(15, 2, new ItemStack(Blocks.wool, 1, 15), new ItemStack(TinkersDefense.partCloth, 1, 15), 0x242222)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(0, 2, + new ItemStack(Blocks.wool, 1, 0), new ItemStack( + TinkersDefense.partCloth, 1, 0), 0xffffff)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(1, 2, + new ItemStack(Blocks.wool, 1, 1), new ItemStack( + TinkersDefense.partCloth, 1, 1), 0xe08c54)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(2, 2, + new ItemStack(Blocks.wool, 1, 2), new ItemStack( + TinkersDefense.partCloth, 1, 2), 0xc16bc9)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(3, 2, + new ItemStack(Blocks.wool, 1, 3), new ItemStack( + TinkersDefense.partCloth, 1, 3), 0x8ba4d6)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(4, 2, + new ItemStack(Blocks.wool, 1, 4), new ItemStack( + TinkersDefense.partCloth, 1, 4), 0xcfc231)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(5, 2, + new ItemStack(Blocks.wool, 1, 5), new ItemStack( + TinkersDefense.partCloth, 1, 5), 0x50c447)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(6, 2, + new ItemStack(Blocks.wool, 1, 6), new ItemStack( + TinkersDefense.partCloth, 1, 6), 0xdea5b3)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(7, 2, + new ItemStack(Blocks.wool, 1, 7), new ItemStack( + TinkersDefense.partCloth, 1, 7), 0x494949)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(8, 2, + new ItemStack(Blocks.wool, 1, 8), new ItemStack( + TinkersDefense.partCloth, 1, 8), 0xb6baba)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(9, 2, + new ItemStack(Blocks.wool, 1, 9), new ItemStack( + TinkersDefense.partCloth, 1, 9), 0x3782a1)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(10, 2, + new ItemStack(Blocks.wool, 1, 10), new ItemStack( + TinkersDefense.partCloth, 1, 10), 0x9453c9)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(11, 2, + new ItemStack(Blocks.wool, 1, 11), new ItemStack( + TinkersDefense.partCloth, 1, 11), 0x3543a6)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(12, 2, + new ItemStack(Blocks.wool, 1, 12), new ItemStack( + TinkersDefense.partCloth, 1, 12), 0x5c3a24)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(13, 2, + new ItemStack(Blocks.wool, 1, 13), new ItemStack( + TinkersDefense.partCloth, 1, 13), 0x3e5420)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(14, 2, + new ItemStack(Blocks.wool, 1, 14), new ItemStack( + TinkersDefense.partCloth, 1, 14), 0xb03e38)); + TConstructRegistry.addCustomMaterial(new ClothMaterial(15, 2, + new ItemStack(Blocks.wool, 1, 15), new ItemStack( + TinkersDefense.partCloth, 1, 15), 0x242222)); // Shields TConstructRegistry.addToolRecipe(tool_roundShield, partArmorplate, TinkerTools.toolRod, TinkerTools.frypanHead); @@ -665,29 +687,14 @@ public class TinkersDefense //Zweihander TConstructRegistry.addToolRecipe(tool_zweihander, TinkerTools.largeSwordBlade, TinkerTools.toughRod, TinkerTools.wideGuard, TinkerTools.swordBlade); - //Armor - TConstructRegistry.addToolRecipe(tool_sheath, partArmorplate, TinkerTools.toolRod, partClasp, partCloth); - // TConstructRegistry.addToolRecipe(tool_mask, partArmorplate, partCloth, partClasp); - - TConstructRegistry.addToolRecipe(armor_TinkerHelm, TinkerTools.frypanHead, TinkerTools.toughRod, partArmorplate); - TConstructRegistry.addToolRecipe(armor_TinkerBreastplate, TinkerTools.largePlate, TinkerTools.toughRod, partArmorplate, partChainmaille); - TConstructRegistry.addToolRecipe(armor_TinkerGrieves, partArmorplate, TinkerTools.toughRod, partChainmaille, partArmorplate); - TConstructRegistry.addToolRecipe(armor_TinkerSabatons, partArmorplate, TinkerTools.toughRod, partArmorplate, partCloth); - TConstructRegistry.addToolRecipe(armor_TinkerGauntlets, partArmorplate, TinkerTools.toughRod, partRivet); - - TConstructRegistry.addToolRecipe(armor_TinkerRobe, partCloth, partCloth); - TConstructRegistry.addToolRecipe(armor_TinkerShawl, partCloth, partCloth, partClasp); - TConstructRegistry.addToolRecipe(armor_TinkerHood, partCloth, partCloth, partRivet); - TConstructRegistry.addToolRecipe(armor_TinkerShoes, partCloth, partClasp, partRivet); - - TConstructRegistry.addToolRecipe(armor_TinkerCoif, partChainmaille, partCloth, TinkerTools.toughRod); - TConstructRegistry.addToolRecipe(armor_TinkerHalberd, partChainmaille, partArmorplate, partRivet); - TConstructRegistry.addToolRecipe(armor_TinkerChausses, partChainmaille, partArmorplate); - TConstructRegistry.addToolRecipe(armor_TinkerBoots, partChainmaille, partCloth, partRivet); + //TConstructRegistry.addToolRecipe(tool_hookshot, TinkersDefense.partArmorplate, TinkerTools.toughRod, TinkersDefense.partChainmaille); tcInject = new Injector(0); GameRegistry.registerItem(tcInject, "???"); - + + GameRegistry.addShapelessRecipe(new ItemStack(item_Guidebook), new ItemStack( + Items.book), new ItemStack(partArmorplate, 1, -1)); + mods.Init(); // for(int i = 0; i < TConstructRegistry.tools.size(); i++) @@ -700,79 +707,148 @@ public class TinkersDefense // } //AMEvent.init(); + + if(config.ArmorAddon) + { + ArmorAddon.init(e); + } } @EventHandler public void postInit(FMLPostInitializationEvent e) { - // List list = ModifyBuilder.instance.itemModifiers; - // list = ModifyBuilder.instance.itemModifiers; + + if(config.ArmorAddon) + { + ArmorAddon.postInit(e); + } } public void castMolten(Fluid fluid, int ID) { // .addCastingRecipe(output, fluid, cast, hardeningDelay) - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.toolRod, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("toolRodCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.pickaxeHead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("pickaxeHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.shovelHead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("shovelHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.hatchetHead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("hatchetHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.swordBlade, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("swordBladeCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.fullGuard, 1, ID), new FluidStack(fluid, (int) (144 * 3.0D)), TConstructRegistry.getItemStack("fullGuardCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.wideGuard, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("wideGuardCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.crossbar, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("crossbarCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.binding, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("bindingCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.handGuard, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("handGuardCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.frypanHead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("frypanHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.signHead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("signHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.knifeBlade, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("knifeBladeCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.chiselHead, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), TConstructRegistry.getItemStack("chiselHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.toughRod, 1, ID), new FluidStack(fluid, (int) (144 * 3.0D)), TConstructRegistry.getItemStack("toughRodCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.toughBinding, 1, ID), new FluidStack(fluid, (int) (144 * 3.0D)), TConstructRegistry.getItemStack("toughBindingCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.largePlate, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("largePlateCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.broadAxeHead, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("broadAxeHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.scytheBlade, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("scytheHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.excavatorHead, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("excavatorHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.largeSwordBlade, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("largeBladeCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.hammerHead, 1, ID), new FluidStack(fluid, (int) (144 * 8.0D)), TConstructRegistry.getItemStack("hammerHeadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(TinkerTools.arrowhead, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), TConstructRegistry.getItemStack("arrowheadCast"), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(partArmorplate, 1, ID), new FluidStack(fluid, (int) (144 * 4.0D)), new ItemStack(metalPattern, 1, 2), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(partRivet, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), new ItemStack(metalPattern, 1, 0), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(partClasp, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), new ItemStack(metalPattern, 1, 1), 50); - TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack(partChainmaille, 1, ID), new FluidStack(fluid, (int) (144 * 4.0D)), new ItemStack(metalPattern, 1, 3), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.toolRod, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("toolRodCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.pickaxeHead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("pickaxeHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.shovelHead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("shovelHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.hatchetHead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("hatchetHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.swordBlade, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("swordBladeCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.fullGuard, 1, ID), new FluidStack(fluid, + (int) (144 * 3.0D)), TConstructRegistry.getItemStack("fullGuardCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.wideGuard, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("wideGuardCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.crossbar, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("crossbarCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.binding, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("bindingCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.handGuard, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("handGuardCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.frypanHead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("frypanHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.signHead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("signHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.knifeBlade, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("knifeBladeCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.chiselHead, 1, ID), new FluidStack(fluid, + (int) (144 * 0.5D)), TConstructRegistry.getItemStack("chiselHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.toughRod, 1, ID), new FluidStack(fluid, + (int) (144 * 3.0D)), TConstructRegistry.getItemStack("toughRodCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.toughBinding, 1, ID), new FluidStack(fluid, + (int) (144 * 3.0D)), TConstructRegistry.getItemStack("toughBindingCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.largePlate, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("largePlateCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.broadAxeHead, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("broadAxeHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.scytheBlade, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("scytheHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.excavatorHead, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("excavatorHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.largeSwordBlade, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("largeBladeCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.hammerHead, 1, ID), new FluidStack(fluid, + (int) (144 * 8.0D)), TConstructRegistry.getItemStack("hammerHeadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + TinkerTools.arrowhead, 1, ID), new FluidStack(fluid, + (int) (144 * 1.0D)), TConstructRegistry.getItemStack("arrowheadCast"), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + partArmorplate, 1, ID), new FluidStack(fluid, + (int) (144 * 4.0D)), new ItemStack(metalPattern, 1, 2), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + partRivet, 1, ID), new FluidStack(fluid, (int) (144 * 0.5D)), new ItemStack( + metalPattern, 1, 0), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + partClasp, 1, ID), new FluidStack(fluid, (int) (144 * 1.0D)), new ItemStack( + metalPattern, 1, 1), 50); + TConstructRegistry.instance.getTableCasting().addCastingRecipe(new ItemStack( + partChainmaille, 1, ID), new FluidStack(fluid, + (int) (144 * 4.0D)), new ItemStack(metalPattern, 1, 3), 50); } public void buildParts(Item item, int meta) { - int[] nonMetals = {0, 1, 3, 4, 5, 6, 7, 8, 9, 17}; - int[] liquidDamage = new int[] {2, 13, 10, 11, 12, 14, 15, 6, 16, 18}; + final int[] nonMetals = {0, 1, 3, 4, 5, 6, 7, 8, 9, 17}; + final int[] liquidDamage = new int[] {2, 13, 10, 11, 12, 14, 15, 6, 16, 18}; for(int mat = 0; mat < nonMetals.length; mat++) { - TConstructRegistry.addPartMapping(woodPattern, meta, mat, new ItemStack(item, 1, mat)); + TConstructRegistry.addPartMapping(woodPattern, meta, mat, new ItemStack( + item, 1, mat)); } - LiquidCasting tableCasting = TConstructRegistry.getTableCasting(); + final LiquidCasting tableCasting = TConstructRegistry.getTableCasting(); // patternOutputs = new Item[] { partShuriken, partCrossbowLimb, // partCrossbowBody, partBowLimb }; - ItemStack cast = new ItemStack(metalPattern, 1, meta); + final ItemStack cast = new ItemStack(metalPattern, 1, meta); - tableCasting.addCastingRecipe(cast, new FluidStack(TinkerSmeltery.moltenAlubrassFluid, TConstruct.ingotLiquidValue), new ItemStack(item, 1, Short.MAX_VALUE), false, 50); - tableCasting.addCastingRecipe(cast, new FluidStack(TinkerSmeltery.moltenGoldFluid, TConstruct.ingotLiquidValue * 2), new ItemStack(item, 1, Short.MAX_VALUE), false, 50); + tableCasting.addCastingRecipe(cast, new FluidStack( + TinkerSmeltery.moltenAlubrassFluid, TConstruct.ingotLiquidValue), new ItemStack( + item, 1, Short.MAX_VALUE), false, 50); + tableCasting.addCastingRecipe(cast, new FluidStack( + TinkerSmeltery.moltenGoldFluid, TConstruct.ingotLiquidValue * 2), new ItemStack( + item, 1, Short.MAX_VALUE), false, 50); for(int iterTwo = 0; iterTwo < TinkerSmeltery.liquids.length; iterTwo++) { - Fluid fs = TinkerSmeltery.liquids[iterTwo].getFluid(); - int fluidAmount = metalPattern.getPatternCost(cast) * TConstruct.ingotLiquidValue / 2; - ItemStack metalCast = new ItemStack(item, 1, liquidDamage[iterTwo]); - tableCasting.addCastingRecipe(metalCast, new FluidStack(fs, fluidAmount), cast, 50); + final Fluid fs = TinkerSmeltery.liquids[iterTwo].getFluid(); + final int fluidAmount = metalPattern.getPatternCost(cast) * TConstruct.ingotLiquidValue / 2; + final ItemStack metalCast = new ItemStack(item, 1, + liquidDamage[iterTwo]); + tableCasting.addCastingRecipe(metalCast, new FluidStack(fs, + fluidAmount), cast, 50); Smeltery.addMelting(FluidType.getFluidType(fs), metalCast, 0, fluidAmount); } } public static int[] hexToRGB(String hex) { - int color[] = new int[3]; + final int color[] = new int[3]; color[0] = Integer.parseInt(hex.substring(0, 2), 16); color[1] = Integer.parseInt(hex.substring(2, 4), 16); diff --git a/src/main/java/lance5057/tDefense/armor/ArmorCore.java b/src/main/java/lance5057/tDefense/armor/ArmorCore.java index e56535a..56645ac 100644 --- a/src/main/java/lance5057/tDefense/armor/ArmorCore.java +++ b/src/main/java/lance5057/tDefense/armor/ArmorCore.java @@ -1,9 +1,9 @@ package lance5057.tDefense.armor; -import org.lwjgl.opengl.GL11; - import lance5057.tDefense.TDIntegration; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.parts.ClothMaterial; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -15,21 +15,32 @@ import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; +import net.minecraftforge.common.MinecraftForge; + +import org.lwjgl.opengl.GL11; + +import tconstruct.library.TConstructRegistry; +import tconstruct.library.event.ToolCraftEvent.NormalTool; import tconstruct.library.tools.AbilityHelper; +import tconstruct.library.tools.CustomMaterial; import tconstruct.library.tools.ToolCore; import thaumcraft.api.IRunicArmor; +import vazkii.botania.api.item.IPixieSpawner; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IRunicArmor", striprefs = true)}) -public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor +public abstract class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor, IPixieSpawner { int slot; public float reductionPercent = 0f; protected int maxReduction = 100; + public String[] renderParts; + //Thaumcraft boolean Charge = false; @@ -38,6 +49,8 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor super(baseProtection); this.slot = slot; + + MinecraftForge.EVENT_BUS.register(this); } @Override @@ -47,12 +60,14 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor if(!source.isUnblockable()) { armorp = new ArmorProperties(0, reductionPercent, maxReduction); // 0.04 - // per - // half - // shirt + // per + // half + // shirt } else + { armorp = new ArmorProperties(0, 0, 0); + } return armorp; } @@ -90,9 +105,69 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { + if(itemStack.getItem() instanceof ToolCore) + { + final String[] color = new String[10]; + final ToolCore tool = (ToolCore) itemStack.getItem(); + + for(int j = 0; j < 10; j++) + { + color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); + + switch(j) + { + case 0: + if(tool.getHandleItem() == TinkersDefense.partCloth) + { + final int ID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); + + final CustomMaterial newColor = TConstructRegistry.getCustomMaterial(ID, ClothMaterial.class); + color[j] = Integer.toHexString(newColor.color); + } + break; + + case 1: + if(tool.getHeadItem() == TinkersDefense.partCloth) + { + final int ID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHead"); + + final CustomMaterial newColor = TConstructRegistry.getCustomMaterial(ID, ClothMaterial.class); + color[j] = Integer.toHexString(newColor.color); + } + break; + + case 2: + if(tool.getAccessoryItem() != null && tool.getAccessoryItem() == TinkersDefense.partCloth) + { + final int ID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderAccessory"); + + final CustomMaterial newColor = TConstructRegistry.getCustomMaterial(ID, ClothMaterial.class); + color[j] = Integer.toHexString(newColor.color); + } + break; + + case 3: + if(tool.getExtraItem() != null && tool.getExtraItem() == TinkersDefense.partCloth) + { + final int ID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderExtra"); + + final CustomMaterial newColor = TConstructRegistry.getCustomMaterial(ID, ClothMaterial.class); + color[j] = Integer.toHexString(newColor.color); + } + break; + } + } + + final ArmorRenderer model = getRenderer(); + model.SetColors(color, getDefaultFolder(), itemStack); + return model; + } return null; } + @SideOnly(Side.CLIENT) + public abstract ArmorRenderer getRenderer(); + @Override public Item getAccessoryItem() { @@ -133,7 +208,7 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - //TinkersDefense.mods.AMod.UpdateAll((ToolCore) itemStack.getItem(), itemStack, world, player, itemStack.getTagCompound().getCompoundTag("InfiTool")); + TinkersDefense.mods.AMod.UpdateAll((ToolCore) itemStack.getItem(), itemStack, world, player, itemStack.getTagCompound().getCompoundTag("InfiTool")); } @Override @@ -148,10 +223,10 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor //Check if runic shielding level has changed if(TDIntegration.thaumcraft) { - NBTTagCompound tcTag = stack.getTagCompound(); - NBTTagCompound ticoTag = stack.getTagCompound().getCompoundTag("InfiTool"); + final NBTTagCompound tcTag = stack.getTagCompound(); + final NBTTagCompound ticoTag = stack.getTagCompound().getCompoundTag("InfiTool"); - byte rs = tcTag.getByte("RS.HARDEN"); + final byte rs = tcTag.getByte("RS.HARDEN"); if(!Charge && rs > 0) { if(ticoTag.getInteger("Modifiers") > 0) @@ -160,7 +235,9 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor Charge = true; } else - tcTag.setByte("RS.HARDEN", (byte) 0); + { + tcTag.removeTag("RS.HARDEN"); + } } } } @@ -168,43 +245,91 @@ public class ArmorCore extends ToolCore implements ISpecialArmor, IRunicArmor public void renderArmor(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, String[] colors, ItemStack stack, int pass) { - ResourceLocation rc = new ResourceLocation("tinkersdefense:textures/" + this.getDefaultFolder() + "/" + getTexture(pass, stack) + ".png"); + final ResourceLocation rc = new ResourceLocation( + "tinkersdefense:textures/" + getDefaultFolder() + "/" + getTexture(pass, stack) + ".png"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(rc); - float size = 1.6f; + final float size = 1.6f; GL11.glScalef(1.0F / size, 1.0F / size, 1.0F / size); GL11.glTranslatef(0.0F, -0.01F, 0.0F); - int[] intColors = TinkersDefense.hexToRGB(colors[pass]); + final int[] intColors = TinkersDefense.hexToRGB(colors[pass]); GL11.glColor3d((float) intColors[0] / 255, (float) intColors[1] / 255, (float) intColors[2] / 255); } public String getTexture(int pass, ItemStack stack) { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + final NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + String renderReturn = ""; switch(pass) { case 0: - return this.getIconSuffix(2); + renderReturn = handleStrings.get(tags.getInteger("RenderHandle")); + break; case 1: - return this.getIconSuffix(0); + renderReturn = headStrings.get(tags.getInteger("RenderHead")); + break; case 2: - return this.getIconSuffix(3); + renderReturn = accessoryStrings.get(tags.getInteger("RenderAccessory")); + break; case 3: - return this.getIconSuffix(4); + renderReturn = extraStrings.get(tags.getInteger("RenderExtra")); + break; default: - if(tags != null && tags.hasKey("Effect" + (1 + pass - getPartAmount()))) + if(tags != null && tags.hasKey("Effect" + (pass - getPartAmount()))) { - String effect = effectStrings.get(tags.getInteger("Effect" + (1 + pass - getPartAmount()))); + final String effect = effectStrings.get(tags.getInteger("Effect" + (pass - getPartAmount()))); if(effect != null) - return effect.substring(effect.lastIndexOf("/")); + return effect.substring(effect.lastIndexOf("/") + 1); else return ""; - + } } - return ""; + if(renderReturn != null && renderReturn != "") + { + renderReturn = renderReturn.substring(renderReturn.indexOf("_")); + } + else + { + renderReturn = ""; + } + + return renderReturn; + } + + @Override + public float getPixieChance(ItemStack stack) + { + final float chance = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ElementiumCore") * 5 / 100f; + return chance; + } + + @SubscribeEvent + public void ToolCraftedEvent(NormalTool event) + { + if(event.tool instanceof ArmorCore) + { + final ArmorCore armor = (ArmorCore) event.tool; + final ArmorRenderer render = armor.getRenderer(); + final NBTTagCompound tooltags = event.toolTag; + final NBTTagCompound tags = render.defaultTags;//stack.setTagCompound(); + + // for(int i = 0; i < render.defaultTags.; i++) + // { + // final String rendertag = ((ModelRenderer) render.boxList.get(i)).boxName; + // if(rendertag != null) + // { + // tags.setBoolean(rendertag, ((ModelRenderer) render.boxList.get(i)).isHidden); + // } + // } + + if(!tags.hasNoTags()) + { + tooltags.setTag("ArmorRenderer", tags); + } + } } } diff --git a/src/main/java/lance5057/tDefense/armor/TDArmorAddon.java b/src/main/java/lance5057/tDefense/armor/TDArmorAddon.java new file mode 100644 index 0000000..a877515 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/TDArmorAddon.java @@ -0,0 +1,187 @@ +package lance5057.tDefense.armor; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.blocks.GlowstoneCrumbs; +import lance5057.tDefense.armor.blocks.UnstableBlock; +import lance5057.tDefense.armor.blocks.UnstableItemBlock; +import lance5057.tDefense.armor.items.Sheath; +import lance5057.tDefense.armor.items.TinkersGauntlets; +import lance5057.tDefense.armor.items.cloth.TinkersHood; +import lance5057.tDefense.armor.items.cloth.TinkersRobe; +import lance5057.tDefense.armor.items.cloth.TinkersShawl; +import lance5057.tDefense.armor.items.cloth.TinkersShoes; +import lance5057.tDefense.armor.items.heavy.TinkersBreastplate; +import lance5057.tDefense.armor.items.heavy.TinkersGrieves; +import lance5057.tDefense.armor.items.heavy.TinkersHelm; +import lance5057.tDefense.armor.items.heavy.TinkersSabatons; +import lance5057.tDefense.armor.items.light.TinkersBoots; +import lance5057.tDefense.armor.items.light.TinkersChausses; +import lance5057.tDefense.armor.items.light.TinkersCoif; +import lance5057.tDefense.armor.items.light.TinkersHauberk; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.MinecraftForgeClient; +import tconstruct.client.FlexibleToolRenderer; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.crafting.ToolBuilder; +import tconstruct.library.tools.ToolCore; +import tconstruct.tools.TinkerTools; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; + +public class TDArmorAddon +{ + public static CreativeTabs tabName; + + public static ToolCore armor_TinkerHood; + public static ToolCore armor_TinkerShawl; + public static ToolCore armor_TinkerRobe; + public static ToolCore armor_TinkerShoes; + + public static ToolCore armor_TinkerCoif; + public static ToolCore armor_TinkerHauberk; + public static ToolCore armor_TinkerChausses; + public static ToolCore armor_TinkerBoots; + + public static ToolCore armor_TinkerHelm; + public static ToolCore armor_TinkerBreastplate; + public static ToolCore armor_TinkerGrieves; + public static ToolCore armor_TinkerSabatons; + public static ToolCore armor_TinkerGauntlets; + + public static ToolCore accessory_sheath; + + public static Block block_Unstable; + public static Block block_GlowCrumbs; + + public void preInit(FMLPreInitializationEvent e) + { + tabName = new CreativeTabs("TabArmor") + { + + @Override + public Item getTabIconItem() + { + return ToolBuilder.instance.buildTool(new ItemStack( + TinkerTools.largePlate, 1, 2), new ItemStack( + TinkerTools.toughRod, 1, 2), new ItemStack( + TinkersDefense.partArmorplate, 1, 2), new ItemStack( + TinkersDefense.partChainmaille, 1, 2), "ArmorTab").getItem(); + } + + }; + + armor_TinkerHelm = new TinkersHelm(); + armor_TinkerBreastplate = new TinkersBreastplate(); + armor_TinkerGrieves = new TinkersGrieves(); + armor_TinkerSabatons = new TinkersSabatons(); + armor_TinkerGauntlets = new TinkersGauntlets(); + + armor_TinkerRobe = new TinkersRobe(); + armor_TinkerShawl = new TinkersShawl(); + armor_TinkerHood = new TinkersHood(); + armor_TinkerShoes = new TinkersShoes(); + + armor_TinkerCoif = new TinkersCoif(); + armor_TinkerHauberk = new TinkersHauberk(); + armor_TinkerChausses = new TinkersChausses(); + armor_TinkerBoots = new TinkersBoots(); + + accessory_sheath = new Sheath(); + + block_Unstable = new UnstableBlock(); + block_GlowCrumbs = new GlowstoneCrumbs(); + + GameRegistry.registerItem(armor_TinkerHelm, "tinkerhelm"); + GameRegistry.registerItem(armor_TinkerBreastplate, "tinkerbreastplate"); + GameRegistry.registerItem(armor_TinkerGrieves, "tinkergrieves"); + GameRegistry.registerItem(armor_TinkerSabatons, "tinkersabatons"); + GameRegistry.registerItem(armor_TinkerGauntlets, "tinkergauntlets"); + + GameRegistry.registerItem(armor_TinkerCoif, "tinkercoif"); + GameRegistry.registerItem(armor_TinkerHauberk, "tinkerhauberk"); + GameRegistry.registerItem(armor_TinkerChausses, "tinkerchausses"); + GameRegistry.registerItem(armor_TinkerBoots, "tinkerboots"); + + GameRegistry.registerItem(armor_TinkerRobe, "tinkerrobe"); + GameRegistry.registerItem(armor_TinkerShawl, "tinkershawl"); + GameRegistry.registerItem(armor_TinkerHood, "tinkerhood"); + GameRegistry.registerItem(armor_TinkerShoes, "tinkershoes"); + + GameRegistry.registerItem(accessory_sheath, "Sheath"); + + GameRegistry.registerBlock(block_Unstable, UnstableItemBlock.class, "Unstable"); + GameRegistry.registerBlock(block_GlowCrumbs, "Block_GlowCrumbs"); + + TConstructRegistry.addItemToDirectory("tinkerhelm", armor_TinkerHelm); + TConstructRegistry.addItemToDirectory("tinkerbreastplate", armor_TinkerBreastplate); + TConstructRegistry.addItemToDirectory("tinkergrieves", armor_TinkerGrieves); + TConstructRegistry.addItemToDirectory("tinkersabatons", armor_TinkerSabatons); + TConstructRegistry.addItemToDirectory("tinkergauntlets", armor_TinkerGauntlets); + + TConstructRegistry.addItemToDirectory("tinkercoif", armor_TinkerCoif); + TConstructRegistry.addItemToDirectory("tinkerhauberk", armor_TinkerHauberk); + TConstructRegistry.addItemToDirectory("tinkerchausses", armor_TinkerChausses); + TConstructRegistry.addItemToDirectory("tinkerboots", armor_TinkerBoots); + + TConstructRegistry.addItemToDirectory("tinkerrobe", armor_TinkerRobe); + TConstructRegistry.addItemToDirectory("tinkershawl", armor_TinkerShawl); + TConstructRegistry.addItemToDirectory("tinkerhood", armor_TinkerHood); + TConstructRegistry.addItemToDirectory("tinkershoes", armor_TinkerShoes); + + TConstructRegistry.addItemToDirectory("Sheath", accessory_sheath); + } + + public void init(FMLInitializationEvent e) + { + + TConstructRegistry.addToolRecipe(armor_TinkerHelm, TinkerTools.frypanHead, TinkersDefense.partChainmaille, TinkersDefense.partArmorplate, TinkerTools.toughRod); + TConstructRegistry.addToolRecipe(armor_TinkerBreastplate, TinkerTools.largePlate, TinkerTools.toughRod, TinkersDefense.partArmorplate, TinkersDefense.partChainmaille); + TConstructRegistry.addToolRecipe(armor_TinkerGrieves, TinkersDefense.partArmorplate, TinkerTools.toughRod, TinkersDefense.partChainmaille, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerSabatons, TinkersDefense.partArmorplate, TinkerTools.toughRod, TinkersDefense.partArmorplate, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerGauntlets, TinkersDefense.partArmorplate, TinkerTools.toughRod, TinkersDefense.partRivet); + + TConstructRegistry.addToolRecipe(armor_TinkerRobe, TinkersDefense.partCloth, TinkersDefense.partClasp, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerShawl, TinkersDefense.partCloth, TinkersDefense.partArmorplate, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerHood, TinkersDefense.partCloth, TinkerTools.toolRod, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerShoes, TinkersDefense.partCloth, TinkersDefense.partRivet, TinkersDefense.partCloth); + + TConstructRegistry.addToolRecipe(armor_TinkerCoif, TinkersDefense.partChainmaille, TinkersDefense.partCloth, TinkerTools.toughRod); + TConstructRegistry.addToolRecipe(armor_TinkerHauberk, TinkersDefense.partChainmaille, TinkerTools.largePlate, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerChausses, TinkersDefense.partChainmaille, TinkersDefense.partArmorplate, TinkersDefense.partCloth); + TConstructRegistry.addToolRecipe(armor_TinkerBoots, TinkersDefense.partChainmaille, TinkersDefense.partCloth, TinkersDefense.partRivet); + + TConstructRegistry.addToolRecipe(accessory_sheath, TinkersDefense.partCloth, TinkersDefense.partCloth, TinkersDefense.partCloth); + + } + + public void postInit(FMLPostInitializationEvent e) + { + + } + + public static void clientProxy(FlexibleToolRenderer renderer) + { + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.accessory_sheath, renderer); + + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerHelm, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerBreastplate, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerGrieves, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerSabatons, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerGauntlets, renderer); + + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerRobe, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerShawl, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerHood, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerShoes, renderer); + + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerCoif, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerHauberk, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerChausses, renderer); + MinecraftForgeClient.registerItemRenderer(TDArmorAddon.armor_TinkerBoots, renderer); + } +} diff --git a/src/main/java/lance5057/tDefense/armor/TDHelmet.java b/src/main/java/lance5057/tDefense/armor/TDHelmet.java new file mode 100644 index 0000000..89bfb44 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/TDHelmet.java @@ -0,0 +1,49 @@ +package lance5057.tDefense.armor; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import thaumcraft.api.IGoggles; +import thaumcraft.api.nodes.IRevealer; +import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles; +import WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge; +import cpw.mods.fml.common.Optional; + +@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true), @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.wand.IWandHUD", striprefs = true), @Optional.Interface(modid = "AWWayofTime", iface = "WayofTime.alchemicalWizardry.api.items.interfaces.ILPGauge", striprefs = true), @Optional.Interface(modid = "AWWayofTime", iface = "WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles", striprefs = true)}) +public abstract class TDHelmet extends ArmorCore implements IRevealer, IGoggles, ILPGauge, IAlchemyGoggles +{ + + public TDHelmet(int baseProtection, int slot) + { + super(baseProtection, slot); + } + + @Override + @Optional.Method(modid = "Thaumcraft") + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + { + return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); + } + + @Override + @Optional.Method(modid = "Thaumcraft") + public boolean showNodes(ItemStack itemstack, EntityLivingBase player) + { + return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); + } + + @Override + @Optional.Method(modid = "AWWayofTime") + public boolean canSeeLPBar(ItemStack stack) + { + return stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Divination"); + } + + @Override + @Optional.Method(modid = "AWWayofTime") + public boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player) + { + return stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Divination"); + } +} diff --git a/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java b/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java index 0b1c18d..04770c4 100644 --- a/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java +++ b/src/main/java/lance5057/tDefense/armor/blocks/UnstableItemBlock.java @@ -1,6 +1,6 @@ package lance5057.tDefense.armor.blocks; -import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.TDArmorAddon; import net.minecraft.block.Block; import net.minecraft.item.ItemBlockWithMetadata; import net.minecraft.item.ItemStack; @@ -16,6 +16,6 @@ public class UnstableItemBlock extends ItemBlockWithMetadata @Override public String getUnlocalizedName(ItemStack stack) { - return this.getUnlocalizedName() + "_" + ((UnstableBlock) TinkersDefense.block_Unstable).types[stack.getItemDamage()]; + return this.getUnlocalizedName() + "_" + ((UnstableBlock) TDArmorAddon.block_Unstable).types[stack.getItemDamage()]; } } diff --git a/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java b/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java index 90a3088..a548922 100644 --- a/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java +++ b/src/main/java/lance5057/tDefense/armor/events/ArmorModEvents.java @@ -1,5 +1,6 @@ package lance5057.tDefense.armor.events; +import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.items.cloth.TinkersRobe; import lance5057.tDefense.armor.items.heavy.TinkersGrieves; @@ -59,8 +60,8 @@ public class ArmorModEvents float adjustedPerc = (float) (1f - (epf * 0.04)); event.ammount = adjustedPerc * event.ammount; - - if(event.entityLiving instanceof EntityPlayer) + + if(TinkersDefense.config.debug && event.entityLiving instanceof EntityPlayer) { ((EntityPlayer) event.entityLiving).addChatComponentMessage(new ChatComponentText(event.source.getDamageType() + " - Adjusted: " + Double.toString(event.ammount))); } diff --git a/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java b/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java index 99eedbe..adaf76a 100644 --- a/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java +++ b/src/main/java/lance5057/tDefense/armor/events/ArmorRenderEvent.java @@ -2,6 +2,7 @@ package lance5057.tDefense.armor.events; import tconstruct.armor.ArmorProxyClient; import tconstruct.armor.player.ArmorExtended; +import tconstruct.library.tools.ToolCore; import lance5057.tDefense.armor.ArmorCore; import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.player.EntityPlayer; @@ -26,7 +27,7 @@ public class ArmorRenderEvent ItemStack Armor = event.entityPlayer.inventory.armorItemInSlot(event.slot); - if(Armor != null) + if(Armor != null && Armor.getItem() instanceof ArmorCore) { ModelBiped armorModel = Armor.getItem().getArmorModel(event.entityLiving, Armor, event.slot); @@ -35,7 +36,7 @@ public class ArmorRenderEvent ItemStack Accessory = armorEx.getStackInSlot(event.slot); - if(Accessory != null) + if(Accessory != null && Accessory.getItem() instanceof ToolCore) { ModelBiped accessoryModel = Accessory.getItem().getArmorModel(event.entityLiving, Accessory, event.slot); diff --git a/src/main/java/lance5057/tDefense/armor/items/Mask.java b/src/main/java/lance5057/tDefense/armor/items/Mask.java deleted file mode 100644 index c9557a0..0000000 --- a/src/main/java/lance5057/tDefense/armor/items/Mask.java +++ /dev/null @@ -1,116 +0,0 @@ -package lance5057.tDefense.armor.items; - -import lance5057.tDefense.armor.renderers.ModelSheath; -import lance5057.tDefense.armor.renderers.ModelMask; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import tconstruct.library.accessory.IAccessory; -import tconstruct.library.accessory.IAccessoryModel; -import tconstruct.library.tools.ToolCore; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class Mask extends ToolCore implements IAccessoryModel, IAccessory -{ - - public Mask() - { - super(0); - } - - @Override - public boolean canEquipAccessory(ItemStack item, int slot) - { - return slot == 0; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String color[] = new String[10]; - - for(int i = 0; i < 10; i++) - color[i] = Integer.toHexString(this.getColorFromItemStack(itemStack, i)); - - return new ModelMask(color); - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) - { - return "tinkersdefense:textures/armor/Mask/_mask_face.png"; - } - - ResourceLocation texture = new ResourceLocation("tinkersdefense", "textures/armor/Mask/_mask_face.png"); - - @Override - @SideOnly(Side.CLIENT) - public ResourceLocation getWearbleTexture(Entity entity, ItemStack stack, int slot) - { - return texture; - } - - @Override - public Item getAccessoryItem() - { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getDefaultFolder() - { - // TODO Auto-generated method stub - return "Armor/Mask"; - } - - @Override - public String getEffectSuffix() - { - return "_mask_effect"; - } - - @Override - public Item getHeadItem() - { - // TODO Auto-generated method stub - return null; - } - - @SideOnly(Side.CLIENT) - @Override - public int getPartAmount() - { - return 3; - } - - @Override - public String getIconSuffix(int partType) - { - switch(partType) - { - case 0: - return "_mask_face"; - case 1: - return "hurdur"; //useless - case 2: - return "_mask_clasp"; - case 3: - return "_mask_strap"; - default: - return ""; - } - } - - @Override - public String[] getTraits() - { - return new String[] {"mask", "cosmetic"}; - } - -} diff --git a/src/main/java/lance5057/tDefense/armor/items/Sheath.java b/src/main/java/lance5057/tDefense/armor/items/Sheath.java index e9db2db..ca4b44e 100644 --- a/src/main/java/lance5057/tDefense/armor/items/Sheath.java +++ b/src/main/java/lance5057/tDefense/armor/items/Sheath.java @@ -2,13 +2,10 @@ package lance5057.tDefense.armor.items; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import tconstruct.library.TConstructRegistry; import tconstruct.library.accessory.IAccessory; import tconstruct.tools.TinkerTools; import cpw.mods.fml.relauncher.Side; @@ -19,7 +16,7 @@ public class Sheath extends ArmorCore implements IAccessory public Sheath() { - super(0,-1); + super(0, -1); } @Override @@ -28,25 +25,6 @@ public class Sheath extends ArmorCore implements IAccessory return slot == 3; } - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int HandleID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderExtra"); - - color[3] = Integer.toHexString(TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class).color); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(4), this.getIconSuffix(3)}; - - ClientProxy.sheath.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.sheath; - } - @Override public Item getHeadItem() { @@ -61,16 +39,16 @@ public class Sheath extends ArmorCore implements IAccessory @Override public Item getAccessoryItem() - { - return TinkersDefense.partClasp; - } - - @Override - public Item getExtraItem() { return TinkersDefense.partCloth; } + // @Override + // public Item getExtraItem() + // { + // return TinkersDefense.partCloth; + // } + @Override public String getDefaultFolder() { @@ -88,7 +66,7 @@ public class Sheath extends ArmorCore implements IAccessory @Override public int getPartAmount() { - return 4; + return 3; } @Override @@ -97,15 +75,15 @@ public class Sheath extends ArmorCore implements IAccessory switch(partType) { case 0: - return "_sheath_base"; + return "_tabard_cloth"; case 1: return "_shield_base_broken"; //useless case 2: - return "_sheath_filigree"; + return "_tabard_trim"; case 3: - return "_sheath_belt"; - case 4: - return "_sheath_clasp"; + return "_tabard_filigree"; + // case 4: + // return "_sheath_clasp"; default: return ""; } @@ -117,4 +95,11 @@ public class Sheath extends ArmorCore implements IAccessory return new String[] {"sheath", "cosmetic"}; } + @Override + public ArmorRenderer getRenderer() + { + // TODO Auto-generated method stub + return ClientProxy.sheath; + } + } diff --git a/src/main/java/lance5057/tDefense/armor/items/TinkersGauntlets.java b/src/main/java/lance5057/tDefense/armor/items/TinkersGauntlets.java new file mode 100644 index 0000000..91f10f1 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/items/TinkersGauntlets.java @@ -0,0 +1,130 @@ +package lance5057.tDefense.armor.items; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import lance5057.tDefense.proxy.ClientProxy; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import tconstruct.library.accessory.IAccessory; +import tconstruct.tools.TinkerTools; + +public class TinkersGauntlets extends ArmorCore implements IAccessory +{ + public TinkersGauntlets() + { + super(0, -1); + setUnlocalizedName("tinkersgauntlets"); + } + + @Override + public boolean canEquipAccessory(ItemStack item, int slot) + { + return slot == 1; + } + + @Override + public Item getHeadItem() + { + return TinkersDefense.partArmorplate; + } + + @Override + public Item getHandleItem() + { + return TinkerTools.toughRod; + } + + @Override + public Item getAccessoryItem() + { + return TinkersDefense.partRivet; + } + + @Override + public int durabilityTypeAccessory() + { + return 2; + } + + @Override + public float getRepairCost() + { + return 1.0f; + } + + @Override + public float getDurabilityModifier() + { + return 2.5f; + } + + @Override + public float getDamageModifier() + { + return 0f; + } + + @Override + public int getPartAmount() + { + return 3; + } + + @Override + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_gauntlet_plate"; + case 1: + return "_gauntlet_plate_broken"; + case 2: + return "_gauntlet_trim"; + case 3: + return "_gauntlet_rivet"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix() + { + return "_gauntlet_effect"; + } + + @Override + public String getDefaultFolder() + { + return "armor/gauntlets"; + } + + // @Override + // public void onUpdate(ItemStack stack, World world, Entity entity, int + // par4, + // boolean par5) { + // super.onUpdate(stack, world, entity, par4, par5); + // + // } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + return "tinkersdefense:textures/armor/Tinkersgauntlet.png"; + } + + @Override + public String[] getTraits() + { + return new String[] {"hands", "gauntlet"}; + } + + @Override + public ArmorRenderer getRenderer() + { + return ClientProxy.gauntlets; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java index aba5909..ec775a2 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersHood.java @@ -1,35 +1,26 @@ package lance5057.tDefense.armor.items.cloth; import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; +import lance5057.tDefense.armor.TDHelmet; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; -import thaumcraft.api.IGoggles; +import tconstruct.tools.TinkerTools; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.nodes.IRevealer; +import vazkii.botania.api.mana.IManaDiscountArmor; import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true), - @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true)}) -public class TinkersHood extends ArmorCore implements IRevealer, IGoggles, IVisDiscountGear +@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) +public class TinkersHood extends TDHelmet implements IVisDiscountGear, IManaDiscountArmor { public TinkersHood() { super(0, 0); - this.setUnlocalizedName("tinkershood"); + setUnlocalizedName("tinkershood"); } @Override @@ -41,13 +32,13 @@ public class TinkersHood extends ArmorCore implements IRevealer, IGoggles, IVisD @Override public Item getHandleItem() { - return TinkersDefense.partCloth; + return TinkerTools.toolRod; } @Override public Item getAccessoryItem() { - return TinkersDefense.partRivet; + return TinkersDefense.partCloth; } @Override @@ -90,9 +81,9 @@ public class TinkersHood extends ArmorCore implements IRevealer, IGoggles, IVisD case 1: return "_hood_cloth_broken"; case 2: - return "_hood_trim"; + return "_hood_metal"; case 3: - return "_hood_rivet"; + return "_hood_trim"; default: return ""; } @@ -129,29 +120,6 @@ public class TinkersHood extends ArmorCore implements IRevealer, IGoggles, IVisD return new String[] {"armor", "head", "hood", "cloth"}; } - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int HeadID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHead"); - int HandleID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); - color[1] = Integer.toHexString(newColor.color); - - newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); - color[0] = Integer.toHexString(newColor.color); - - ClientProxy.hood.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.hood; - } - @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { @@ -160,22 +128,21 @@ public class TinkersHood extends ArmorCore implements IRevealer, IGoggles, IVisD @Override @Optional.Method(modid = "Thaumcraft") - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); + return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); } @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) + public ArmorRenderer getRenderer() { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); + return ClientProxy.hood; } @Override - @Optional.Method(modid = "Thaumcraft") - public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) { - return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Vis Embroidery"); + final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; + return i; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java index 311d971..28027cd 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersRobe.java @@ -1,32 +1,25 @@ package lance5057.tDefense.armor.items.cloth; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; -import thaumcraft.api.IVisDiscountGear; -import thaumcraft.api.aspects.Aspect; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersRobe; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import thaumcraft.api.IVisDiscountGear; +import thaumcraft.api.aspects.Aspect; +import vazkii.botania.api.mana.IManaDiscountArmor; +import cpw.mods.fml.common.Optional; -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true)}) -public class TinkersRobe extends ArmorCore implements IVisDiscountGear +@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) +public class TinkersRobe extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor { public TinkersRobe() { super(0, 2); - this.setUnlocalizedName("tinkerrobe"); + setUnlocalizedName("tinkerrobe"); } @Override @@ -37,6 +30,12 @@ public class TinkersRobe extends ArmorCore implements IVisDiscountGear @Override public Item getHandleItem() + { + return TinkersDefense.partClasp; + } + + @Override + public Item getAccessoryItem() { return TinkersDefense.partCloth; } @@ -68,7 +67,7 @@ public class TinkersRobe extends ArmorCore implements IVisDiscountGear @Override public int getPartAmount() { - return 2; + return 3; } @Override @@ -81,6 +80,8 @@ public class TinkersRobe extends ArmorCore implements IVisDiscountGear case 1: return "_robe_cloth_broken"; case 2: + return "_robe_metal"; + case 3: return "_robe_trim"; default: return ""; @@ -119,38 +120,29 @@ public class TinkersRobe extends ArmorCore implements IVisDiscountGear } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - String[] color = new String[10]; - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int HeadID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHead"); - int HandleID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); - color[1] = Integer.toHexString(newColor.color); - - newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); - color[0] = Integer.toHexString(newColor.color); + return 0; + } - ClientProxy.robe.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.robe; + @Override + @Optional.Method(modid = "Thaumcraft") + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + { + final int vis = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); + return vis; } @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public ArmorRenderer getRenderer() { - return 0; + return ClientProxy.robe; } @Override - @Optional.Method(modid = "Thaumcraft") - public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) { - return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Vis Embroidery"); + final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; + return i; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java index 4fa23d0..8df9b42 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShawl.java @@ -1,34 +1,25 @@ package lance5057.tDefense.armor.items.cloth; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersShawl; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; -import tconstruct.tools.TinkerTools; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.aspects.Aspect; +import vazkii.botania.api.mana.IManaDiscountArmor; +import cpw.mods.fml.common.Optional; -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true)}) -public class TinkersShawl extends ArmorCore implements IVisDiscountGear +@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) +public class TinkersShawl extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor { public TinkersShawl() { super(0, 1); - this.setUnlocalizedName("tinkersshawl"); + setUnlocalizedName("tinkersshawl"); } @Override @@ -40,13 +31,14 @@ public class TinkersShawl extends ArmorCore implements IVisDiscountGear @Override public Item getHandleItem() { - return TinkersDefense.partCloth; + return TinkersDefense.partArmorplate; } @Override public Item getAccessoryItem() { - return TinkersDefense.partClasp; + return TinkersDefense.partCloth; + } @Override @@ -89,9 +81,9 @@ public class TinkersShawl extends ArmorCore implements IVisDiscountGear case 1: return "_shawl_cloth_broken"; case 2: - return "_shawl_trim"; + return "_shawl_metal"; case 3: - return "_shawl_clasp"; + return "_shawl_trim"; default: return ""; } @@ -128,29 +120,6 @@ public class TinkersShawl extends ArmorCore implements IVisDiscountGear return new String[] {"armor", "chest", "shawl", "cloth"}; } - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int HeadID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHead"); - int HandleID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); - color[1] = Integer.toHexString(newColor.color); - - newColor = TConstructRegistry.getCustomMaterial(HandleID, ClothMaterial.class); - color[0] = Integer.toHexString(newColor.color); - - ClientProxy.shawl.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.shawl; - } - @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { @@ -161,7 +130,21 @@ public class TinkersShawl extends ArmorCore implements IVisDiscountGear @Optional.Method(modid = "Thaumcraft") public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) { - int test = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); + final int test = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); return test; } + + @Override + public ArmorRenderer getRenderer() + { + // TODO Auto-generated method stub + return ClientProxy.shawl; + } + + @Override + public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) + { + final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; + return i; + } } diff --git a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java index 95e6840..8f4f795 100644 --- a/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java +++ b/src/main/java/lance5057/tDefense/armor/items/cloth/TinkersShoes.java @@ -1,32 +1,25 @@ package lance5057.tDefense.armor.items.cloth; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.light.ModelTinkersBoots; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.aspects.Aspect; +import vazkii.botania.api.mana.IManaDiscountArmor; +import cpw.mods.fml.common.Optional; -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true)}) -public class TinkersShoes extends ArmorCore implements IVisDiscountGear +@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IVisDiscountGear", striprefs = true), @Optional.Interface(modid = "Botania", iface = "vazkii.botania.api.mana.IManaDiscountArmor", striprefs = true)}) +public class TinkersShoes extends ArmorCore implements IVisDiscountGear, IManaDiscountArmor { public TinkersShoes() { super(0, 3); - this.setUnlocalizedName("tinkersshoes"); + setUnlocalizedName("tinkersshoes"); } @Override @@ -38,13 +31,13 @@ public class TinkersShoes extends ArmorCore implements IVisDiscountGear @Override public Item getHandleItem() { - return TinkersDefense.partClasp; + return TinkersDefense.partRivet; } @Override public Item getAccessoryItem() { - return TinkersDefense.partRivet; + return TinkersDefense.partCloth; } @Override @@ -87,9 +80,9 @@ public class TinkersShoes extends ArmorCore implements IVisDiscountGear case 1: return "_shoes_cloth_broken"; case 2: - return "_shoes_clasp"; + return "_shoes_metal"; case 3: - return "_shoes_rivet"; + return "_shoes_sole"; default: return ""; } @@ -127,34 +120,28 @@ public class TinkersShoes extends ArmorCore implements IVisDiscountGear } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - String[] color = new String[10]; - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int HeadID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHead"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(HeadID, ClothMaterial.class); - color[1] = Integer.toHexString(newColor.color); + return 0; + } - ClientProxy.shoes.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.shoes; + @Override + @Optional.Method(modid = "Thaumcraft") + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + { + return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("VisEmbroidery"); } @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public ArmorRenderer getRenderer() { - return 0; + return ClientProxy.shoes; } @Override - @Optional.Method(modid = "Thaumcraft") - public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) + public float getDiscount(ItemStack stack, int arg1, EntityPlayer arg2) { - return stack.getTagCompound().getCompoundTag("InfiTool").getInteger("Vis Embroidery"); + final float i = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("ManaEmbroidery") / 100f; + return i; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java index e378619..fa1c2e5 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersBreastplate.java @@ -1,22 +1,12 @@ package lance5057.tDefense.armor.items.heavy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersBreastplate; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.tools.TinkerTools; public class TinkersBreastplate extends ArmorCore @@ -24,8 +14,8 @@ public class TinkersBreastplate extends ArmorCore public TinkersBreastplate() { super(2, 1); - this.setUnlocalizedName("tinkersbreastplate"); - this.maxReduction = 100; + setUnlocalizedName("tinkersbreastplate"); + maxReduction = 100; reductionPercent = 8 * 0.04f; } @@ -115,14 +105,6 @@ public class TinkersBreastplate extends ArmorCore return "armor/breastplate"; } - // @Override - // public void onUpdate(ItemStack stack, World world, Entity entity, int - // par4, - // boolean par5) { - // super.onUpdate(stack, world, entity, par4, par5); - // - // } - @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { @@ -136,16 +118,8 @@ public class TinkersBreastplate extends ArmorCore } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public ArmorRenderer getRenderer() { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; - ClientProxy.breastplate.SetColors(color, this.getDefaultFolder(), itemStack); return ClientProxy.breastplate; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGauntlets.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGauntlets.java deleted file mode 100644 index 312d200..0000000 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGauntlets.java +++ /dev/null @@ -1,148 +0,0 @@ -package lance5057.tDefense.armor.items.heavy; - -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import tconstruct.library.accessory.IAccessory; -import tconstruct.library.accessory.IAccessoryModel; -import tconstruct.library.tools.ToolCore; -import tconstruct.tools.TinkerTools; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TinkersGauntlets extends ArmorCore implements IAccessory -{ - public TinkersGauntlets() - { - super(0,-1); - this.setUnlocalizedName("tinkersgauntlets"); - } - - @Override - public boolean canEquipAccessory(ItemStack item, int slot) - { - return slot == 1; - } - - @Override - public Item getHeadItem() - { - return TinkersDefense.partArmorplate; - } - - @Override - public Item getHandleItem() - { - return TinkerTools.toughRod; - } - - @Override - public Item getAccessoryItem() - { - return TinkersDefense.partRivet; - } - - @Override - public int durabilityTypeAccessory() - { - return 2; - } - - @Override - public float getRepairCost() - { - return 1.0f; - } - - @Override - public float getDurabilityModifier() - { - return 2.5f; - } - - @Override - public float getDamageModifier() - { - return 0f; - } - - @Override - public int getPartAmount() - { - return 3; - } - - @Override - public String getIconSuffix(int partType) - { - switch(partType) - { - case 0: - return "_gauntlet_plate"; - case 1: - return "_gauntlet_plate_broken"; - case 2: - return "_gauntlet_trim"; - case 3: - return "_gauntlet_rivet"; - default: - return ""; - } - } - - @Override - public String getEffectSuffix() - { - return "_gauntlet_effect"; - } - - @Override - public String getDefaultFolder() - { - return "armor/gauntlets"; - } - - // @Override - // public void onUpdate(ItemStack stack, World world, Entity entity, int - // par4, - // boolean par5) { - // super.onUpdate(stack, world, entity, par4, par5); - // - // } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) - { - return "tinkersdefense:textures/armor/Tinkersgauntlet.png"; - } - - @Override - public String[] getTraits() - { - return new String[] {"hands", "gauntlet"}; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - - ClientProxy.gauntlets.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.gauntlets; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java index 6bfb8d1..7bfa98c 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersGrieves.java @@ -1,21 +1,12 @@ package lance5057.tDefense.armor.items.heavy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGrieves; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.ISpecialArmor.ArmorProperties; import tconstruct.tools.TinkerTools; public class TinkersGrieves extends ArmorCore @@ -23,8 +14,8 @@ public class TinkersGrieves extends ArmorCore public TinkersGrieves() { super(2, 2); - this.setUnlocalizedName("tinkergrieves"); - this.maxReduction = 100; + setUnlocalizedName("tinkergrieves"); + maxReduction = 100; reductionPercent = 6 * 0.04f; } @@ -49,7 +40,7 @@ public class TinkersGrieves extends ArmorCore @Override public Item getExtraItem() { - return TinkersDefense.partArmorplate; + return TinkersDefense.partCloth; } @Override @@ -96,7 +87,7 @@ public class TinkersGrieves extends ArmorCore case 3: return "_grieves_chain"; case 4: - return "_grieves_cod"; + return "_grieves_cloth"; default: return ""; } @@ -134,16 +125,8 @@ public class TinkersGrieves extends ArmorCore } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public ArmorRenderer getRenderer() { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; - ClientProxy.grieves.SetColors(color, this.getDefaultFolder(), itemStack); return ClientProxy.grieves; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java index 135e948..143cab0 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersHelm.java @@ -1,28 +1,21 @@ package lance5057.tDefense.armor.items.heavy; import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.TDHelmet; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tconstruct.tools.TinkerTools; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true)}) -public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles + +public class TinkersHelm extends TDHelmet { public TinkersHelm() { super(2, 0); - this.setUnlocalizedName("tinkershelm"); - this.maxReduction = 100; + setUnlocalizedName("tinkershelm"); + maxReduction = 100; reductionPercent = 3 * 0.04f; } @@ -35,7 +28,7 @@ public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles @Override public Item getHandleItem() { - return TinkerTools.toughRod; + return TinkersDefense.partChainmaille; } @Override @@ -44,6 +37,12 @@ public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles return TinkersDefense.partArmorplate; } + @Override + public Item getExtraItem() + { + return TinkerTools.toughRod; + } + @Override public int durabilityTypeAccessory() { @@ -71,7 +70,7 @@ public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles @Override public int getPartAmount() { - return 3; + return 4; } @Override @@ -84,9 +83,11 @@ public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles case 1: return "_helm_top_broken"; case 2: - return "_helm_visor"; - case 3: return "_helm_chain"; + case 3: + return "_helm_plate"; + case 4: + return "_helm_visor"; default: return ""; } @@ -124,30 +125,8 @@ public class TinkersHelm extends ArmorCore implements IRevealer, IGoggles } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public ArmorRenderer getRenderer() { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; - ClientProxy.helm.SetColors(color, this.getDefaultFolder(), itemStack); return ClientProxy.helm; } - - @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) - { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); - } - - @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) - { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); - } } diff --git a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java index 64447b2..35a3348 100644 --- a/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java +++ b/src/main/java/lance5057/tDefense/armor/items/heavy/TinkersSabatons.java @@ -1,24 +1,12 @@ package lance5057.tDefense.armor.items.heavy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersSabatons; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.DamageSource; -import net.minecraftforge.common.ISpecialArmor.ArmorProperties; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; public class TinkersSabatons extends ArmorCore @@ -26,8 +14,8 @@ public class TinkersSabatons extends ArmorCore public TinkersSabatons() { super(2, 3); - this.setUnlocalizedName("tinkersabatons"); - this.maxReduction = 100; + setUnlocalizedName("tinkersabatons"); + maxReduction = 100; reductionPercent = 3 * 0.04f; } @@ -137,21 +125,8 @@ public class TinkersSabatons extends ArmorCore } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public ArmorRenderer getRenderer() { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int ExtraID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderExtra"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(ExtraID, ClothMaterial.class); - color[3] = Integer.toHexString(newColor.color); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3), this.getIconSuffix(4)}; - ClientProxy.sabatons.SetColors(color, this.getDefaultFolder(), itemStack); return ClientProxy.sabatons; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java index ce81f83..f84bc3e 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersBoots.java @@ -1,33 +1,22 @@ package lance5057.tDefense.armor.items.light; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.cloth.ModelTinkersHood; -import lance5057.tDefense.armor.renderers.light.ModelTinkersBoots; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraftforge.common.ISpecialArmor.ArmorProperties; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; public class TinkersBoots extends ArmorCore { public TinkersBoots() { super(1, 3); - this.setUnlocalizedName("tinkersboots"); - this.maxReduction = 100; - this.reductionPercent = 0.08f; + setUnlocalizedName("tinkersboots"); + maxReduction = 100; + reductionPercent = 0.08f; } @Override @@ -128,27 +117,14 @@ public class TinkersBoots extends ArmorCore } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int AccessoryID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(AccessoryID, ClothMaterial.class); - color[0] = Integer.toHexString(newColor.color); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - ClientProxy.boots.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.boots; + return 2; } @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public ArmorRenderer getRenderer() { - return 2; + return ClientProxy.boots; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java index 852f95f..a088f54 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersChausses.java @@ -1,32 +1,24 @@ package lance5057.tDefense.armor.items.light; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; -import lance5057.tDefense.armor.renderers.light.ModelTinkersChausses; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; -import net.minecraftforge.common.ISpecialArmor.ArmorProperties; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; public class TinkersChausses extends ArmorCore { public TinkersChausses() { super(1, 2); - this.setUnlocalizedName("tinkerschausses"); - this.maxReduction = 100; - this.reductionPercent = 0.2f; + setUnlocalizedName("tinkerschausses"); + maxReduction = 100; + reductionPercent = 0.2f; } @Override @@ -41,6 +33,12 @@ public class TinkersChausses extends ArmorCore return TinkersDefense.partArmorplate; } + @Override + public Item getAccessoryItem() + { + return TinkersDefense.partCloth; + } + @Override public int durabilityTypeAccessory() { @@ -68,7 +66,7 @@ public class TinkersChausses extends ArmorCore @Override public int getPartAmount() { - return 2; + return 3; } @Override @@ -82,6 +80,8 @@ public class TinkersChausses extends ArmorCore return "_chausses_chain_broken"; case 2: return "_chausses_plate"; + case 3: + return "_chausses_cloth"; default: return ""; } @@ -118,20 +118,6 @@ public class TinkersChausses extends ArmorCore return new String[] {"armor", "pants", "chausses", "lightarmor"}; } - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0)}; - ClientProxy.chausses.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.chausses; - } - @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { @@ -141,8 +127,14 @@ public class TinkersChausses extends ArmorCore @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - ArmorProperties armorp = new ArmorProperties(0, 0.2, 100); //0.04 per half shirt + final ArmorProperties armorp = new ArmorProperties(0, 0.2, 100); //0.04 per half shirt //((EntityPlayer)player).addChatComponentMessage(new ChatComponentText(Double.toString(damage))); return armorp; } + + @Override + public ArmorRenderer getRenderer() + { + return ClientProxy.chausses; + } } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java index ba0db3d..71b0199 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersCoif.java @@ -1,34 +1,25 @@ package lance5057.tDefense.armor.items.light; import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.parts.ClothMaterial; +import lance5057.tDefense.armor.TDHelmet; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.tools.CustomMaterial; import tconstruct.tools.TinkerTools; -import thaumcraft.api.IGoggles; -import thaumcraft.api.nodes.IRevealer; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@Optional.InterfaceList({@Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.IGoggles", striprefs = true), @Optional.Interface(modid = "Thaumcraft", iface = "thaumcraft.api.nodes.IRevealer", striprefs = true)}) -public class TinkersCoif extends ArmorCore implements IRevealer, IGoggles + +public class TinkersCoif extends TDHelmet { public TinkersCoif() { super(1, 0); - this.setUnlocalizedName("tinkerscoif"); - this.maxReduction = 100; - this.reductionPercent = 0.08f; + setUnlocalizedName("tinkerscoif"); + maxReduction = 100; + reductionPercent = 0.08f; } @Override @@ -128,25 +119,6 @@ public class TinkersCoif extends ArmorCore implements IRevealer, IGoggles return new String[] {"armor", "head", "coif", "lightarmor"}; } - @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) - { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - int AccessoryID = itemStack.getTagCompound().getCompoundTag("InfiTool").getInteger("RenderHandle"); - - CustomMaterial newColor = TConstructRegistry.getCustomMaterial(AccessoryID, ClothMaterial.class); - color[0] = Integer.toHexString(newColor.color); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - ClientProxy.coif.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.coif; - } - @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { @@ -156,22 +128,15 @@ public class TinkersCoif extends ArmorCore implements IRevealer, IGoggles @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - ArmorProperties armorp = new ArmorProperties(0, 0.08, 100); //0.04 per half shirt + final ArmorProperties armorp = new ArmorProperties(0, 0.08, 100); //0.04 per half shirt //((EntityPlayer)player).addChatComponentMessage(new ChatComponentText(Double.toString(damage))); return armorp; } @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) + public ArmorRenderer getRenderer() { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); - } - - @Override - @Optional.Method(modid = "Thaumcraft") - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) - { - return itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Revealing"); + // TODO Auto-generated method stub + return ClientProxy.coif; } } diff --git a/src/main/java/lance5057/tDefense/armor/items/light/TinkersHauberk.java b/src/main/java/lance5057/tDefense/armor/items/light/TinkersHauberk.java index 9e071a7..490e649 100644 --- a/src/main/java/lance5057/tDefense/armor/items/light/TinkersHauberk.java +++ b/src/main/java/lance5057/tDefense/armor/items/light/TinkersHauberk.java @@ -2,24 +2,22 @@ package lance5057.tDefense.armor.items.light; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.proxy.ClientProxy; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import tconstruct.tools.TinkerTools; public class TinkersHauberk extends ArmorCore { public TinkersHauberk() { super(1, 1); - this.setUnlocalizedName("tinkershauberk"); - this.maxReduction = 100; - this.reductionPercent = 0.24f; + setUnlocalizedName("tinkershauberk"); + maxReduction = 100; + reductionPercent = 0.24f; } @Override @@ -31,13 +29,13 @@ public class TinkersHauberk extends ArmorCore @Override public Item getHandleItem() { - return TinkersDefense.partArmorplate; + return TinkerTools.largePlate; } @Override public Item getAccessoryItem() { - return TinkersDefense.partRivet; + return TinkersDefense.partCloth; } @Override @@ -82,7 +80,7 @@ public class TinkersHauberk extends ArmorCore case 2: return "_hauberk_plate"; case 3: - return "_hauberk_rivet"; + return "_hauberk_cloth"; default: return ""; } @@ -120,22 +118,14 @@ public class TinkersHauberk extends ArmorCore } @Override - @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - String[] color = new String[10]; - - for(int j = 0; j < 10; j++) - color[j] = Integer.toHexString(itemStack.getItem().getColorFromItemStack(itemStack, j)); - - //String[] textures = {this.getIconSuffix(2), this.getIconSuffix(0), this.getIconSuffix(3)}; - ClientProxy.hauberk.SetColors(color, this.getDefaultFolder(), itemStack); - return ClientProxy.hauberk; + return 6; } @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) + public ArmorRenderer getRenderer() { - return 6; + return ClientProxy.hauberk; } } diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java b/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java index de0fc88..bbd6ad3 100644 --- a/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java +++ b/src/main/java/lance5057/tDefense/armor/modifiers/ArmorMods.java @@ -1,13 +1,18 @@ package lance5057.tDefense.armor.modifiers; -import lance5057.tDefense.Reference; import lance5057.tDefense.TDIntegration; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.TDArmorAddon; import lance5057.tDefense.armor.items.cloth.TinkersRobe; import lance5057.tDefense.armor.items.heavy.TinkersGrieves; import lance5057.tDefense.armor.items.light.TinkersChausses; +import lance5057.tDefense.armor.modifiers.BloodMagic.BloodArmorMods; +import lance5057.tDefense.armor.modifiers.Botania.BotaniaArmorMods; import lance5057.tDefense.armor.modifiers.Thaumcraft.ThaumArmorMods; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifierIntExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; @@ -22,7 +27,6 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import tconstruct.library.TConstructRegistry; import tconstruct.library.client.TConstructClientRegistry; @@ -34,111 +38,179 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.registry.GameRegistry; -public class ArmorMods +public class ArmorMods extends ModifiersBase { - ThaumArmorMods tcmods; - - Item item_Canister; - Item item_Emptycanister; - Item item_Rebreather; - Item item_NightvisionGoggles; - - Item item_Glowsole; - Item item_Firesole; - Item item_Icesole; - Item item_Feathersole; - Item item_Flippers; + ThaumArmorMods tcmods; + BotaniaArmorMods botmods; + BloodArmorMods bloodmods; + + // Item item_Canister; + // Item item_Emptycanister; + // Item item_Rebreather; + // Item item_NightvisionGoggles; + // + // Item item_Glowsole; + // Item item_Firesole; + // Item item_Icesole; + // Item item_Feathersole; + // Item item_Flippers; public ArmorMods() { + super(new String[] {"Canister", "EmptyCanister", "Rebreather", "NightvisionGoggles", "Glowstep", "Firewalker", "Frostwalker", "FeatherFall", "Flippers"}, "modItemsArmor"); FMLCommonHandler.instance().bus().register(this); - MinecraftForge.EVENT_BUS.register(this); - - LoadItems(); - } - - public void LoadItems() - { - //Head - item_Canister = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(10).setUnlocalizedName("FilledCart").setTextureName(Reference.MOD_ID + ":FilledCart"); - item_Emptycanister = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(10).setUnlocalizedName("EmptyCart").setTextureName(Reference.MOD_ID + ":EmptyCart"); - item_Rebreather = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("Rebreather").setTextureName(Reference.MOD_ID + ":Rebreather"); - item_NightvisionGoggles = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("NightvisionGoggles").setTextureName(Reference.MOD_ID + ":NightvisionGoggles"); - - //Feet - item_Feathersole = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("FeatherSole").setTextureName(Reference.MOD_ID + ":FeatherSole"); - item_Firesole = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("FireSole").setTextureName(Reference.MOD_ID + ":FireSole"); - item_Icesole = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("IceSole").setTextureName(Reference.MOD_ID + ":IceSole"); - item_Glowsole = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("GlowSole").setTextureName(Reference.MOD_ID + ":GlowSole"); - item_Flippers = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("Flippers").setTextureName(Reference.MOD_ID + ":Flippers"); - - GameRegistry.registerItem(item_Canister, "FilledCart"); - GameRegistry.registerItem(item_Emptycanister, "EmptyCart"); - GameRegistry.registerItem(item_Rebreather, "Rebreather"); - GameRegistry.registerItem(item_NightvisionGoggles, "NightvisionGoggles"); - - GameRegistry.registerItem(item_Feathersole, "FeatherSole"); - GameRegistry.registerItem(item_Firesole, "FireSole"); - GameRegistry.registerItem(item_Icesole, "IceSole"); - GameRegistry.registerItem(item_Glowsole, "GlowSole"); - GameRegistry.registerItem(item_Flippers, "Flippers"); if(TDIntegration.thaumcraft) { tcmods = new ThaumArmorMods(); - tcmods.LoadItems(); } - + if(TDIntegration.botania) + { + botmods = new BotaniaArmorMods(); + } + if(TDIntegration.bloodMagic) + { + bloodmods = new BloodArmorMods(); + } } + @Override public void RegisterRecipes() { - GameRegistry.addShapedRecipe(new ItemStack(item_Canister), new Object[] {"-c-", "ses", "-s-", 'c', new ItemStack(Items.coal, 1, 1), 's', new ItemStack(Blocks.sapling, 1), 'e', new ItemStack(item_Emptycanister, 1, 0)}); - GameRegistry.addShapedRecipe(new ItemStack(item_Emptycanister), new Object[] {"gsg", "lil", "gig", 'g', new ItemStack(Items.gold_nugget, 1, 0), 's', new ItemStack(Items.slime_ball, 1, 0), 'l', new ItemStack(Items.dye, 1, 4), 'i', new ItemStack(Items.iron_ingot, 1, 0)}); - GameRegistry.addShapedRecipe(new ItemStack(item_Rebreather), new Object[] {"-s-", "eie", "-d-", 's', new ItemStack(Items.slime_ball, 1, 0), 'e', new ItemStack(item_Emptycanister, 1, 0), 'i', new ItemStack(TinkersDefense.partArmorplate, 1, 2), 'd', new ItemStack(Items.dye, 1, 4)}); - GameRegistry.addShapedRecipe(new ItemStack(item_NightvisionGoggles), new Object[] {"-s-", "eie", "-d-", 's', new ItemStack(Items.potionitem, 1, Potion.nightVision.id), 'e', new ItemStack(Blocks.glass_pane, 1, 0), 'i', new ItemStack(Items.iron_ingot, 1, 0), 'd', new ItemStack(Items.dye, 1, 2)}); - - GameRegistry.addShapedRecipe(new ItemStack(item_Glowsole), new Object[] {"ggg", "ala", "ggg", 'g', new ItemStack(Blocks.glowstone, 1, 0), 'a', new ItemStack(Items.glowstone_dust, 1, 0), 'l', TConstructRegistry.getItemStack("lavaCrystal")}); - GameRegistry.addShapedRecipe(new ItemStack(item_Glowsole), new Object[] {"gag", "glg", "gag", 'g', new ItemStack(Blocks.glowstone, 1, 0), 'a', new ItemStack(Items.glowstone_dust, 1, 0), 'l', TConstructRegistry.getItemStack("lavaCrystal")}); - GameRegistry.addShapedRecipe(new ItemStack(item_Feathersole), new Object[] {"fgf", 'g', new ItemStack(Items.gold_nugget, 1, 0), 'f', new ItemStack(Items.feather, 1, 0)}); - GameRegistry.addShapedRecipe(new ItemStack(item_Firesole), new Object[] {"lol", "oao", "lol", 'o', new ItemStack(Blocks.obsidian, 1, 0), 'a', TConstructRegistry.getItemStack("ingotArdite"), 'l', TConstructRegistry.getItemStack("lavaCrystal")}); - GameRegistry.addShapedRecipe(new ItemStack(item_Icesole), new Object[] {"ili", "lcl", "ili", 'l', new ItemStack(Blocks.lapis_block, 1, 0), 'i', new ItemStack(Blocks.ice, 1, 0), 'c', TConstructRegistry.getItemStack("ingotCobalt")}); - GameRegistry.addShapedRecipe(new ItemStack(item_Flippers), new Object[] {"-b-", "rlr", "-s-", 'b', new ItemStack(Items.leather_boots, 1, 0), 'l', new ItemStack(Items.leather, 1, 0), 'r', new ItemStack(TinkerTools.toolRod, 1, 2), 's', new ItemStack(Items.slime_ball, 1, 0)}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 0), new Object[] {"-c-", "ses", "-s-", 'c', new ItemStack( + Items.coal, 1, 1), 's', new ItemStack(Blocks.sapling, 1), 'e', new ItemStack( + modItems, 1, 1)}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 1), new Object[] {"gsg", "lil", "gig", 'g', new ItemStack( + Items.gold_nugget, 1, 0), 's', new ItemStack(Items.slime_ball, + 1, 0), 'l', new ItemStack(Items.dye, 1, 4), 'i', new ItemStack( + Items.iron_ingot, 1, 0)}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 2), new Object[] {"-s-", "eie", "-d-", 's', new ItemStack( + Items.slime_ball, 1, 0), 'e', new ItemStack(modItems, 1, 1), 'i', new ItemStack( + TinkersDefense.partArmorplate, 1, 2), 'd', new ItemStack( + Items.dye, 1, 4)}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 3), new Object[] {"-s-", "eie", "-d-", 's', new ItemStack( + Items.potionitem, 1, 8262), 'e', new ItemStack( + Blocks.glass_pane, 1, 0), 'i', new ItemStack(Items.iron_ingot, + 1, 0), 'd', new ItemStack(Items.dye, 1, 2)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 4), new Object[] {"ggg", "ala", "ggg", 'g', new ItemStack( + Blocks.glowstone, 1, 0), 'a', new ItemStack( + Items.glowstone_dust, 1, 0), 'l', TConstructRegistry.getItemStack("lavaCrystal")}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 5), new Object[] {"lol", "oao", "lol", 'o', new ItemStack( + Blocks.obsidian, 1, 0), 'a', TConstructRegistry.getItemStack("ingotArdite"), 'l', TConstructRegistry.getItemStack("lavaCrystal")}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 7), new Object[] {"fgf", 'g', new ItemStack( + Items.gold_nugget, 1, 0), 'f', new ItemStack(Items.feather, 1, + 0)}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 6), new Object[] {"ili", "lcl", "ili", 'l', new ItemStack( + Blocks.lapis_block, 1, 0), 'i', new ItemStack(Blocks.ice, 1, 0), 'c', TConstructRegistry.getItemStack("ingotCobalt")}); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 8), new Object[] {"-b-", "rlr", "-s-", 'b', new ItemStack( + Items.leather_boots, 1, 0), 'l', new ItemStack(Items.leather, + 1, 0), 'r', new ItemStack(TinkerTools.toolRod, 1, 2), 's', new ItemStack( + Items.slime_ball, 1, 0)}); if(TDIntegration.thaumcraft) { tcmods.RegisterRecipes(); } + if(TDIntegration.botania) + { + botmods.RegisterRecipes(); + } + if(TDIntegration.bloodMagic) + { + bloodmods.RegisterRecipes(); + } } + @Override public void RegisterModifiers() { //Head only - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_Rebreather, 1, 0)}, TinkersDefense.config.ArmorRebreatherID, "Rebreather", EnumChatFormatting.GOLD.toString(), "Rebreather", new String[] {"head"}, 1, null)); - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_NightvisionGoggles, 1, 0)}, TinkersDefense.config.ArmorNightvisionID, "Nightvision", EnumChatFormatting.GREEN.toString(), "Nightvision", new String[] {"head"}, 1, null)); - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {new ItemStack(Items.ghast_tear, 1, 0)}, TinkersDefense.config.ArmorAntiBlindnessID, "AntiBlindness", 1, EnumChatFormatting.AQUA.toString(), "AntiBlindness", new String[] {"head"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 2)}, + TinkersDefense.config.ArmorRebreatherID, "Rebreather", + EnumChatFormatting.GOLD.toString(), "Rebreather", + new String[] {"head"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 3)}, + TinkersDefense.config.ArmorNightvisionID, "Nightvision", + EnumChatFormatting.GREEN.toString(), "Nightvision", + new String[] {"head"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(Items.ghast_tear, 1, 0)}, + TinkersDefense.config.ArmorAntiBlindnessID, "AntiBlindness", 1, + EnumChatFormatting.AQUA.toString(), "AntiBlindness", + new String[] {"head"}, 1, null)); //ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(Blocks.pumpkin, 1, 0)}, TinkersDefense.config.ArmorPumpkinID, "Pumpkin", EnumChatFormatting.GOLD.toString(), "Pumpkin", new String[] {"head"}, 1, null)); //Legs only - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(Blocks.sticky_piston, 1, 0)}, TinkersDefense.config.ArmorHighstepID, "Highstep", EnumChatFormatting.LIGHT_PURPLE.toString(), "Highstep", new String[] {"pants"}, 1, null)); - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {new ItemStack(Blocks.redstone_block, 1, 0)}, TinkersDefense.config.ArmorSpeedID, "Speed", 1, EnumChatFormatting.DARK_RED.toString(), "Haste", new String[] {"pants"}, 1, null)); - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {new ItemStack(Blocks.piston, 1, 0)}, TinkersDefense.config.ArmorJumpboostID, "Jump", 1, EnumChatFormatting.WHITE.toString(), "Jump Boost", new String[] {"pants"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(Blocks.sticky_piston, 1, 0)}, + TinkersDefense.config.ArmorHighstepID, "Highstep", + EnumChatFormatting.LIGHT_PURPLE.toString(), "Highstep", + new String[] {"pants"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(Blocks.redstone_block, 1, 0)}, + TinkersDefense.config.ArmorSpeedID, "Speed", 1, + EnumChatFormatting.DARK_RED.toString(), "Haste", + new String[] {"pants"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(Blocks.piston, 1, 0)}, + TinkersDefense.config.ArmorJumpboostID, "Jump", 1, + EnumChatFormatting.WHITE.toString(), "Jump Boost", + new String[] {"pants"}, 1, null)); //Excluding Cloth - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(TinkersDefense.partArmorplate, 1, 2)}, TinkersDefense.config.ArmorProtectionID, 1, EnumChatFormatting.DARK_GRAY.toString(), "Protection")); - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(Items.magma_cream, 1)}, TinkersDefense.config.ArmorFireProtectionID, 1, EnumChatFormatting.RED.toString(), "Fire Protection")); - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(Blocks.wool, 1)}, TinkersDefense.config.ArmorBlastProtectionID, 1, EnumChatFormatting.DARK_GREEN.toString(), "Blast Protection")); - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(TinkersDefense.partRivet, 1, 2)}, TinkersDefense.config.ArmorProjectileProtectionID, 1, EnumChatFormatting.GRAY.toString(), "Projectile Protection")); - ModifyBuilder.registerModifier(new modifierProtection(new ItemStack[] {new ItemStack(item_Feathersole, 1, 0)}, TinkersDefense.config.ArmorFeatherfallID, 1, EnumChatFormatting.WHITE.toString(), "Featherfall")); - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {TConstructRegistry.getItemStack("canisterRedHeart")}, TinkersDefense.config.ArmorAbsorptionID, "HealthBoost", 1, EnumChatFormatting.DARK_RED.toString(), "HealthBoost", new String[] {"heavy", "light"}, 1, null)); + ModifyBuilder.registerModifier(new modifierProtection( + new ItemStack[] {new ItemStack(TinkersDefense.partArmorplate, + 1, 2)}, TinkersDefense.config.ArmorProtectionID, 1, + EnumChatFormatting.DARK_GRAY.toString(), "Protection")); + ModifyBuilder.registerModifier(new modifierProtection( + new ItemStack[] {new ItemStack(Items.magma_cream, 1)}, + TinkersDefense.config.ArmorFireProtectionID, 1, + EnumChatFormatting.RED.toString(), "Fire Protection")); + ModifyBuilder.registerModifier(new modifierProtection( + new ItemStack[] {new ItemStack(Blocks.wool, 1)}, + TinkersDefense.config.ArmorBlastProtectionID, 1, + EnumChatFormatting.DARK_GREEN.toString(), "Blast Protection")); + ModifyBuilder.registerModifier(new modifierProtection( + new ItemStack[] {new ItemStack(TinkersDefense.partRivet, 1, 2)}, + TinkersDefense.config.ArmorProjectileProtectionID, 1, + EnumChatFormatting.GRAY.toString(), "Projectile Protection")); + ModifyBuilder.registerModifier(new modifierProtection( + new ItemStack[] {new ItemStack(modItems, 1, 7)}, + TinkersDefense.config.ArmorFeatherfallID, 1, + EnumChatFormatting.WHITE.toString(), "Featherfall")); + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {TConstructRegistry.getItemStack("canisterRedHeart")}, + TinkersDefense.config.ArmorAbsorptionID, "HealthBoost", 1, + EnumChatFormatting.DARK_RED.toString(), "HealthBoost", + new String[] {"heavy", "light"}, 1, null)); //Feet only - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_Glowsole, 1, 0)}, TinkersDefense.config.ArmorGlowstepID, "GlowStep", EnumChatFormatting.YELLOW.toString(), "GlowStep", new String[] {"feet"}, 1, null)); - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_Firesole, 1, 0)}, TinkersDefense.config.ArmorFirewalkerID, "Firewalker", EnumChatFormatting.RED.toString(), "Firewalker", new String[] {"feet"}, 1, new String[] {"Frostwalker"})); - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_Icesole, 1, 0)}, TinkersDefense.config.ArmorFrostwalkerID, "Frostwalker", EnumChatFormatting.BLUE.toString(), "Frostwalker", new String[] {"feet"}, 1, new String[] {"Firewalker"})); - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_Flippers, 1, 0)}, TinkersDefense.config.ArmorDepthstriderID, "Depthstrider", EnumChatFormatting.DARK_BLUE.toString(), "Depthstrider", new String[] {"feet"}, 1, new String[] {"Frostwalker", "Firewalker"})); - - for(ToolCore tool : TConstructRegistry.getToolMapping()) + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 4)}, + TinkersDefense.config.ArmorGlowstepID, "GlowStep", + EnumChatFormatting.YELLOW.toString(), "GlowStep", + new String[] {"feet"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 5)}, + TinkersDefense.config.ArmorFirewalkerID, "Firewalker", + EnumChatFormatting.RED.toString(), "Firewalker", + new String[] {"feet"}, 1, new String[] {"Frostwalker"})); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 6)}, + TinkersDefense.config.ArmorFrostwalkerID, "Frostwalker", + EnumChatFormatting.BLUE.toString(), "Frostwalker", + new String[] {"feet"}, 1, new String[] {"Firewalker"})); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 8)}, + TinkersDefense.config.ArmorDepthstriderID, "Depthstrider", + EnumChatFormatting.DARK_BLUE.toString(), "Depthstrider", + new String[] {"feet"}, 1, + new String[] {"Frostwalker", "Firewalker"})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) { TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorRebreatherID, "tinker", "rebreather", true); @@ -147,6 +219,7 @@ public class ArmorMods TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorBlastProtectionID, "tinker", "blastprotection", true); TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorProjectileProtectionID, "tinker", "projprotection", true); TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorFeatherfallID, "tinker", "featherfall", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorAbsorptionID, "tinker", "healthboost", true); TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorGlowstepID, "tinker", "glowstep", true); TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorFirewalkerID, "tinker", "firewalk", true); @@ -159,54 +232,90 @@ public class ArmorMods { tcmods.RegisterModifiers(); } + if(TDIntegration.botania) + { + botmods.RegisterModifiers(); + } + if(TDIntegration.bloodMagic) + { + bloodmods.RegisterModifiers(); + } } + @Override public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { if(!world.isRemote) { if(tags.hasKey("Frostwalker")) - UpdateWalker(tool, stack, world, entity, Material.water, TinkersDefense.block_Unstable, 0); + { + UpdateWalker(tool, stack, world, entity, Material.water, TDArmorAddon.block_Unstable, 0); + } if(tags.hasKey("Firewalker")) - UpdateWalker(tool, stack, world, entity, Material.lava, TinkersDefense.block_Unstable, 1); + { + UpdateWalker(tool, stack, world, entity, Material.lava, TDArmorAddon.block_Unstable, 1); + } if(tags.hasKey("GlowStep")) + { UpdateGlowstep(tool, stack, world, entity); + } if(tags.hasKey("Rebreather")) + { UpdateRebreather(tool, stack, world, entity); + } if(tags.hasKey("Nightvision")) + { UpdateNightvision(tool, stack, world, entity); + } if(tags.hasKey("AntiBlindness")) + { UpdateAntiBlind(tool, stack, world, entity); + } if(tags.hasKey("HealthBoost")) + { UpdateHealthBoost(tool, stack, world, entity, tags); - //UpdateHighstep(tool, stack, world, entity); + //UpdateHighstep(tool, stack, world, entity); + } } else { if(tags.hasKey("Depthstrider")) + { UpdateFlippers(tool, stack, world, entity); + } if(tags.hasKey("Speed")) + { UpdateSpeed(tool, stack, world, entity, tags); -// if(tags.hasKey("Jump")) -// UpdateJump(tool, stack, world, entity, tags); + // if(tags.hasKey("Jump")) + // UpdateJump(tool, stack, world, entity, tags); + } } if(TDIntegration.thaumcraft) { tcmods.UpdateAll(tool, stack, world, entity, tags); } + if(TDIntegration.botania) + { + botmods.UpdateAll(tool, stack, world, entity, tags); + } + if(TDIntegration.bloodMagic) + { + bloodmods.UpdateAll(tool, stack, world, entity, tags); + } } public void UpdateWalker(ToolCore tool, ItemStack stack, World world, Entity entity, Material mat, Block replacement, int meta) { - int x = (int) Math.floor(entity.posX); - int y = (int) (entity.posY - entity.getYOffset()); - int z = (int) Math.floor(entity.posZ); + final int x = (int) Math.floor(entity.posX); + final int y = (int) (entity.posY - entity.getYOffset()); + final int z = (int) Math.floor(entity.posZ); Block block; for(int i = 0; i < 5; i++) + { for(int j = 0; j < 5; j++) { block = world.getBlock(x + (i - 2), y - 1, z + (j - 2)); @@ -219,6 +328,7 @@ public class ArmorMods } } } + } } int glowTimer = 8; @@ -227,15 +337,15 @@ public class ArmorMods public void UpdateGlowstep(ToolCore tool, ItemStack stack, World world, Entity entity) { - int x = (int) Math.floor(entity.posX); - int y = (int) (entity.posY - entity.getYOffset()); - int z = (int) Math.floor(entity.posZ); + final int x = (int) Math.floor(entity.posX); + final int y = (int) (entity.posY - entity.getYOffset()); + final int z = (int) Math.floor(entity.posZ); if(glowTimer == 0) { if(world.getBlock(x, y, z) == Blocks.air && world.getBlock(x, y - 1, z).isNormalCube()) { - world.setBlock(x, y, z, TinkersDefense.block_GlowCrumbs, 0, 3); + world.setBlock(x, y, z, TDArmorAddon.block_GlowCrumbs, 0, 3); //world.notifyBlocksOfNeighborChange(x + (i - 2), y - 1, z + (j - 2), world.getBlock(x + (i - 2), y - 1, z + (j - 2))); } glowTimer = 8; @@ -261,20 +371,35 @@ public class ArmorMods public void UpdateRebreather(ToolCore tool, ItemStack stack, World world, Entity entity) { - EntityPlayer player = (EntityPlayer) entity; + final EntityPlayer player = (EntityPlayer) entity; if(player.getAir() <= 0) { - if(player.inventory.hasItem(item_Canister)) - { - player.inventory.consumeInventoryItem(item_Canister); - player.inventory.addItemStackToInventory(new ItemStack(item_Emptycanister, 1, 0)); - player.setAir(150); - } - if(player.inventory.hasItem(item_Canister)) + ItemStack canStack; + int i; + int used = 0; + + for(i = 0; i < player.inventory.getSizeInventory(); i++) { - player.inventory.consumeInventoryItem(item_Canister); - player.inventory.addItemStackToInventory(new ItemStack(item_Emptycanister, 1, 0)); - player.setAir(300); + if(player.inventory.getStackInSlot(i) != null && player.inventory.getStackInSlot(i).getItem() == modItems && player.inventory.getStackInSlot(i).getItemDamage() == 0) + { + canStack = player.inventory.getStackInSlot(i); + if(used < 2 && canStack.stackSize == 1) + { + player.inventory.decrStackSize(i, 1); + player.inventory.addItemStackToInventory(new ItemStack( + modItems, 1, 1)); + player.setAir(150); + used++; + } + if(used == 0 && canStack.stackSize >= 2) + { + player.inventory.decrStackSize(i, 2); + player.inventory.addItemStackToInventory(new ItemStack( + modItems, 2, 1)); + player.setAir(300); + break; + } + } } } } @@ -282,18 +407,21 @@ public class ArmorMods public void UpdateNightvision(ToolCore tool, ItemStack stack, World world, Entity entity) { if(!((EntityPlayer) entity).isPotionActive(Potion.nightVision) || ((EntityPlayer) entity).getActivePotionEffect(Potion.nightVision).getDuration() < 1000) - ((EntityPlayer) entity).addPotionEffect(new PotionEffect(Potion.nightVision.id, 1000, 1, true)); + { + ((EntityPlayer) entity).addPotionEffect(new PotionEffect( + Potion.nightVision.id, 1000, 1, true)); + } } boolean isBlind = false; public void UpdateAntiBlind(ToolCore tool, ItemStack stack, World world, Entity entity) { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + final NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); if(((EntityPlayer) entity).isPotionActive(Potion.blindness) && !isBlind) { - int roll = world.rand.nextInt(100); - int antiLevel = tags.getInteger("AntiBlindness"); + final int roll = world.rand.nextInt(100); + final int antiLevel = tags.getInteger("AntiBlindness"); if(roll < antiLevel * 10) { ((EntityPlayer) entity).removePotionEffect(Potion.blindness.id); @@ -311,10 +439,10 @@ public class ArmorMods public void UpdateSpeed(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { - EntityPlayer ent = (EntityPlayer) entity; + final EntityPlayer ent = (EntityPlayer) entity; if(!entity.isInWater() && !ent.isSneaking() && ent.moveForward > 0.0) { - float speed = (float) (tags.getInteger("Speed") * 0.05); + final float speed = (float) (tags.getInteger("Speed") * 0.05); if(entity.onGround) { ent.moveFlying(0.0f, 1.0f, speed); @@ -325,43 +453,50 @@ public class ArmorMods } } } - - PotionEffect hb; + + PotionEffect hb; + public void UpdateHealthBoost(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { if(!((EntityPlayer) entity).isPotionActive(21)) - ((EntityPlayer) entity).addPotionEffect(new PotionEffect(21, 100, tags.getInteger("HealthBoost")-1, true)); - else if (((EntityPlayer) entity).getActivePotionEffect(Potion.potionTypes[21]).getDuration() < 10) - ((EntityPlayer) entity).getActivePotionEffect(Potion.potionTypes[21]).combine(new PotionEffect(21, 100, tags.getInteger("HealthBoost")-1, true)); + { + ((EntityPlayer) entity).addPotionEffect(new PotionEffect(21, 100, + tags.getInteger("HealthBoost") - 1, true)); + } + else if(((EntityPlayer) entity).getActivePotionEffect(Potion.potionTypes[21]).getDuration() < 10) + { + ((EntityPlayer) entity).getActivePotionEffect(Potion.potionTypes[21]).combine(new PotionEffect( + 21, 100, tags.getInteger("HealthBoost") - 1, true)); + } } -// public void UpdateJump(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) -// { -// EntityPlayer ent = (EntityPlayer) entity; -// if(!entity.isInWater() && !ent.isSneaking() && ent.motionY > 0.0) -// { -// float speed = (float) (tags.getInteger("Jump") * 0.15); -// -// ent.jumpMovementFactor = speed; -// -// } -// } + // public void UpdateJump(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + // { + // EntityPlayer ent = (EntityPlayer) entity; + // if(!entity.isInWater() && !ent.isSneaking() && ent.motionY > 0.0) + // { + // float speed = (float) (tags.getInteger("Jump") * 0.15); + // + // ent.jumpMovementFactor = speed; + // + // } + // } @SubscribeEvent public void Jump(LivingJumpEvent event) { if(event.entityLiving instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer) event.entityLiving; - if(player.getCurrentArmor(1) != null) + final EntityPlayer player = (EntityPlayer) event.entityLiving; + if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() instanceof ArmorCore) { - ItemStack legs = player.getCurrentArmor(1); - Item armor = legs.getItem(); - NBTTagCompound tags = legs.getTagCompound().getCompoundTag("InfiTool"); - + final ItemStack legs = player.getCurrentArmor(1); + final Item armor = legs.getItem(); + final NBTTagCompound tags = legs.getTagCompound().getCompoundTag("InfiTool"); + if((armor instanceof TinkersRobe || armor instanceof TinkersChausses || armor instanceof TinkersGrieves) && tags.hasKey("Jump")) { - double speed = tags.getInteger("Jump") * 0.1; + final double speed = tags.getInteger("Jump") * 0.1; player.setVelocity(0, 0.4 + speed, 0); player.velocityChanged = true; } @@ -373,11 +508,11 @@ public class ArmorMods public void Highstep(TickEvent.PlayerTickEvent event) { event.player.stepHeight = 0.5f; - if(event.player.getCurrentArmor(1) != null) + if(event.player.getCurrentArmor(1) != null && event.player.getCurrentArmor(1).getItem() instanceof ArmorCore) { - ItemStack legs = event.player.getCurrentArmor(1); - Item armor = legs.getItem(); - NBTTagCompound tags = legs.getTagCompound().getCompoundTag("InfiTool"); + final ItemStack legs = event.player.getCurrentArmor(1); + final Item armor = legs.getItem(); + final NBTTagCompound tags = legs.getTagCompound().getCompoundTag("InfiTool"); if((armor instanceof TinkersRobe || armor instanceof TinkersChausses || armor instanceof TinkersGrieves) && tags.hasKey("Highstep") && !event.player.isSneaking()) { diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/BloodMagic/BloodArmorMods.java b/src/main/java/lance5057/tDefense/armor/modifiers/BloodMagic/BloodArmorMods.java new file mode 100644 index 0000000..fca26a0 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/modifiers/BloodMagic/BloodArmorMods.java @@ -0,0 +1,56 @@ +package lance5057.tDefense.armor.modifiers.BloodMagic; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; +import tconstruct.library.crafting.ModifyBuilder; +import tconstruct.library.tools.ToolCore; +import WayofTime.alchemicalWizardry.ModItems; + +public class BloodArmorMods extends ModifiersBase +{ + public BloodArmorMods() + { + super(new String[] {}, "modItemsBloodArmor"); + // TODO Auto-generated constructor stub + } + + @Override + public void LoadItems() + { + } + + @Override + public void RegisterRecipes() + { + } + + @Override + public void RegisterModifiers() + { + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(ModItems.divinationSigil, 1, 0)}, + TinkersDefense.config.DivinationModID, "Divination", + EnumChatFormatting.DARK_RED.toString(), "Divination", + new String[] {"head"}, 0, new String[] {})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.DivinationModID, "tinker", "divination", true); + //TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.VisDiscountModID, "tinker", "visembroidery", true); + + } + } + + @Override + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + } +} diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/Botania/BotaniaArmorMods.java b/src/main/java/lance5057/tDefense/armor/modifiers/Botania/BotaniaArmorMods.java new file mode 100644 index 0000000..d81d05f --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/modifiers/Botania/BotaniaArmorMods.java @@ -0,0 +1,50 @@ +package lance5057.tDefense.armor.modifiers.Botania; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.modifiers.ModifierIntExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; +import tconstruct.library.crafting.ModifyBuilder; +import tconstruct.library.tools.ToolCore; +import vazkii.botania.common.item.ModItems; + +public class BotaniaArmorMods extends ModifiersBase +{ + public BotaniaArmorMods() + { + super(null, "modItemsBotaniaArmor"); + } + + @Override + public void RegisterRecipes() + { + + } + + @Override + public void RegisterModifiers() + { + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(ModItems.manaResource, 1, 22)}, + TinkersDefense.config.ArmorManaDiscountModID, "ManaEmbroidery", + 1, EnumChatFormatting.AQUA.toString(), "Mana Embroidery", + new String[] {"cloth"}, 1, new String[] {})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorManaDiscountModID, "tinker", "manaembroidery", true); + + } + } + + @Override + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + } +} diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/Thaumcraft/ThaumArmorMods.java b/src/main/java/lance5057/tDefense/armor/modifiers/Thaumcraft/ThaumArmorMods.java index 96ce0c9..9b91556 100644 --- a/src/main/java/lance5057/tDefense/armor/modifiers/Thaumcraft/ThaumArmorMods.java +++ b/src/main/java/lance5057/tDefense/armor/modifiers/Thaumcraft/ThaumArmorMods.java @@ -1,15 +1,10 @@ package lance5057.tDefense.armor.modifiers.Thaumcraft; -import lance5057.tDefense.Reference; import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.modifiers.modifierBoolExclusive; -import lance5057.tDefense.armor.modifiers.modifierIntExclusive; -import lance5057.tDefense.armor.modifiers.modifierProtection; -import net.minecraft.block.material.Material; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifierIntExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -17,38 +12,47 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.ModifyBuilder; import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ModInteger; -import tconstruct.tools.TinkerTools; import thaumcraft.api.ItemApi; -import cpw.mods.fml.common.registry.GameRegistry; -public class ThaumArmorMods +public class ThaumArmorMods extends ModifiersBase { - + //Runic Shielding is handled in ArmorCore.java - - public void LoadItems() + + public ThaumArmorMods() { + super(new String[] {}, "modItemsThaumArmor"); + // TODO Auto-generated constructor stub } + @Override public void RegisterRecipes() { } + @Override public void RegisterModifiers() { - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {ItemApi.getItem("itemGoggles", 0)}, TinkersDefense.config.RevealingModID, "Revealing", "\u00A75", "Revealing", new String[] {"head"}, 0, null)); - - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {ItemApi.getItem("itemResource", 7)}, TinkersDefense.config.VisDiscountModID, "VisEmbroidery", 1, "\u00A79", "Vis Embroidery", new String[] {"cloth"}, 1, new String[] {"ManaEmbroidery"})); - - for(ToolCore tool : TConstructRegistry.getToolMapping()) + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {ItemApi.getItem("itemGoggles", 0)}, + TinkersDefense.config.RevealingModID, "Revealing", "\u00A75", + "Revealing", new String[] {"head"}, 0, null)); + + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {ItemApi.getItem("itemResource", 7)}, + TinkersDefense.config.VisDiscountModID, "VisEmbroidery", 1, + "\u00A79", "Vis Embroidery", new String[] {"cloth"}, 1, + new String[] {})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) { TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.RevealingModID, "tinker", "revealing", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.VisDiscountModID, "tinker", "vis", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.VisDiscountModID, "tinker", "visembroidery", true); } } + @Override public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { } diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/modifierBoolExclusive.java b/src/main/java/lance5057/tDefense/armor/modifiers/modifierBoolExclusive.java deleted file mode 100644 index 0709dbf..0000000 --- a/src/main/java/lance5057/tDefense/armor/modifiers/modifierBoolExclusive.java +++ /dev/null @@ -1,76 +0,0 @@ -package lance5057.tDefense.armor.modifiers; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ModBoolean; - -public class modifierBoolExclusive extends ModBoolean -{ - String[] exclusive; - int modsNeeded = 0; - String color; - String tooltipName; - String[] modExclusions; - - /* - * excludeMods: If these modifier keys are present this modifier wont take. - */ - public modifierBoolExclusive(ItemStack[] items, int effect, String tag, String c, String tip, String[] exclusive, int modsNeeded, String[] excludeMods) - { - super(items, effect, tag, c, tip); - this.exclusive = exclusive; - this.modsNeeded = modsNeeded; - this.color = c; - this.tooltipName = tip; - this.modExclusions = excludeMods; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - boolean isExclusive = false; - boolean hasModRejection = false; - - for(int i = 0; i < exclusive.length; i++) - { - if(list.contains(exclusive[i])) - { - isExclusive = true; - } - } - - if(modExclusions != null) - { - for(int i = 0; i < modExclusions.length; i++) - { - if(tags.hasKey(modExclusions[i])) - { - hasModRejection = true; - } - } - } - - return isExclusive && !hasModRejection && !tags.hasKey(tooltipName); - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - tags.setBoolean(key, true); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= modsNeeded; - tags.setInteger("Modifiers", modifiers); - - addToolTip(tool, color + tooltipName, color + key); - } -} diff --git a/src/main/java/lance5057/tDefense/armor/modifiers/modifierIntExclusive.java b/src/main/java/lance5057/tDefense/armor/modifiers/modifierIntExclusive.java deleted file mode 100644 index 5ff652e..0000000 --- a/src/main/java/lance5057/tDefense/armor/modifiers/modifierIntExclusive.java +++ /dev/null @@ -1,96 +0,0 @@ -package lance5057.tDefense.armor.modifiers; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ModInteger; - -public class modifierIntExclusive extends ModInteger -{ - String[] exclusive; - int modsNeeded = 0; - String color; - String tooltipName; - int initialIncrease; - int secondaryIncrease; - int max = 5; - String[] modExclusions; - - public modifierIntExclusive(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip, String[] exclusive, int modsNeeded, String[] excludeMods) - { - super(items, effect, dataKey, increase, c, tip); - this.exclusive = exclusive; - this.modsNeeded = modsNeeded; - initialIncrease = secondaryIncrease = increase; - color = c; - tooltipName = tip; - this.modExclusions = excludeMods; - } - - public modifierIntExclusive(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip, String[] exclusive, int modsNeeded, int max) - { - super(items, effect, dataKey, increase, c, tip); - this.exclusive = exclusive; - this.modsNeeded = modsNeeded; - initialIncrease = secondaryIncrease = increase; - color = c; - tooltipName = tip; - this.max = max; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - boolean isExclusive = false; - boolean hasModRejection = false; - - for(int i = 0; i < exclusive.length; i++) - { - if(list.contains(exclusive[i])) - { - isExclusive = true; - } - } - - if(modExclusions != null) - { - for(int i = 0; i < modExclusions.length; i++) - { - if(tags.hasKey(modExclusions[i])) - { - hasModRejection = true; - } - } - } - - return tags.getInteger(tooltipName) < max; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if(tags.hasKey(key)) - { - int increase = tags.getInteger(key); - increase += secondaryIncrease; - tags.setInteger(key, increase); - } - else - { - tags.setInteger(key, initialIncrease); - } - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= modsNeeded; - tags.setInteger("Modifiers", modifiers); - - addToolTip(tool, color + tooltipName, color + key); - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java b/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java index fcafd47..6ffce2f 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/ArmorRenderer.java @@ -1,25 +1,98 @@ package lance5057.tDefense.armor.renderers; +import java.util.ArrayList; +import java.util.List; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.ArmorCore; import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import org.lwjgl.opengl.GL11; public class ArmorRenderer extends ModelBiped { - public String[] colors; + public String[] colors; + + public ItemStack stack; + public String defaultFolder; + + private final int[] order = new int[] {1, 2, 3, 0, 4, 5, 6, 7, 8, 9}; + + public List boxes = new ArrayList(); - public ItemStack stack; - public String defaultFolder; + public NBTTagCompound defaultTags = new NBTTagCompound(); public ArmorRenderer(float a, float b, int c, int d) { super(a, b, c, d); } + public void init() + { + defaultTags.getCompoundTag("ArmorRenderer"); + + for(int i = 0; i < boxList.size(); i++) + { + final String rendertag = ((ModelRenderer) boxList.get(i)).boxName; + if(rendertag != null) + { + defaultTags.setBoolean(rendertag, ((ModelRenderer) boxList.get(i)).isHidden); + } + } + } + public void SetColors(String[] colors, String defaultFolder, ItemStack stack) { this.colors = colors; this.stack = stack; this.defaultFolder = defaultFolder; } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + + if(TinkersDefense.config.transparency) + { + GL11.glEnable(GL11.GL_BLEND); + } + + final NBTTagCompound tags = stack.getTagCompound().getCompoundTag("ArmorRenderer"); + + for(int j = 0; j < boxList.size(); j++) + { + final ModelRenderer box = (ModelRenderer) boxList.get(j); + if(tags.hasKey(box.boxName)) + { + box.isHidden = tags.getBoolean(box.boxName); + } + } + + for(int i = 0; i < 10; i++) + { + final String texture = ((ArmorCore) stack.getItem()).getTexture(order[i], stack); + if(texture != "") + { + GL11.glPushMatrix(); + + ((ArmorCore) stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, order[i]); + super.render(entity, f, f1, f2, f3, f4, f5); + + GL11.glPopMatrix(); + } + } + + if(TinkersDefense.config.transparency) + { + GL11.glDisable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + GL11.glColor3d(1.0, 1.0, 1.0); + } } diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java deleted file mode 100644 index aee3b9e..0000000 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelMask.java +++ /dev/null @@ -1,77 +0,0 @@ -package lance5057.tDefense.armor.renderers; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * HornedBand - Either Mojang or a mod author - * Created using Tabula 4.1.1 - */ -public class ModelMask extends ModelBiped -{ - public ModelRenderer Plate; - public ModelRenderer Band; - public ModelRenderer HornTipR; - public ModelRenderer HornTipL; - public ModelRenderer HornBaseR; - public ModelRenderer HornBaseL; - - String Color[]; - int rgbColors[]; - - public ModelMask(String color[] /*3*/) - { - this.textureWidth = 64; - this.textureHeight = 64; - this.HornBaseR = new ModelRenderer(this, 0, 35); - this.HornBaseR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornBaseR.addBox(-3.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); - this.setRotateAngle(HornBaseR, -0.17453292519943295F, 0.0F, 0.0F); - this.HornTipL = new ModelRenderer(this, 0, 39); - this.HornTipL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornTipL.addBox(2.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); - this.setRotateAngle(HornTipL, -0.7853981633974483F, 0.0F, 0.0F); - this.HornTipR = new ModelRenderer(this, 0, 39); - this.HornTipR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornTipR.addBox(-3.0F, -0.5F, -10.8F, 1, 1, 2, 0.1F); - this.setRotateAngle(HornTipR, -0.7853981633974483F, 0.0F, 0.0F); - this.Plate = new ModelRenderer(this, 0, 32); - this.Plate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Plate.addBox(-4.0F, -7.0F, -5.0F, 8, 2, 1, 0.0F); - this.Band = new ModelRenderer(this, 0, 39); - this.Band.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Band.addBox(-4.0F, -6.5F, -4.0F, 8, 1, 8, 0.1F); - this.HornBaseL = new ModelRenderer(this, 0, 35); - this.HornBaseL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.HornBaseL.addBox(1.5F, -6.1F, -7.5F, 2, 2, 2, 0.0F); - this.setRotateAngle(HornBaseL, -0.17453292519943295F, 0.0F, 0.0F); - this.Plate.addChild(this.HornBaseR); - this.Plate.addChild(this.HornBaseL); - - this.bipedHead.addChild(this.Plate); - this.bipedHead.addChild(this.HornTipL); - this.bipedHead.addChild(this.HornTipR); - this.bipedHead.addChild(this.Band); - - Color = color; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java deleted file mode 100644 index 1158394..0000000 --- a/src/main/java/lance5057/tDefense/armor/renderers/ModelScarf.java +++ /dev/null @@ -1,52 +0,0 @@ -package lance5057.tDefense.armor.renderers; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * Scarf - Either Mojang or a mod author - * Created using Tabula 4.1.1 - */ -public class ModelScarf extends ModelBiped -{ - public ModelRenderer ScarfNeck; - public ModelRenderer ScarfExtra1; - public ModelRenderer ScarfExtra1_1; - - public ModelScarf() - { - this.textureWidth = 64; - this.textureHeight = 64; - this.ScarfExtra1_1 = new ModelRenderer(this, 0, 32); - this.ScarfExtra1_1.setRotationPoint(0.0F, 1.0F, 3.5F); - this.ScarfExtra1_1.addBox(-3.0F, 0.0F, 0.0F, 3, 11, 1, 0.0F); - this.setRotateAngle(ScarfExtra1_1, 0.0F, 0.0F, 0.17453292519943295F); - this.ScarfNeck = new ModelRenderer(this, 8, 32); - this.ScarfNeck.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ScarfNeck.addBox(-4.0F, -2.0F, -4.0F, 8, 3, 8, 0.6F); - this.ScarfExtra1 = new ModelRenderer(this, 8, 32); - this.ScarfExtra1.setRotationPoint(0.0F, 1.0F, 3.5F); - this.ScarfExtra1.addBox(-0.5F, 0.0F, 0.0F, 3, 7, 1, 0.0F); - this.setRotateAngle(ScarfExtra1, 0.0F, 0.0F, -0.17453292519943295F); - this.ScarfNeck.addChild(this.ScarfExtra1_1); - this.ScarfNeck.addChild(this.ScarfExtra1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - this.ScarfNeck.render(f5); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersGauntlets.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersGauntlets.java new file mode 100644 index 0000000..d40b416 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersGauntlets.java @@ -0,0 +1,214 @@ +package lance5057.tDefense.armor.renderers; + +import net.minecraft.client.model.ModelRenderer; + +/** + * ModelTinkersGauntlet - Either Mojang or a mod author + * Created using Tabula 4.1.1 + */ +public class ModelTinkersGauntlets extends ArmorRenderer +{ + public ModelRenderer GloveR; + public ModelRenderer VambraceR; + public ModelRenderer RebraceR; + public ModelRenderer BoltR; + public ModelRenderer KnuckleR; + public ModelRenderer SettingR; + public ModelRenderer GemR; + public ModelRenderer ArmSpikesR; + public ModelRenderer ArmSpikesBackR; + public ModelRenderer KnuckleSpikesL; + public ModelRenderer KnuckleSpikesR; + public ModelRenderer KnuckleSpikesMidR; + public ModelRenderer GloveL; + public ModelRenderer VambraceL; + public ModelRenderer RebraceL; + public ModelRenderer BoltL; + public ModelRenderer ArmSpikesL; + public ModelRenderer KnuckleSpikesBackR; + public ModelRenderer KnuckleSpikesBackL; + public ModelRenderer KnuckleSpikesMidL; + public ModelRenderer KnuckleL; + public ModelRenderer GemL; + public ModelRenderer SettingL; + public ModelRenderer ArmSpikesBackL; + + public ModelTinkersGauntlets() + { + super(1.0f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + KnuckleSpikesL = new ModelRenderer(this, 56, 40); + KnuckleSpikesL.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesL.addBox(3.0F, 6.0F, -0.5F, 4, 8, 0, 0.0F); + setRotateAngle(KnuckleSpikesL, 0.0F, 0.3490658503988659F, 0.0F); + bipedLeftArm.addChild(KnuckleSpikesL); + + KnuckleSpikesBackL = new ModelRenderer(this, 56, 40); + KnuckleSpikesBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesBackL.addBox(3.0F, 6.0F, 0.5F, 4, 8, 0, 0.0F); + setRotateAngle(KnuckleSpikesBackL, 0.0F, -0.3490658503988659F, 0.0F); + bipedLeftArm.addChild(KnuckleSpikesBackL); + + KnuckleL = new ModelRenderer(this, 0, 41); + KnuckleL.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleL.addBox(0.1F, 6.8F, -2.0F, 3, 3, 4, 0.4F); + bipedLeftArm.addChild(KnuckleL); + + ArmSpikesR = new ModelRenderer(this, 56, 32); + ArmSpikesR.mirror = true; + ArmSpikesR.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmSpikesR.addBox(-7.5F, 1.0F, 0.5F, 4, 8, 0, 0.0F); + setRotateAngle(ArmSpikesR, 0.0F, -0.3490658503988659F, 0.0F); + bipedRightArm.addChild(ArmSpikesR); + + RebraceL = new ModelRenderer(this, 14, 40); + RebraceL.setRotationPoint(0.0F, 0.0F, 0.0F); + RebraceL.addBox(-1.1F, 3.0F, -2.0F, 3, 5, 4, 0.2F); + bipedLeftArm.addChild(RebraceL); + + BoltL = new ModelRenderer(this, 16, 32); + BoltL.setRotationPoint(0.0F, 0.0F, 0.0F); + BoltL.addBox(-5.8F, 3.7F, -3.0F, 2, 2, 6, -0.3F); + setRotateAngle(BoltL, 0.0F, 0.0F, -0.7853981633974483F); + bipedLeftArm.addChild(BoltL); + + KnuckleSpikesBackR = new ModelRenderer(this, 56, 40); + KnuckleSpikesBackR.mirror = true; + KnuckleSpikesBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesBackR.addBox(-7.0F, 6.0F, 0.5F, 4, 8, 0, 0.0F); + setRotateAngle(KnuckleSpikesBackR, 0.0F, 0.3490658503988659F, 0.0F); + bipedRightArm.addChild(KnuckleSpikesBackR); + + GloveR = new ModelRenderer(this, 0, 32); + GloveR.mirror = true; + GloveR.setRotationPoint(0.0F, 0.0F, 0.0F); + GloveR.addBox(-3.0F, 5.0F, -2.0F, 4, 5, 4, 0.1F); + bipedRightArm.addChild(GloveR); + + BoltR = new ModelRenderer(this, 16, 32); + BoltR.mirror = true; + BoltR.setRotationPoint(0.0F, 0.0F, 0.0F); + BoltR.addBox(3.8F, 3.7F, -3.0F, 2, 2, 6, -0.3F); + setRotateAngle(BoltR, 0.0F, 0.0F, 0.7853981633974483F); + bipedRightArm.addChild(BoltR); + + KnuckleR = new ModelRenderer(this, 0, 41); + KnuckleR.mirror = true; + KnuckleR.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleR.addBox(-2.9F, 6.8F, -2.0F, 3, 3, 4, 0.4F); + bipedRightArm.addChild(KnuckleR); + + KnuckleSpikesR = new ModelRenderer(this, 56, 40); + KnuckleSpikesR.mirror = true; + KnuckleSpikesR.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesR.addBox(-7.0F, 6.0F, -0.5F, 4, 8, 0, 0.0F); + setRotateAngle(KnuckleSpikesR, 0.0F, -0.3490658503988659F, 0.0F); + bipedRightArm.addChild(KnuckleSpikesR); + + KnuckleSpikesMidL = new ModelRenderer(this, 54, 48); + KnuckleSpikesMidL.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesMidL.addBox(3.0F, 1.0F, 0.0F, 5, 13, 0, 0.0F); + bipedLeftArm.addChild(KnuckleSpikesMidL); + + ArmSpikesBackL = new ModelRenderer(this, 56, 32); + ArmSpikesBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmSpikesBackL.addBox(3.5F, 1.0F, -0.5F, 4, 8, 0, 0.0F); + setRotateAngle(ArmSpikesBackL, 0.0F, -0.3490658503988659F, 0.0F); + bipedLeftArm.addChild(ArmSpikesBackL); + + ArmSpikesBackR = new ModelRenderer(this, 56, 32); + ArmSpikesBackR.mirror = true; + ArmSpikesBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmSpikesBackR.addBox(-7.5F, 1.0F, -0.5F, 4, 8, 0, 0.0F); + setRotateAngle(ArmSpikesBackR, 0.0F, 0.3490658503988659F, 0.0F); + bipedRightArm.addChild(ArmSpikesBackR); + + VambraceR = new ModelRenderer(this, 0, 56); + VambraceR.mirror = true; + VambraceR.setRotationPoint(0.0F, 0.0F, 0.0F); + VambraceR.addBox(-3.6F, 2.8F, -2.0F, 3, 4, 4, 0.3F); + setRotateAngle(VambraceR, 0.0F, 0.0F, -0.08726646259971647F); + bipedRightArm.addChild(VambraceR); + + GemR = new ModelRenderer(this, 0, 48); + GemR.mirror = true; + GemR.setRotationPoint(0.0F, 0.0F, 0.0F); + GemR.addBox(-4.2F, 5.0F, -2.0F, 2, 4, 4, -0.3F); + bipedRightArm.addChild(GemR); + + RebraceR = new ModelRenderer(this, 14, 40); + RebraceR.mirror = true; + RebraceR.setRotationPoint(0.0F, 0.0F, 0.0F); + RebraceR.addBox(-1.9F, 3.0F, -2.0F, 3, 5, 4, 0.2F); + bipedRightArm.addChild(RebraceR); + + SettingR = new ModelRenderer(this, 12, 49); + SettingR.mirror = true; + SettingR.setRotationPoint(0.0F, 0.0F, 0.0F); + SettingR.addBox(-3.7F, 5.0F, -2.0F, 1, 4, 4, 0.0F); + bipedRightArm.addChild(SettingR); + + GloveL = new ModelRenderer(this, 0, 32); + GloveL.setRotationPoint(0.0F, 0.0F, 0.0F); + GloveL.addBox(-1.0F, 5.0F, -2.0F, 4, 5, 4, 0.1F); + bipedLeftArm.addChild(GloveL); + + GemL = new ModelRenderer(this, 0, 48); + GemL.mirror = true; + GemL.setRotationPoint(0.0F, 0.0F, 0.0F); + GemL.addBox(2.4F, 5.0F, -2.0F, 2, 4, 4, -0.3F); + bipedLeftArm.addChild(GemL); + + VambraceL = new ModelRenderer(this, 0, 56); + VambraceL.setRotationPoint(0.0F, 0.0F, 0.0F); + VambraceL.addBox(0.8F, 2.8F, -2.0F, 3, 4, 4, 0.3F); + setRotateAngle(VambraceL, 0.0F, 0.0F, 0.08726646259971647F); + bipedLeftArm.addChild(VambraceL); + + KnuckleSpikesMidR = new ModelRenderer(this, 54, 48); + KnuckleSpikesMidR.mirror = true; + KnuckleSpikesMidR.setRotationPoint(0.0F, 0.0F, 0.0F); + KnuckleSpikesMidR.addBox(-8.0F, 1.0F, 0.0F, 5, 13, 0, 0.0F); + bipedRightArm.addChild(KnuckleSpikesMidR); + + SettingL = new ModelRenderer(this, 12, 49); + SettingL.mirror = true; + SettingL.setRotationPoint(0.0F, 0.0F, 0.0F); + SettingL.addBox(2.9F, 5.0F, -2.0F, 1, 4, 4, 0.0F); + bipedLeftArm.addChild(SettingL); + + ArmSpikesL = new ModelRenderer(this, 56, 32); + ArmSpikesL.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmSpikesL.addBox(3.5F, 1.0F, 0.5F, 4, 8, 0, 0.0F); + setRotateAngle(ArmSpikesL, 0.0F, 0.3490658503988659F, 0.0F); + bipedLeftArm.addChild(ArmSpikesL); + + ArmSpikesBackL.isHidden = true; + ArmSpikesBackR.isHidden = true; + ArmSpikesL.isHidden = true; + ArmSpikesR.isHidden = true; + GemL.isHidden = true; + GemR.isHidden = true; + KnuckleSpikesBackL.isHidden = true; + KnuckleSpikesBackR.isHidden = true; + KnuckleSpikesL.isHidden = true; + KnuckleSpikesMidL.isHidden = true; + KnuckleSpikesMidR.isHidden = true; + KnuckleSpikesR.isHidden = true; + SettingL.isHidden = true; + SettingR.isHidden = true; + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersTabard.java b/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersTabard.java new file mode 100644 index 0000000..fe92f2b --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/renderers/ModelTinkersTabard.java @@ -0,0 +1,73 @@ +package lance5057.tDefense.armor.renderers; + +import lance5057.tDefense.armor.ArmorCore; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +/** + * ModelBiped - Either Mojang or a mod author + * Created using Tabula 4.1.1 + */ +public class ModelTinkersTabard extends ArmorRenderer +{ + public ModelRenderer Tabard; + public ModelRenderer TabardBottomF; + public ModelRenderer TabardBottomB; + + public ModelTinkersTabard() + { + super(0.5f, 0, 64, 64); + + this.textureWidth = 64; + this.textureHeight = 64; + + this.Tabard = new ModelRenderer(this, 0, 32); + this.Tabard.setRotationPoint(0.0F, 0.0F, 0.0F); + this.Tabard.addBox(-4.0F, 0.0F, -2.5F, 8, 12, 5, 0.1F); + + this.TabardBottomF = new ModelRenderer(this, 26, 32); + this.TabardBottomF.setRotationPoint(0.0F, 12.0F, 0.0F); + this.TabardBottomF.addBox(-4.0F, 0.2F, -2.5F, 8, 8, 1, 0.1F); + this.TabardBottomB = new ModelRenderer(this, 26, 32); + this.TabardBottomB.mirror = true; + + this.TabardBottomB.setRotationPoint(0.0F, 12.0F, 0.0F); + this.TabardBottomB.addBox(-4.0F, 0.2F, 1.5F, 8, 8, 1, 0.1F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + GL11.glPushMatrix(); + + for(int i = 0; i < 10; i++) + { + String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); + if(texture != "") + { + + GL11.glPushMatrix(); + + ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); + super.render(entity, f, f1, f2, f3, f4, f5); + + GL11.glPopMatrix(); + } + } + + GL11.glPopMatrix(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java index 629d2c4..0fd14bd 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersHood.java @@ -1,67 +1,144 @@ package lance5057.tDefense.armor.renderers.cloth; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * TinkersHood - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersHood extends ArmorRenderer { - public ModelRenderer Hood; public ModelRenderer Flop; + public ModelRenderer Flop_1; + public ModelRenderer Flop_2; + public ModelRenderer ScarfNeck; + public ModelRenderer Band; + public ModelRenderer BandTilted; + public ModelRenderer Rim; + public ModelRenderer HatTop; + public ModelRenderer HatTopTall; + public ModelRenderer Tip; + public ModelRenderer Tip_1; + public ModelRenderer Tip_2; + public ModelRenderer ScarfExtra; + public ModelRenderer ScarfExtra_1; public ModelTinkersHood() { - super(1.0f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.Hood = new ModelRenderer(this, 0, 44); - this.Hood.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Hood.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); - this.bipedHead.addChild(this.Hood); - - this.Flop = new ModelRenderer(this, 0, 32); - this.Flop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Flop.addBox(-4.0F, -9.6F, 0.3F, 8, 8, 4, 0.0F); - this.setRotateAngle(Flop, -0.4553564018453205F, 0.0F, 0.0F); - this.bipedHead.addChild(this.Flop); - - this.bipedHeadwear.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 128, 64); + + textureWidth = 128; + textureHeight = 64; + + bipedHeadwear = new ModelRenderer(this, "Headwear"); + bipedHeadwear.setTextureOffset(32, 0); + bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.1f + 0.5F); + bipedHeadwear.setRotationPoint(0.0F, 0.0F + 0, 0.0F); + + Flop = new ModelRenderer(this, "Flop"); + Flop.setTextureOffset(64, 0); + Flop.setRotationPoint(0.0F, 0.0F, 0.0F); + Flop.addBox(-3.0F, -7.6F, 1.0F, 6, 6, 3, 0.5F); + setRotateAngle(Flop, -0.3490658503988659F, 0.0F, 0.0F); + bipedHead.addChild(Flop); + + Flop_1 = new ModelRenderer(this, "Flop 1"); + Flop_1.setTextureOffset(82, 0); + Flop_1.setRotationPoint(0.0F, 0.0F, 0.0F); + Flop_1.addBox(-2.0F, -6.8F, -0.1F, 4, 4, 5, 0.5F); + setRotateAngle(Flop_1, -0.6981317007977318F, 0.0F, 0.0F); + bipedHead.addChild(Flop_1); + + Flop_2 = new ModelRenderer(this, "Flop 2"); + Flop_2.setTextureOffset(64, 25); + Flop_2.setRotationPoint(0.0F, 0.0F, 0.0F); + Flop_2.addBox(-1.0F, -6.6F, 2.0F, 2, 2, 4, 0.5F); + setRotateAngle(Flop_2, -1.0471975511965976F, 0.0F, 0.0F); + bipedHead.addChild(Flop_2); + + ScarfExtra = new ModelRenderer(this, "ScarfExtra"); + ScarfExtra.setTextureOffset(44, 32); + ScarfExtra.setRotationPoint(0.0F, 0.0F, 0.0F); + ScarfExtra.addBox(0.0F, 0.0F, 2.0F, 3, 7, 1, 0.0F); + setRotateAngle(ScarfExtra, 0.0F, 0.0F, -0.17453292519943295F); + bipedBody.addChild(ScarfExtra); + + ScarfExtra_1 = new ModelRenderer(this, "ScarfExtra 1"); + ScarfExtra_1.setTextureOffset(36, 32); + ScarfExtra_1.setRotationPoint(0.0F, 0.0F, 0.0F); + ScarfExtra_1.addBox(-3.0F, 0.0F, 2.0F, 3, 11, 1, 0.0F); + setRotateAngle(ScarfExtra_1, 0.0F, 0.0F, 0.17453292519943295F); + bipedBody.addChild(ScarfExtra_1); + + ScarfNeck = new ModelRenderer(this, "ScarfNeck"); + ScarfNeck.setTextureOffset(0, 32); + ScarfNeck.setRotationPoint(0.0F, 0.0F, 0.0F); + ScarfNeck.addBox(-4.5F, -2.0F, -4.5F, 9, 3, 9, 0.3F); + bipedHead.addChild(ScarfNeck); + + HatTop = new ModelRenderer(this, "HatTop"); + HatTop.setTextureOffset(52, 33); + HatTop.addBox(-4.0F, -8.0F, -4.0F, 8, 3, 8, 0.1f + 0.5F); + HatTop.setRotationPoint(0.0F, 0.0F + 0, 0.0F); + bipedHead.addChild(HatTop); + + HatTopTall = new ModelRenderer(this, "HatTopTall"); + HatTopTall.setTextureOffset(96, 4); + HatTopTall.setRotationPoint(0.0F, 0.0F, 0.0F); + HatTopTall.addBox(-4.0F, -14.0F, -4.0F, 8, 5, 8, 0.5F); + bipedHead.addChild(HatTopTall); + + Rim = new ModelRenderer(this, "Rim"); + Rim.setTextureOffset(64, 20); + Rim.setRotationPoint(0.0F, 0.0F, 0.0F); + Rim.addBox(-6.0F, -5.5F, -6.0F, 12, 1, 12, 0.1F); + bipedHead.addChild(Rim); + + BandTilted = new ModelRenderer(this, "BandTilted"); + BandTilted.setTextureOffset(64, 9); + BandTilted.setRotationPoint(0.0F, 0.0F, 0.0F); + BandTilted.addBox(-4.5F, -2.7F, -8.5F, 9, 2, 9, 0.0F); + setRotateAngle(BandTilted, -1.2f, 0.0F, 0.0F); + bipedHead.addChild(BandTilted); + + Band = new ModelRenderer(this, "Band"); + Band.setTextureOffset(64, 9); + Band.setRotationPoint(0.0F, 0.0F, 0.0F); + Band.addBox(-4.5F, -6.7F, -4.5F, 9, 2, 9, 0.2F); + bipedHead.addChild(Band); + + Tip = new ModelRenderer(this, "Tip"); + Tip.setTextureOffset(0, 44); + Tip.setRotationPoint(0.0F, 0.0F, 0.0F); + Tip.addBox(-3.0F, -10.8F, -5.0F, 6, 3, 6, 0.5F); + setRotateAngle(Tip, -0.2617993877991494F, 0.0F, 0.0F); + bipedHead.addChild(Tip); + + Tip_1 = new ModelRenderer(this, "Tip 1"); + Tip_1.setTextureOffset(0, 53); + Tip_1.setRotationPoint(0.0F, 0.0F, 0.0F); + Tip_1.addBox(-2.0F, -12.9F, -6.7F, 4, 3, 4, 0.5F); + setRotateAngle(Tip_1, -0.5235987755982988F, 0.0F, 0.0F); + bipedHead.addChild(Tip_1); + + Tip_2 = new ModelRenderer(this, "Tip 2"); + Tip_2.setTextureOffset(18, 45); + Tip_2.setRotationPoint(0.0F, 0.0F, 0.0F); + Tip_2.addBox(-1.0F, -14.6F, -8.8F, 2, 3, 2, 0.5F); + setRotateAngle(Tip_2, -0.7853981633974483F, 0.0F, 0.0F); + bipedHead.addChild(Tip_2); + + Rim.isHidden = true; + Band.isHidden = true; + HatTop.isHidden = true; + HatTopTall.isHidden = true; + BandTilted.isHidden = true; + Tip.isHidden = true; + Tip_1.isHidden = true; + Tip_2.isHidden = true; + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java index 80c32a8..aae1594 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersRobe.java @@ -1,112 +1,370 @@ package lance5057.tDefense.armor.renderers.cloth; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ClothRobes - Undefined + * ModelBiped - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersRobe extends ArmorRenderer { - public ModelRenderer Left; - public ModelRenderer Right; - public ModelRenderer RightBack; - public ModelRenderer LeftFront; - public ModelRenderer RightFront; - public ModelRenderer Belt; - public ModelRenderer LeftBack; + public ModelRenderer LeftFrontL; + public ModelRenderer LeftBackL; + public ModelRenderer CenterBackL; + public ModelRenderer RightFronL; + public ModelRenderer RightBackL; + public ModelRenderer CenterFrontL; + public ModelRenderer CenterFrontR; + public ModelRenderer CenterBackR; + public ModelRenderer FrontMidL; + public ModelRenderer FrontRightMid; + public ModelRenderer BackMidR; + public ModelRenderer BackRightMid; + public ModelRenderer FrontLeftMid; + public ModelRenderer UnderFrontLeftMid; + public ModelRenderer UnderBackRightMid; + public ModelRenderer UnderBackLeftMid; + public ModelRenderer UnderFrontRightMid; + public ModelRenderer UnderLeftMid; + public ModelRenderer UnderRightMid; + public ModelRenderer FrontMidR; + public ModelRenderer BackLeftMid; + public ModelRenderer BackMidL; + public ModelRenderer FrontLHigh; + public ModelRenderer UnderFrontRightHigh; + public ModelRenderer UnderBackRightHigh; + public ModelRenderer BackUnderHigh; + public ModelRenderer UnderBackLeftHigh; + public ModelRenderer RightHigh; + public ModelRenderer LeftHigh; + public ModelRenderer FrontRightHigh; + public ModelRenderer BackRightHigh; + public ModelRenderer UnderFrontHigh; + public ModelRenderer UnderFrontLeftHigh; + public ModelRenderer BackLHigh; + public ModelRenderer BeltLHip; + public ModelRenderer BeltStraight; + public ModelRenderer BeltRHip; + + //public ModelRenderer BeltStraightSmall; public ModelTinkersRobe() { - super(1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.Right = new ModelRenderer(this, 18, 41); - this.Right.mirror = true; - this.Right.setRotationPoint(0F, 0F, 0F); - this.Right.addBox(-2.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); - this.setRotateAngle(Right, 0.0F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.Right); - - this.RightBack = new ModelRenderer(this, 40, 43); - this.RightBack.mirror = true; - this.RightBack.setRotationPoint(0F, 0F, 0F); - this.RightBack.addBox(-2.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); - this.setRotateAngle(RightBack, 0.2617993877991494F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.RightBack); - - this.LeftBack = new ModelRenderer(this, 40, 43); - this.LeftBack.setRotationPoint(0F, 0F, 0F); - this.LeftBack.addBox(-3.5F, 0.27F, -0.6F, 6, 11, 3, 0.0F); - this.setRotateAngle(LeftBack, 0.2617993877991494F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.LeftBack); - - this.Belt = new ModelRenderer(this, 0, 32); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-6.5F, 9.0F, -3.0F, 10, 3, 6, -0.1F); - this.setRotateAngle(Belt, 0.0F, 0.0F, -0.13962634015954636F); - this.bipedBody.addChild(this.Belt); - - this.Left = new ModelRenderer(this, 18, 41); - this.Left.setRotationPoint(0F, 0F, 0F); - this.Left.addBox(-3.5F, 0.0F, -2.5F, 6, 11, 5, 0.01F); - this.setRotateAngle(Left, 0.0F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.Left); - - this.LeftFront = new ModelRenderer(this, 0, 43); - this.LeftFront.setRotationPoint(0F, 0F, 0F); - this.LeftFront.addBox(-3.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); - this.setRotateAngle(LeftFront, -0.2617993877991494F, 0.0F, -0.08726646259971647F); - this.bipedLeftLeg.addChild(this.LeftFront); - - this.RightFront = new ModelRenderer(this, 0, 43); - this.RightFront.mirror = true; - this.RightFront.setRotationPoint(0F, 0F, 0F); - this.RightFront.addBox(-2.5F, 0.27F, -2.4F, 6, 11, 3, 0.0F); - this.setRotateAngle(RightFront, -0.2617993877991494F, 0.0F, 0.08726646259971647F); - this.bipedRightLeg.addChild(this.RightFront); - - //this.bipedBody.isHidden = true; - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - //this.bipedRightLeg.isHidden = true; - //this.bipedLeftLeg.isHidden = true; - this.bipedRightArm.isHidden = true; - this.bipedLeftArm.isHidden = true; - } + super(0.1f, 0, 64, 64); - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); + textureWidth = 64; + textureHeight = 64; + + //High + + LeftHigh = new ModelRenderer(this, "Left Skirt"); + LeftHigh.setTextureOffset(52, 38); + LeftHigh.mirror = true; + LeftHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftHigh.addBox(-7.5F, 8.0F, -2.0F, 2, 7, 4, -0.01F); + setRotateAngle(LeftHigh, 0.0F, 0.0F, -0.9599310885968813F); + bipedBody.addChild(LeftHigh); + + UnderBackLeftHigh = new ModelRenderer(this, "Underside BackLeft Skirt"); + UnderBackLeftHigh.setTextureOffset(8, 57); + UnderBackLeftHigh.mirror = true; + UnderBackLeftHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderBackLeftHigh.addBox(-0.2F, 8.5F, -7.5F, 4, 6, 1, 0.0F); + setRotateAngle(UnderBackLeftHigh, 0.9599310885968813F, 0.7853981633974483F, 0.0F); + bipedBody.addChild(UnderBackLeftHigh); + + FrontRightHigh = new ModelRenderer(this, "Front Right Skirt"); + FrontRightHigh.setTextureOffset(18, 55); + FrontRightHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontRightHigh.addBox(-3.3F, 6.6F, 6.1F, 4, 7, 2, 0.0F); + setRotateAngle(FrontRightHigh, -0.9599310885968813F, 0.2617993877991494F, 0.0F); + bipedBody.addChild(FrontRightHigh); + + RightHigh = new ModelRenderer(this, "Right Skirt"); + RightHigh.setTextureOffset(52, 38); + RightHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + RightHigh.addBox(5.5F, 8.0F, -2.0F, 2, 7, 4, -0.01F); + setRotateAngle(RightHigh, 0.0F, 0.0F, 0.9599310885968813F); + bipedBody.addChild(RightHigh); + + BackUnderHigh = new ModelRenderer(this, "Underside Back Skirt"); + BackUnderHigh.setTextureOffset(8, 57); + BackUnderHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + BackUnderHigh.addBox(-2.0F, 8.0F, -8.0F, 4, 6, 1, 0.0F); + setRotateAngle(BackUnderHigh, 0.9599310885968813F, 0.0F, 0.0F); + bipedBody.addChild(BackUnderHigh); + + UnderFrontHigh = new ModelRenderer(this, "Underside Front Skirt"); + UnderFrontHigh.setTextureOffset(8, 57); + UnderFrontHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderFrontHigh.addBox(-2.0F, 8.0F, 7.0F, 4, 6, 1, 0.0F); + setRotateAngle(UnderFrontHigh, -0.9599310885968813F, 0.0F, 0.0F); + bipedBody.addChild(UnderFrontHigh); + + UnderBackRightHigh = new ModelRenderer(this, + "Underside BackRight Skirt"); + UnderBackRightHigh.setTextureOffset(8, 57); + UnderBackRightHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderBackRightHigh.addBox(-3.8F, 8.5F, -7.5F, 4, 6, 1, 0.0F); + setRotateAngle(UnderBackRightHigh, 0.9599310885968813F, -0.7853981633974483F, 0.0F); + bipedBody.addChild(UnderBackRightHigh); + + BackLHigh = new ModelRenderer(this, "Back Left Skirt"); + BackLHigh.setTextureOffset(18, 55); + BackLHigh.mirror = true; + BackLHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + BackLHigh.addBox(-0.7F, 6.6F, -8.1F, 4, 7, 2, 0.0F); + setRotateAngle(BackLHigh, 0.9599310885968813F, 0.2617993877991494F, 0.0F); + bipedBody.addChild(BackLHigh); + + BackRightHigh = new ModelRenderer(this, "Back Right Skirt"); + BackRightHigh.setTextureOffset(18, 55); + BackRightHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + BackRightHigh.addBox(-3.3F, 6.6F, -8.1F, 4, 7, 2, 0.0F); + setRotateAngle(BackRightHigh, 0.9599310885968813F, -0.2617993877991494F, 0.0F); + bipedBody.addChild(BackRightHigh); + + UnderFrontRightHigh = new ModelRenderer(this, + "Underside FrontRight Skirt"); + UnderFrontRightHigh.setTextureOffset(8, 57); + UnderFrontRightHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderFrontRightHigh.addBox(-3.8F, 8.5F, 6.5F, 4, 6, 1, 0.0F); + setRotateAngle(UnderFrontRightHigh, -0.9599310885968813F, 0.7853981633974483F, 0.0F); + bipedBody.addChild(UnderFrontRightHigh); + + FrontLHigh = new ModelRenderer(this, "Front Left Skirt"); + FrontLHigh.setTextureOffset(18, 55); + FrontLHigh.mirror = true; + FrontLHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontLHigh.addBox(-0.7F, 6.6F, 6.1F, 4, 7, 2, 0.0F); + setRotateAngle(FrontLHigh, -0.9599310885968813F, -0.2617993877991494F, 0.0F); + bipedBody.addChild(FrontLHigh); + + UnderFrontLeftHigh = new ModelRenderer(this, "Under FrontLeft Skirt"); + UnderFrontLeftHigh.setTextureOffset(8, 57); + UnderFrontLeftHigh.mirror = true; + UnderFrontLeftHigh.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderFrontLeftHigh.addBox(-0.2F, 8.5F, 6.5F, 4, 6, 1, 0.0F); + setRotateAngle(UnderFrontLeftHigh, -0.9599310885968813F, -0.7853981633974483F, 0.0F); + bipedBody.addChild(UnderFrontLeftHigh); + + //Mid + FrontMidL = new ModelRenderer(this, "Front Left Dress"); + FrontMidL.setTextureOffset(16, 32); + FrontMidL.mirror = true; + FrontMidL.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontMidL.addBox(-1.9F, -0.6F, -3.2F, 4, 8, 2, 0.0F); + setRotateAngle(FrontMidL, -0.4363323129985824F, 0.0F, 0.0F); + bipedLeftLeg.addChild(FrontMidL); + + UnderBackRightMid = new ModelRenderer(this, "Underside BackRight Dress"); + UnderBackRightMid.setTextureOffset(34, 42); + UnderBackRightMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderBackRightMid.addBox(-3.0F, 3.0F, 0.2F, 6, 8, 2, 0.0F); + setRotateAngle(UnderBackRightMid, 0.4363323129985824F, -0.3490658503988659F, 0.0F); + bipedRightLeg.addChild(UnderBackRightMid); + + BackMidR = new ModelRenderer(this, "BackRight Dress"); + BackMidR.setTextureOffset(28, 32); + BackMidR.setRotationPoint(0.0F, 0.0F, 0.0F); + BackMidR.addBox(-2.1F, -0.7F, 1.1F, 4, 8, 2, 0.0F); + setRotateAngle(BackMidR, 0.4363323129985824F, 0.0F, 0.0F); + bipedRightLeg.addChild(BackMidR); + + UnderLeftMid = new ModelRenderer(this, "Underside Left Dress"); + UnderLeftMid.setTextureOffset(18, 42); + UnderLeftMid.mirror = true; + UnderLeftMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderLeftMid.addBox(0.0F, 3.8F, -3.0F, 2, 7, 6, 0.0F); + setRotateAngle(UnderLeftMid, 0.0F, 0.0F, -0.4363323129985824F); + bipedLeftLeg.addChild(UnderLeftMid); + + UnderFrontLeftMid = new ModelRenderer(this, "Underside FrontLeft Dress"); + UnderFrontLeftMid.setTextureOffset(40, 32); + UnderFrontLeftMid.mirror = true; + UnderFrontLeftMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderFrontLeftMid.addBox(-3.0F, 3.0F, -2.3F, 6, 8, 2, 0.0F); + setRotateAngle(UnderFrontLeftMid, -0.4363323129985824F, -0.3490658503988659F, 0.0F); + bipedLeftLeg.addChild(UnderFrontLeftMid); + + BackLeftMid = new ModelRenderer(this, "Back Left Dress"); + BackLeftMid.setTextureOffset(8, 47); + BackLeftMid.mirror = true; + BackLeftMid.setRotationPoint(0.0F, 0.0F, 0.0F); + BackLeftMid.addBox(-1.3F, -0.4F, 1.5F, 3, 8, 2, 0.0F); + setRotateAngle(BackLeftMid, 0.4363323129985824F, 1.0471975511965976F, 0.0F); + bipedLeftLeg.addChild(BackLeftMid); + + UnderBackLeftMid = new ModelRenderer(this, "Underside BackLeft Dress"); + UnderBackLeftMid.setTextureOffset(34, 42); + UnderBackLeftMid.mirror = true; + UnderBackLeftMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderBackLeftMid.addBox(-3.0F, 3.0F, 0.2F, 6, 8, 2, 0.0F); + setRotateAngle(UnderBackLeftMid, 0.4363323129985824F, 0.3490658503988659F, 0.0F); + bipedLeftLeg.addChild(UnderBackLeftMid); + + UnderFrontRightMid = new ModelRenderer(this, + "Underside FrontRight Dress"); + UnderFrontRightMid.setTextureOffset(40, 32); + UnderFrontRightMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderFrontRightMid.addBox(-3.0F, 3.0F, -2.3F, 6, 8, 2, 0.0F); + setRotateAngle(UnderFrontRightMid, -0.4363323129985824F, 0.3490658503988659F, 0.0F); + bipedRightLeg.addChild(UnderFrontRightMid); + + FrontRightMid = new ModelRenderer(this, "Front Right Dress"); + FrontRightMid.setTextureOffset(8, 47); + FrontRightMid.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontRightMid.addBox(-1.7F, -0.4F, -3.5F, 3, 8, 2, 0.0F); + setRotateAngle(FrontRightMid, -0.4363323129985824F, 1.0471975511965976F, 0.0F); + bipedRightLeg.addChild(FrontRightMid); + + FrontLeftMid = new ModelRenderer(this, "Front Left Dress"); + FrontLeftMid.setTextureOffset(8, 47); + FrontLeftMid.mirror = true; + FrontLeftMid.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontLeftMid.addBox(-1.3F, -0.4F, -3.5F, 3, 8, 2, 0.0F); + setRotateAngle(FrontLeftMid, -0.4363323129985824F, -1.0471975511965976F, 0.0F); + bipedLeftLeg.addChild(FrontLeftMid); + + UnderRightMid = new ModelRenderer(this, "Under Right Dress"); + UnderRightMid.setTextureOffset(18, 42); + UnderRightMid.setRotationPoint(0.0F, 0.0F, 0.0F); + UnderRightMid.addBox(-2.0F, 3.8F, -3.0F, 2, 7, 6, 0.0F); + setRotateAngle(UnderRightMid, 0.0F, 0.0F, 0.4363323129985824F); + bipedRightLeg.addChild(UnderRightMid); + + BackRightMid = new ModelRenderer(this, "Back Right Dress"); + BackRightMid.setTextureOffset(8, 47); + BackRightMid.setRotationPoint(0.0F, 0.0F, 0.0F); + BackRightMid.addBox(-1.7F, -0.4F, 1.5F, 3, 8, 2, 0.0F); + setRotateAngle(BackRightMid, 0.4363323129985824F, -1.0471975511965976F, 0.0F); + bipedRightLeg.addChild(BackRightMid); + + FrontMidR = new ModelRenderer(this, "Front Right Dress"); + FrontMidR.setTextureOffset(16, 32); + FrontMidR.setRotationPoint(0.0F, 0.0F, 0.0F); + FrontMidR.addBox(-2.1F, -0.6F, -3.2F, 4, 8, 2, 0.0F); + setRotateAngle(FrontMidR, -0.4363323129985824F, 0.0F, 0.0F); + bipedRightLeg.addChild(FrontMidR); + + BackMidL = new ModelRenderer(this, "BackLeft Dress"); + BackMidL.setTextureOffset(28, 32); + BackMidL.mirror = true; + BackMidL.setRotationPoint(0.0F, 0.0F, 0.0F); + BackMidL.addBox(-1.9F, -0.7F, 1.1F, 4, 8, 2, 0.0F); + setRotateAngle(BackMidL, 0.4363323129985824F, 0.0F, 0.0F); + bipedLeftLeg.addChild(BackMidL); + + //Low + CenterBackL = new ModelRenderer(this, "Center BackLeft Robe"); + CenterBackL.setTextureOffset(0, 49); + CenterBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterBackL.addBox(-2.9F, -0.2F, 0.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterBackL, 0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(CenterBackL); + + CenterFrontR = new ModelRenderer(this, "Center FrontRight Robe"); + CenterFrontR.setTextureOffset(0, 49); + CenterFrontR.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterFrontR.addBox(0.9F, -0.2F, -2.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterFrontR, -0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(CenterFrontR); + + CenterFrontL = new ModelRenderer(this, "Center FrontLeft Robe"); + CenterFrontL.setTextureOffset(0, 49); + CenterFrontL.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterFrontL.addBox(-2.9F, -0.2F, -2.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterFrontL, -0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(CenterFrontL); + + RightBackL = new ModelRenderer(this, "Right Back Robe"); + RightBackL.setTextureOffset(0, 32); + RightBackL.mirror = true; + RightBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + RightBackL.addBox(-2.2F, -0.3F, -1.5F, 4, 11, 4, 0.0F); + setRotateAngle(RightBackL, 0.08726646259971647F, 0.0F, 0.08726646259971647F); + bipedRightLeg.addChild(RightBackL); + + CenterBackR = new ModelRenderer(this, "Center BackRight Robe"); + CenterBackR.setTextureOffset(0, 49); + CenterBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterBackR.addBox(0.9F, -0.2F, 0.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterBackR, 0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(CenterBackR); + + LeftBackL = new ModelRenderer(this, "Left Back Robe"); + LeftBackL.setTextureOffset(0, 32); + LeftBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftBackL.addBox(-1.8F, -0.3F, -1.5F, 4, 11, 4, 0.0F); + setRotateAngle(LeftBackL, 0.08726646259971647F, 0.0F, -0.08726646259971647F); + bipedLeftLeg.addChild(LeftBackL); + + RightFronL = new ModelRenderer(this, "Right Front Robe"); + RightFronL.setTextureOffset(0, 32); + RightFronL.setRotationPoint(0.0F, 0.0F, 0.0F); + RightFronL.addBox(-2.2F, -0.3F, -2.5F, 4, 11, 4, 0.01F); + setRotateAngle(RightFronL, -0.08726646259971647F, 0.0F, 0.08726646259971647F); + bipedRightLeg.addChild(RightFronL); + + LeftFrontL = new ModelRenderer(this, "Left Front Robe"); + LeftFrontL.setTextureOffset(0, 32); + LeftFrontL.mirror = true; + LeftFrontL.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftFrontL.addBox(-1.8F, -0.3F, -2.5F, 4, 11, 4, 0.01F); + setRotateAngle(LeftFrontL, -0.08726646259971647F, 0.0F, -0.08726646259971647F); + bipedLeftLeg.addChild(LeftFrontL); + + //Belts + BeltRHip = new ModelRenderer(this, "Belt Right Hip"); + BeltRHip.setTextureOffset(32, 55); + BeltRHip.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltRHip.addBox(-3.3F, 0.0F, -3.0F, 10, 3, 6, -0.11F); + setRotateAngle(BeltRHip, 0.0F, 0.0F, -0.13962634015954636F); + bipedRightLeg.addChild(BeltRHip); - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { + BeltLHip = new ModelRenderer(this, "Belt Left Hip"); + BeltLHip.setTextureOffset(32, 55); + BeltLHip.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltLHip.addBox(-6.7F, 0.0F, -3.0F, 10, 3, 6, -0.1F); + setRotateAngle(BeltLHip, 0.0F, 0.0F, 0.13962634015954636F); + bipedLeftLeg.addChild(BeltLHip); - GL11.glPushMatrix(); + BeltStraight = new ModelRenderer(this, "Belt Straight"); + BeltStraight.setTextureOffset(34, 55); + BeltStraight.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltStraight.addBox(-4.5F, 10.5F, -3.0F, 9, 3, 6, -0.1F); + bipedBody.addChild(BeltStraight); - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); + BackLHigh.isHidden = true; + BackRightHigh.isHidden = true; + BackUnderHigh.isHidden = true; + FrontLHigh.isHidden = true; + FrontRightHigh.isHidden = true; + LeftHigh.isHidden = true; + RightHigh.isHidden = true; + UnderBackLeftHigh.isHidden = true; + UnderBackRightHigh.isHidden = true; + UnderFrontHigh.isHidden = true; + UnderFrontLeftHigh.isHidden = true; + UnderFrontRightHigh.isHidden = true; - GL11.glPopMatrix(); - } - } + BackLeftMid.isHidden = true; + BackMidL.isHidden = true; + BackMidR.isHidden = true; + BackRightMid.isHidden = true; + FrontLeftMid.isHidden = true; + FrontMidL.isHidden = true; + FrontMidR.isHidden = true; + FrontRightMid.isHidden = true; + UnderBackLeftMid.isHidden = true; + UnderBackRightMid.isHidden = true; + UnderFrontLeftMid.isHidden = true; + UnderFrontRightMid.isHidden = true; + UnderLeftMid.isHidden = true; + UnderRightMid.isHidden = true; - GL11.glPopMatrix(); + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java index 387463e..20a6317 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShawl.java @@ -1,125 +1,167 @@ package lance5057.tDefense.armor.renderers.cloth; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * ModelTinkersShawl - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersShawl extends ArmorRenderer { - public ModelRenderer ShawlLeft1; - public ModelRenderer ShawlLeft2; - public ModelRenderer ShawlRight1; - public ModelRenderer ShawlRight2; public ModelRenderer Button; - public ModelRenderer TopLeft; - public ModelRenderer TopRight; - public ModelRenderer ArmLeft; - public ModelRenderer ArmRight; - public ModelRenderer Chest; + public ModelRenderer Zipper; + public ModelRenderer ArmTrimL; + public ModelRenderer ArmTrimR; + public ModelRenderer TrimNeck; + public ModelRenderer ButtonArmL; + public ModelRenderer ButtonArmR; + public ModelRenderer ShawlLeftShort; + public ModelRenderer ShawlRightShort; + public ModelRenderer ShawlLeftTrim; + public ModelRenderer TrimShawl; + public ModelRenderer ShawlRightTrim; + public ModelRenderer ZipperShort; + public ModelRenderer ShawlLeftLong; + public ModelRenderer ShawlLeftTrimLong; + public ModelRenderer ShawlRightLong; + public ModelRenderer ShawlRightTrimLong; public ModelTinkersShawl() { - super(1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.ArmLeft = new ModelRenderer(this, 48, 48); - this.ArmLeft.mirror = true; - this.ArmLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmLeft.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.02F); - this.bipedLeftArm.addChild(this.ArmLeft); - - this.ArmRight = new ModelRenderer(this, 48, 48); - this.ArmRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmRight.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.02F); - this.bipedRightArm.addChild(this.ArmRight); - - this.Chest = new ModelRenderer(this, 40, 32); - this.Chest.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Chest.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.02F); - this.bipedBody.addChild(this.Chest); - - this.TopRight = new ModelRenderer(this, 0, 52); - this.TopRight.mirror = true; - this.TopRight.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopRight.addBox(-3.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); - this.bipedRightArm.addChild(this.TopRight); - - this.Button = new ModelRenderer(this, 0, 61); - this.Button.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Button.addBox(0.0F, 0.0F, -3.5F, 2, 2, 1, 0.0F); - this.setRotateAngle(Button, 0.0F, 0.0F, 0.7853981633974483F); - this.bipedBody.addChild(this.Button); - - this.TopLeft = new ModelRenderer(this, 0, 52); - this.TopLeft.setRotationPoint(0.0F, 0.0F, 0.0F); - this.TopLeft.addBox(-5.5F, -2.3F, -3.0F, 9, 3, 6, -0.01F); - this.bipedLeftArm.addChild(this.TopLeft); - - this.ShawlRight1 = new ModelRenderer(this, 0, 32); - this.ShawlRight1.mirror = true; - this.ShawlRight1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlRight1.addBox(-4.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlRight1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedRightArm.addChild(this.ShawlRight1); - - this.ShawlRight2 = new ModelRenderer(this, 0, 43); - this.ShawlRight2.mirror = true; - this.ShawlRight2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlRight2.addBox(-1.9F, 0.8F, -3.0F, 6, 3, 6, 0.01F); - this.setRotateAngle(ShawlRight2, 0.0F, 0.0F, -0.6981317007977318F); - this.bipedRightArm.addChild(this.ShawlRight2); - - this.ShawlLeft1 = new ModelRenderer(this, 0, 32); - this.ShawlLeft1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlLeft1.addBox(-2.0F, -1.3F, -3.0F, 6, 5, 6, 0.0F); - this.setRotateAngle(ShawlLeft1, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftArm.addChild(this.ShawlLeft1); - - this.ShawlLeft2 = new ModelRenderer(this, 0, 43); - this.ShawlLeft2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShawlLeft2.addBox(-4.1F, 0.8F, -3.0F, 6, 3, 6, 0.1F); - this.setRotateAngle(ShawlLeft2, 0.0F, 0.0F, 0.6981317007977318F); - this.bipedLeftArm.addChild(this.ShawlLeft2); - - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - this.bipedCloak.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + TrimNeck = new ModelRenderer(this, "Collar"); + TrimNeck.setTextureOffset(20, 32); + TrimNeck.setRotationPoint(0.0F, 0.0F, 0.0F); + TrimNeck.addBox(-4.5F, -0.5F, -2.5F, 9, 2, 5, -0.3F); + bipedBody.addChild(TrimNeck); + + Button = new ModelRenderer(this, "Collar Button"); + Button.setTextureOffset(15, 32); + Button.setRotationPoint(0.0F, 0.0F, 0.0F); + Button.addBox(-1.5F, -0.5F, -2.5F, 2, 2, 1, -0.2F); + setRotateAngle(Button, 0.0F, 0.0F, -0.7853981633974483F); + bipedBody.addChild(Button); + + ButtonArmL = new ModelRenderer(this, "Button Arm Left"); + ButtonArmL.setTextureOffset(23, 39); + ButtonArmL.mirror = true; + ButtonArmL.setRotationPoint(0.0F, 0.0F, 0.0F); + ButtonArmL.addBox(2.5F, 3.0F, -5.0F, 1, 2, 2, -0.2F); + setRotateAngle(ButtonArmL, 0.7853981633974483F, 0.0F, 0.0F); + bipedLeftArm.addChild(ButtonArmL); + + ButtonArmR = new ModelRenderer(this, "Button Arm Right"); + ButtonArmR.setTextureOffset(23, 39); + ButtonArmR.setRotationPoint(0.0F, 0.0F, 0.0F); + ButtonArmR.addBox(-3.5F, 3.0F, -5.0F, 1, 2, 2, -0.2F); + setRotateAngle(ButtonArmR, 0.7853981633974483F, 0.0F, 0.0F); + bipedRightArm.addChild(ButtonArmR); + + ArmTrimR = new ModelRenderer(this, "Arm Trim Right"); + ArmTrimR.setTextureOffset(0, 32); + ArmTrimR.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmTrimR.addBox(-3.5F, 5.0F, -2.5F, 5, 2, 5, -0.3F); + bipedRightArm.addChild(ArmTrimR); + + ArmTrimL = new ModelRenderer(this, "Arm Trim Left"); + ArmTrimL.setTextureOffset(0, 32); + ArmTrimL.mirror = true; + ArmTrimL.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmTrimL.addBox(-1.5F, 5.0F, -2.5F, 5, 2, 5, -0.3F); + bipedLeftArm.addChild(ArmTrimL); + + ZipperShort = new ModelRenderer(this, "Zipper Bottom"); + ZipperShort.setTextureOffset(30, 53); + ZipperShort.setRotationPoint(0.0F, 0.0F, 0.0F); + ZipperShort.addBox(-1.0F, 6.3F, -2.5F, 2, 5, 1, -0.3F); + bipedBody.addChild(ZipperShort); + + Zipper = new ModelRenderer(this, "Zipper Top"); + Zipper.setTextureOffset(30, 52); + Zipper.setRotationPoint(0.0F, 0.0F, 0.0F); + Zipper.addBox(-1.0F, 0.2F, -2.5F, 2, 7, 1, -0.3F); + bipedBody.addChild(Zipper); + + ShawlLeftTrim = new ModelRenderer(this, "Shawl Left Trim"); + ShawlLeftTrim.setTextureOffset(28, 39); + ShawlLeftTrim.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlLeftTrim.addBox(-5.1F, 2.45F, -2.5F, 9, 2, 5, -0.29F); + setRotateAngle(ShawlLeftTrim, 0.0F, 0.0F, -0.2792526803190927F); + bipedLeftArm.addChild(ShawlLeftTrim); + + ShawlRightTrim = new ModelRenderer(this, "Shawl Right Trim Short"); + ShawlRightTrim.setTextureOffset(28, 39); + ShawlRightTrim.mirror = true; + ShawlRightTrim.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlRightTrim.addBox(-3.95F, 2.45F, -2.5F, 9, 2, 5, -0.29F); + setRotateAngle(ShawlRightTrim, 0.0F, 0.0F, 0.2792526803190927F); + bipedRightArm.addChild(ShawlRightTrim); + + ShawlRightTrimLong = new ModelRenderer(this, "Shawl Right Trim Long"); + ShawlRightTrimLong.setTextureOffset(0, 39); + ShawlRightTrimLong.mirror = true; + ShawlRightTrimLong.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlRightTrimLong.addBox(-3.95F, 7.85F, -2.5F, 9, 2, 5, -0.29F); + setRotateAngle(ShawlRightTrimLong, 0.0F, 0.0F, 0.2792526803190927F); + bipedRightArm.addChild(ShawlRightTrimLong); + + ShawlLeftTrimLong = new ModelRenderer(this, "Shawl Left Trim Long"); + ShawlLeftTrimLong.setTextureOffset(0, 39); + ShawlLeftTrimLong.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlLeftTrimLong.addBox(-5.1F, 7.85F, -2.5F, 9, 2, 5, -0.29F); + setRotateAngle(ShawlLeftTrimLong, 0.0F, 0.0F, -0.2792526803190927F); + bipedLeftArm.addChild(ShawlLeftTrimLong); + + ShawlLeftLong = new ModelRenderer(this, "Shawl Left Long"); + ShawlLeftLong.setTextureOffset(38, 50); + ShawlLeftLong.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlLeftLong.addBox(-4.55F, -1.05F, -2.0F, 8, 10, 4, 0.11F); + setRotateAngle(ShawlLeftLong, 0.0F, 0.0F, -0.2792526803190927F); + bipedLeftArm.addChild(ShawlLeftLong); + + ShawlRightLong = new ModelRenderer(this, "Shawl Right Long"); + ShawlRightLong.setTextureOffset(38, 50); + ShawlRightLong.mirror = true; + ShawlRightLong.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlRightLong.addBox(-3.45F, -1.05F, -2.0F, 8, 10, 4, 0.11F); + setRotateAngle(ShawlRightLong, 0.0F, 0.0F, 0.2792526803190927F); + bipedRightArm.addChild(ShawlRightLong); + + ShawlLeftShort = new ModelRenderer(this, "Shawl Left Short"); + ShawlLeftShort.setTextureOffset(38, 50); + ShawlLeftShort.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlLeftShort.addBox(-1.55F, -1.05F, -2.0F, 5, 5, 4, 0.01F); + setRotateAngle(ShawlLeftShort, 0.0F, 0.0F, -0.2792526803190927F); + bipedLeftArm.addChild(ShawlLeftShort); + + ShawlRightShort = new ModelRenderer(this, "Shawl Right Short"); + ShawlRightShort.setTextureOffset(38, 50); + ShawlRightShort.mirror = true; + ShawlRightShort.setRotationPoint(0.0F, 0.0F, 0.0F); + ShawlRightShort.addBox(-3.45F, -1.05F, -2.0F, 5, 5, 4, 0.01F); + setRotateAngle(ShawlRightShort, 0.0F, 0.0F, 0.2792526803190927F); + bipedRightArm.addChild(ShawlRightShort); + + TrimShawl = new ModelRenderer(this, "Trim Shawl Short"); + TrimShawl.setTextureOffset(20, 32); + TrimShawl.setRotationPoint(0.0F, 0.0F, 0.0F); + TrimShawl.addBox(-4.5F, 5.5F, -2.5F, 9, 2, 5, -0.31F); + bipedBody.addChild(TrimShawl); + + ArmTrimL.isHidden = true; + ArmTrimR.isHidden = true; + ShawlLeftTrim.isHidden = true; + ShawlRightTrim.isHidden = true; + TrimShawl.isHidden = true; + Zipper.isHidden = true; + ZipperShort.isHidden = true; + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShoes.java b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShoes.java new file mode 100644 index 0000000..8bd6dc9 --- /dev/null +++ b/src/main/java/lance5057/tDefense/armor/renderers/cloth/ModelTinkersShoes.java @@ -0,0 +1,79 @@ +package lance5057.tDefense.armor.renderers.cloth; + +import lance5057.tDefense.armor.renderers.ArmorRenderer; +import net.minecraft.client.model.ModelRenderer; + +/** + * ModelTinkersShoes - Either Mojang or a mod author + * Created using Tabula 4.1.1 + */ +public class ModelTinkersShoes extends ArmorRenderer +{ + public ModelRenderer FootL; + public ModelRenderer FootR; + public ModelRenderer OverLegL; + public ModelRenderer OverLegR; + public ModelRenderer ShoeL; + public ModelRenderer ShoeR; + + public ModelTinkersShoes() + { + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + FootL = new ModelRenderer(this, "Foot Left"); + FootL.setTextureOffset(16, 41); + FootL.setRotationPoint(0F, 0F, 0F); + FootL.addBox(-2F, 10.1F, -3.0F, 4, 2, 1, 0.2F); + bipedLeftLeg.addChild(FootL); + + FootR = new ModelRenderer(this, "Foot Right"); + FootR.setTextureOffset(16, 41); + FootR.setRotationPoint(0F, 0F, 0F); + FootR.addBox(-2F, 10.1F, -3.0F, 4, 2, 1, 0.2F); + bipedRightLeg.addChild(FootR); + + OverLegL = new ModelRenderer(this, "Over Leg Left"); + OverLegL.setTextureOffset(0, 32); + OverLegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.2F); + OverLegL.setRotationPoint(0F, 0F, 0F); + bipedLeftLeg.addChild(OverLegL); + + OverLegR = new ModelRenderer(this, "Over Leg Right"); + OverLegR.setTextureOffset(0, 32); + OverLegR.mirror = true; + OverLegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.2F); + OverLegR.setRotationPoint(0F, 0F, 0F); + bipedRightLeg.addChild(OverLegR); + + ShoeL = new ModelRenderer(this, "Shoe Left"); + ShoeL.setTextureOffset(16, 32); + ShoeL.addBox(-2.0F, 7.0F, -2.0F, 4, 5, 4, 0.21F); + ShoeL.setRotationPoint(0F, 0F, 0F); + bipedLeftLeg.addChild(ShoeL); + + ShoeR = new ModelRenderer(this, "Shoe Right"); + ShoeR.setTextureOffset(16, 32); + ShoeR.mirror = true; + ShoeR.addBox(-2.0F, 7.0F, -2.0F, 4, 5, 4, 0.21F); + ShoeR.setRotationPoint(0F, 0F, 0F); + bipedRightLeg.addChild(ShoeR); + + OverLegL.isHidden = true; + OverLegR.isHidden = true; + + init(); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java index 1f04e13..24ba37a 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersBreastplate.java @@ -1,11 +1,7 @@ package lance5057.tDefense.armor.renderers.heavy; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -import org.lwjgl.opengl.GL11; /** * ModelBiped - Either Mojang or a mod author @@ -16,106 +12,156 @@ public class ModelTinkersBreastplate extends ArmorRenderer public ModelRenderer BackPlate; public ModelRenderer BreastPlate; public ModelRenderer Plackart; + public ModelRenderer WingR; + public ModelRenderer WingL; public ModelRenderer PauldronR; - public ModelRenderer ArmGuardR; public ModelRenderer PauldronL; - public ModelRenderer ArmGuardL; - public ModelRenderer ArmL; public ModelRenderer ArmR; - public ModelRenderer BreastPlateFront; + public ModelRenderer ArmL; + public ModelRenderer PauldronExtraR; + public ModelRenderer PauldronExtraL; + public ModelRenderer PauldronR_1; + public ModelRenderer ArmR_1; + public ModelRenderer PauldronL_1; + public ModelRenderer ArmL_1; public ModelTinkersBreastplate() { - super(1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.BreastPlate = new ModelRenderer(this, 0, 32); - this.BreastPlate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BreastPlate.addBox(-4.0F, 0.1F, -3.6F, 8, 6, 4, 0.1F); - this.bipedBody.addChild(this.BreastPlate); - - this.BreastPlateFront = new ModelRenderer(this, 22, 56); - this.BreastPlateFront.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BreastPlateFront.addBox(-3.0F, 0.5F, -4.2F, 6, 4, 4, 0.1F); - this.bipedBody.addChild(this.BreastPlateFront); - - this.Plackart = new ModelRenderer(this, 0, 42); - this.Plackart.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Plackart.addBox(-4.0F, 5.0F, -3.0F, 8, 7, 6, 0.01F); - this.bipedBody.addChild(this.Plackart); - - this.ArmGuardR = new ModelRenderer(this, 28, 44); - this.ArmGuardR.mirror = true; - this.ArmGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmGuardR.addBox(-4.0F, -2.0F, -3.0F, 5, 6, 6, 0.0F); - this.bipedRightArm.addChild(this.ArmGuardR); - - this.ArmGuardL = new ModelRenderer(this, 28, 44); - this.ArmGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmGuardL.addBox(-1.0F, -2.0F, -3.0F, 5, 6, 6, 0.0F); - this.bipedLeftArm.addChild(this.ArmGuardL); - - this.PauldronR = new ModelRenderer(this, 24, 32); - this.PauldronR.mirror = true; - this.PauldronR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.PauldronR.addBox(-4.6F, -2.0F, -3.5F, 4, 5, 7, 0.0F); - this.setRotateAngle(PauldronR, 0.0F, -0.0F, 0.4363323129985824F); - this.bipedRightArm.addChild(this.PauldronR); - - this.ArmL = new ModelRenderer(this, 48, 34); - this.ArmL.mirror = true; - this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); - this.setRotateAngle(ArmL, 0.0F, 0.0F, 0.0017453292519943296F); - this.bipedLeftArm.addChild(this.ArmL); - - this.ArmR = new ModelRenderer(this, 48, 34); - this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1F); - this.bipedRightArm.addChild(this.ArmR); - - this.BackPlate = new ModelRenderer(this, 0, 56); - this.BackPlate.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BackPlate.addBox(-4.0F, 0.0F, 1.0F, 8, 5, 3, 0.0F); - this.setRotateAngle(BackPlate, -0.08726646006107329F, -0.0F, 0.0F); - this.bipedBody.addChild(this.BackPlate); - - this.PauldronL = new ModelRenderer(this, 24, 32); - this.PauldronL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.PauldronL.addBox(0.5F, -2.0F, -3.5F, 4, 5, 7, 0.0F); - this.setRotateAngle(PauldronL, 0.0F, -0.0F, -0.4363323129985824F); - this.bipedLeftArm.addChild(this.PauldronL); - - // this.ArmR.offsetX = this.ArmR.offsetX + 0.04f; - - this.bipedHead.isHidden = true; - this.bipedHeadwear.isHidden = true; - this.bipedCloak.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 128, 64); + + textureWidth = 128; + textureHeight = 64; + + bipedBody = new ModelRenderer(this, "Body"); + bipedBody.setTextureOffset(16, 16); + bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.1f); + bipedBody.setRotationPoint(0.0F, 0.0F + 0, 0.0F); + + bipedRightArm = new ModelRenderer(this, "Right Arm"); + bipedRightArm.setTextureOffset(40, 16); + bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.1f); + bipedRightArm.setRotationPoint(-5.0F, 2.0F + 0, 0.0F); + + bipedLeftArm = new ModelRenderer(this, "Left Arm"); + bipedLeftArm.setTextureOffset(40, 16); + bipedLeftArm.mirror = true; + bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.1f); + bipedLeftArm.setRotationPoint(5.0F, 2.0F + 0, 0.0F); + + ArmR = new ModelRenderer(this, "Arm Right Overlay"); + ArmR.setTextureOffset(28, 44); + ArmR.mirror = true; + ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmR.addBox(-4.0F, -2.2F, -3.0F, 5, 6, 6, 0.0F); + bipedRightArm.addChild(ArmR); + + ArmR_1 = new ModelRenderer(this, "Arm Overlay Right 2"); + ArmR_1.setTextureOffset(94, 0); + ArmR_1.mirror = true; + ArmR_1.setRotationPoint(-0.0F, 0.0F, 0.0F); + ArmR_1.addBox(-4.5F, -2.0F, -3.0F, 6, 7, 6, 0.1F); + setRotateAngle(ArmR_1, 0.0F, -0.0F, -0.17453292519943295F); + bipedRightArm.addChild(ArmR_1); + + ArmL = new ModelRenderer(this, "Arm Overlay Left"); + ArmL.setTextureOffset(28, 44); + ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmL.addBox(-1.0F, -2.2F, -3.0F, 5, 6, 6, 0.0F); + bipedLeftArm.addChild(ArmL); + + ArmL_1 = new ModelRenderer(this, "Arm Left Overlay 2"); + ArmL_1.setTextureOffset(94, 0); + ArmL_1.setRotationPoint(0.0F, 0.0F, 0.0F); + ArmL_1.addBox(-1.0F, -2.0F, -3.0F, 6, 7, 6, 0.1F); + setRotateAngle(ArmL_1, 0.0F, -0.0F, 0.17453292519943295F); + bipedLeftArm.addChild(ArmL_1); + + PauldronL = new ModelRenderer(this, "Pauldron Left"); + PauldronL.setTextureOffset(24, 32); + PauldronL.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronL.addBox(0.6F, -2.0F, -3.5F, 4, 5, 7, 0.0F); + setRotateAngle(PauldronL, 0.0F, -0.0F, -0.4363323129985824F); + bipedLeftArm.addChild(PauldronL); + + PauldronR = new ModelRenderer(this, "Pauldron Right"); + PauldronR.setTextureOffset(24, 32); + PauldronR.mirror = true; + PauldronR.setRotationPoint(-0.0F, 0.0F, 0.0F); + PauldronR.addBox(-4.8F, -2.0F, -3.5F, 4, 5, 7, 0.0F); + setRotateAngle(PauldronR, 0.0F, -0.0F, 0.4363323129985824F); + bipedRightArm.addChild(PauldronR); + + PauldronExtraL = new ModelRenderer(this, "Pauldron Extra Left"); + PauldronExtraL.setTextureOffset(56, 19); + PauldronExtraL.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronExtraL.addBox(0.0F, -12.0F, 0.0F, 13, 18, 0, 0.0F); + bipedLeftArm.addChild(PauldronExtraL); + + PauldronExtraR = new ModelRenderer(this, "Pauldron Extra Right"); + PauldronExtraR.setTextureOffset(56, 19); + PauldronExtraR.mirror = true; + PauldronExtraR.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronExtraR.addBox(-12.0F, -12.0F, 0.0F, 13, 18, 0, 0.0F); + bipedRightArm.addChild(PauldronExtraR); + + PauldronR_1 = new ModelRenderer(this, "Pauldron Right 2"); + PauldronR_1.setTextureOffset(64, 0); + PauldronR_1.mirror = true; + PauldronR_1.setRotationPoint(-0.0F, 0.0F, 0.0F); + PauldronR_1.addBox(-5.5F, -8.0F, -4.0F, 7, 11, 8, 0.1F); + setRotateAngle(PauldronR_1, 0.0F, -0.0F, 0.2617993877991494F); + bipedRightArm.addChild(PauldronR_1); + + PauldronL_1 = new ModelRenderer(this, "Pauldron Left 2"); + PauldronL_1.setTextureOffset(64, 0); + PauldronL_1.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronL_1.addBox(-1.5F, -8.0F, -4.0F, 7, 11, 8, 0.1F); + setRotateAngle(PauldronL_1, 0.0F, -0.0F, -0.2617993877991494F); + bipedLeftArm.addChild(PauldronL_1); + + WingL = new ModelRenderer(this, "Wing Left"); + WingL.setTextureOffset(82, 5); + WingL.setRotationPoint(0.0F, 0.0F, 0.0F); + WingL.addBox(0.0F, -6.0F, 3.0F, 0, 28, 14, 0.0F); + setRotateAngle(WingL, 0.0F, -0.2617993877991494F, 0.0F); + bipedBody.addChild(WingL); + + WingR = new ModelRenderer(this, "Wing Right"); + WingR.setTextureOffset(82, 5); + WingR.setRotationPoint(0.0F, 0.0F, 0.0F); + WingR.addBox(0.0F, -6.0F, 3.0F, 0, 28, 14, 0.0F); + setRotateAngle(WingR, 0.0F, 0.2617993877991494F, 0.0F); + bipedBody.addChild(WingR); + + Plackart = new ModelRenderer(this, "Plackart"); + Plackart.setTextureOffset(0, 42); + Plackart.setRotationPoint(0.0F, 0.0F, 0.0F); + Plackart.addBox(-4.0F, 5.0F, -3.0F, 8, 7, 6, 0.0F); + bipedBody.addChild(Plackart); + + BreastPlate = new ModelRenderer(this, "BreastPlate"); + BreastPlate.setTextureOffset(0, 32); + BreastPlate.setRotationPoint(0.0F, 0.0F, 0.0F); + BreastPlate.addBox(-4.0F, 0.1F, -3.6F, 8, 6, 4, 0.1F); + bipedBody.addChild(BreastPlate); + + BackPlate = new ModelRenderer(this, "Back Plate"); + BackPlate.setTextureOffset(0, 56); + BackPlate.setRotationPoint(0.0F, 0.0F, 0.0F); + BackPlate.addBox(-4.0F, 0.0F, 1.0F, 8, 5, 3, 0.0F); + setRotateAngle(BackPlate, -0.08726646006107329F, -0.0F, 0.0F); + bipedBody.addChild(BackPlate); + + WingL.isHidden = true; + WingR.isHidden = true; + PauldronL_1.isHidden = true; + PauldronR_1.isHidden = true; + ArmL_1.isHidden = true; + ArmR_1.isHidden = true; + PauldronExtraL.isHidden = true; + PauldronExtraR.isHidden = true; + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGauntlets.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGauntlets.java deleted file mode 100644 index a63b402..0000000 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGauntlets.java +++ /dev/null @@ -1,104 +0,0 @@ -package lance5057.tDefense.armor.renderers.heavy; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; -import lance5057.tDefense.armor.renderers.ArmorRenderer; -import net.minecraft.client.model.ModelBiped; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -/** - * TinkersGauntlets - Either Mojang or a mod author - * Created using Tabula 4.1.1 - */ -public class ModelTinkersGauntlets extends ArmorRenderer -{ - public ModelRenderer BracerL; - public ModelRenderer RivetL; - public ModelRenderer MittL; - public ModelRenderer BracerR; - public ModelRenderer RivetR; - public ModelRenderer MittR; - - public ModelTinkersGauntlets() - { - super(0.15f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.BracerR = new ModelRenderer(this, 0, 56); - this.BracerR.mirror = true; - this.BracerR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BracerR.addBox(-3.3F, 4.0F, -2.0F, 3, 4, 4, 0.2F); - this.setRotateAngle(BracerR, 0.0F, 0.0F, -0.03490658503988659F); - this.bipedRightArm.addChild(BracerR); - - this.RivetL = new ModelRenderer(this, 0, 47); - this.RivetL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RivetL.addBox(0.0F, 7.0F, -3.0F, 2, 2, 6, -0.5F); - this.bipedLeftArm.addChild(RivetL); - - this.BracerL = new ModelRenderer(this, 0, 56); - this.BracerL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BracerL.addBox(0.3F, 4.0F, -2.0F, 3, 4, 4, 0.2F); - this.setRotateAngle(BracerL, 0.0F, 0.0F, 0.03490658503988659F); - this.bipedLeftArm.addChild(BracerL); - - this.MittL = new ModelRenderer(this, 0, 41); - this.MittL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.MittL.addBox(1.4F, 7.9F, -2.0F, 2, 2, 4, 0.3F); - this.setRotateAngle(MittL, 0.0F, 0.0F, 0.03490658503988659F); - this.bipedLeftArm.addChild(MittL); - - this.RivetR = new ModelRenderer(this, 0, 47); - this.RivetR.mirror = true; - this.RivetR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RivetR.addBox(-2.0F, 7.0F, -3.0F, 2, 2, 6, -0.5F); - this.bipedRightArm.addChild(RivetR); - - this.MittR = new ModelRenderer(this, 0, 41); - this.MittR.mirror = true; - this.MittR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.MittR.addBox(-3.4F, 7.9F, -2.0F, 2, 2, 4, 0.3F); - this.setRotateAngle(MittR, 0.0F, 0.0F, -0.03490658503988659F); - this.bipedRightArm.addChild(MittR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java index 58cd8cf..534f917 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersGrieves.java @@ -1,15 +1,7 @@ package lance5057.tDefense.armor.renderers.heavy; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** * TinkersGrieves - Either Mojang or a mod author @@ -23,85 +15,180 @@ public class ModelTinkersGrieves extends ArmorRenderer public ModelRenderer LegPlateBackR; public ModelRenderer LegPlateR; public ModelRenderer Belt; - public ModelRenderer LeftLeg; - public ModelRenderer RightLeg; + public ModelRenderer BeltBuckle; + public ModelRenderer ThighR; + public ModelRenderer ThighL; + public ModelRenderer ThighRB; + public ModelRenderer ThighLB; + public ModelRenderer SecBeltR; + public ModelRenderer SecBeltL; + public ModelRenderer LeftFrontL; + public ModelRenderer LeftBackL; + public ModelRenderer CenterBackL; + public ModelRenderer CenterBackR; + public ModelRenderer RightFrontL; + public ModelRenderer RightBackL; + public ModelRenderer CenterFrontL; + public ModelRenderer CenterFrontR; public ModelTinkersGrieves() { - super(1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.LegPlateBackL = new ModelRenderer(this, 0, 43); - this.LegPlateBackL.mirror = true; - this.LegPlateBackL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateBackL.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); - this.setRotateAngle(LegPlateBackL, 0.2617993877991494F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.LegPlateBackL); - - this.LegPlateR = new ModelRenderer(this, 0, 32); - this.LegPlateR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateR.addBox(1.1F, 0.0F, -1.9F, 1, 5, 4, 0.1F); - this.setRotateAngle(LegPlateR, 0.0F, 3.141592653589793F, 0.2617993877991494F); - this.bipedRightLeg.addChild(this.LegPlateR); - - this.LeftLeg = new ModelRenderer(this, 32, 32); - this.LeftLeg.mirror = true; - this.LeftLeg.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.05F); - this.bipedLeftLeg.addChild(this.LeftLeg); - - this.LegPlateL = new ModelRenderer(this, 0, 32); - this.LegPlateL.mirror = true; - this.LegPlateL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateL.addBox(1.1F, 0.0F, -2.1F, 1, 5, 4, 0.1F); - this.setRotateAngle(LegPlateL, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftLeg.addChild(this.LegPlateL); - - this.CodPiece = new ModelRenderer(this, 0, 50); - this.CodPiece.setRotationPoint(0.0F, 0.0F, 0.0F); - this.CodPiece.addBox(-2.0F, 10.0F, -2.8F, 4, 4, 3, 0.2F); - this.bipedBody.addChild(this.CodPiece); - - this.LegPlateBackR = new ModelRenderer(this, 0, 43); - this.LegPlateBackR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegPlateBackR.addBox(-2.0F, 0.0F, 1.2F, 4, 5, 1, 0.1F); - this.setRotateAngle(LegPlateBackR, 0.2617993877991494F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.LegPlateBackR); - - this.RightLeg = new ModelRenderer(this, 32, 32); - this.RightLeg.setRotationPoint(0.0F, 0.0F, 0.0F); - this.RightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.05F); - this.bipedRightLeg.addChild(this.RightLeg); - - this.Belt = new ModelRenderer(this, 8, 56); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-4F, 10.0F, -3F, 8, 2, 6, 0.25F); - this.bipedBody.addChild(this.Belt); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + SecBeltL = new ModelRenderer(this, "Hip Belt Left"); + SecBeltL.setTextureOffset(12, 56); + SecBeltL.setRotationPoint(0.0F, 0.0F, 0.0F); + SecBeltL.addBox(-1.0F, 11.5F, -2.8F, 9, 2, 6, 0.16F); + setRotateAngle(SecBeltL, 0.0F, 0.0F, 0.2617993877991494F); + bipedBody.addChild(SecBeltL); + + CodPiece = new ModelRenderer(this, "CodPiece"); + CodPiece.setTextureOffset(0, 49); + CodPiece.setRotationPoint(0.0F, 0.0F, 0.0F); + CodPiece.addBox(-2.5F, 11.0F, -3.2F, 5, 5, 3, -0.4F); + bipedBody.addChild(CodPiece); + + ThighL = new ModelRenderer(this, "Thigh Left Front"); + ThighL.setTextureOffset(12, 32); + ThighL.mirror = true; + ThighL.setRotationPoint(0.0F, 0.0F, 0.0F); + ThighL.addBox(-2.0F, 0.0F, -2.5F, 4, 6, 4, 0.2F); + setRotateAngle(ThighL, 0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(ThighL); + + ThighLB = new ModelRenderer(this, "Thigh Left Back"); + ThighLB.setTextureOffset(13, 42); + ThighLB.mirror = true; + ThighLB.setRotationPoint(0.0F, 0.0F, 0.0F); + ThighLB.addBox(-2.0F, 0.0F, -1.5F, 4, 6, 4, 0.1F); + setRotateAngle(ThighLB, -0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(ThighLB); + + SecBeltR = new ModelRenderer(this, "Hip Belt Right"); + SecBeltR.setTextureOffset(12, 56); + SecBeltR.setRotationPoint(0.0F, 0.0F, 0.0F); + SecBeltR.addBox(-8.0F, 11.5F, -2.8F, 9, 2, 6, 0.15F); + setRotateAngle(SecBeltR, 0.0F, 0.0F, -0.2617993877991494F); + bipedBody.addChild(SecBeltR); + + CenterFrontL = new ModelRenderer(this, "Center Front"); + CenterFrontL.setTextureOffset(29, 43); + CenterFrontL.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterFrontL.addBox(-2.9F, -0.2F, -2.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterFrontL, -0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(CenterFrontL); + + CenterFrontR = new ModelRenderer(this, "Center Front"); + CenterFrontR.setTextureOffset(29, 43); + CenterFrontR.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterFrontR.addBox(0.9F, -0.2F, -2.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterFrontR, -0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(CenterFrontR); + + LegPlateBackR = new ModelRenderer(this, "Leg Plate Back Right"); + LegPlateBackR.setTextureOffset(0, 43); + LegPlateBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + LegPlateBackR.addBox(-2.0F, 0.1F, 2.1F, 4, 5, 1, 0.0F); + setRotateAngle(LegPlateBackR, 0.2617993877991494F, 0.0F, 0.0F); + bipedRightLeg.addChild(LegPlateBackR); + + Belt = new ModelRenderer(this, "Belt"); + Belt.setTextureOffset(12, 56); + Belt.setRotationPoint(0.0F, 0.0F, 0.0F); + Belt.addBox(-4.5F, 10.0F, -2.8F, 9, 2, 6, 0.25F); + bipedBody.addChild(Belt); + + ThighR = new ModelRenderer(this, "Thigh Right"); + ThighR.setTextureOffset(12, 32); + ThighR.setRotationPoint(0.0F, 0.0F, 0.0F); + ThighR.addBox(-2.0F, 0.0F, -2.5F, 4, 6, 4, 0.2F); + setRotateAngle(ThighR, 0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(ThighR); + + ThighRB = new ModelRenderer(this, "Thigh Right Back"); + ThighRB.setTextureOffset(13, 42); + ThighRB.setRotationPoint(0.0F, 0.0F, 0.0F); + ThighRB.addBox(-2.0F, 0.0F, -1.5F, 4, 6, 4, 0.1F); + setRotateAngle(ThighRB, -0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(ThighRB); + + LegPlateL = new ModelRenderer(this, "Leg Plate Left"); + LegPlateL.setTextureOffset(0, 32); + LegPlateL.mirror = true; + LegPlateL.setRotationPoint(0.0F, 0.0F, 0.0F); + LegPlateL.addBox(1.6F, -0.1F, -2.5F, 1, 5, 5, 0.1F); + setRotateAngle(LegPlateL, 0.0F, 0.0F, -0.2617993877991494F); + bipedLeftLeg.addChild(LegPlateL); + + RightBackL = new ModelRenderer(this, "Right Back Left"); + RightBackL.setTextureOffset(42, 34); + RightBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + RightBackL.addBox(-2.2F, -0.3F, -1.5F, 4, 11, 4, 0.0F); + setRotateAngle(RightBackL, 0.08726646259971647F, 0.0F, 0.08726646259971647F); + bipedRightLeg.addChild(RightBackL); + + LeftBackL = new ModelRenderer(this, "Left Back Left"); + LeftBackL.setTextureOffset(42, 34); + LeftBackL.mirror = true; + LeftBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftBackL.addBox(-1.8F, -0.3F, -1.5F, 4, 11, 4, 0.0F); + setRotateAngle(LeftBackL, 0.08726646259971647F, 0.0F, -0.08726646259971647F); + bipedLeftLeg.addChild(LeftBackL); + + LegPlateR = new ModelRenderer(this, "Leg Plate Right"); + LegPlateR.setTextureOffset(0, 32); + LegPlateR.setRotationPoint(0.0F, 0.0F, 0.0F); + LegPlateR.addBox(-2.6F, -0.1F, -2.5F, 1, 5, 5, 0.1F); + setRotateAngle(LegPlateR, 0.0F, 0.0F, 0.2617993877991494F); + bipedRightLeg.addChild(LegPlateR); + + RightFrontL = new ModelRenderer(this, "Right Front Left"); + RightFrontL.setTextureOffset(42, 49); + RightFrontL.setRotationPoint(0.0F, 0.0F, 0.0F); + RightFrontL.addBox(-2.2F, -0.3F, -2.5F, 4, 11, 4, 0.0F); + setRotateAngle(RightFrontL, -0.08726646259971647F, 0.0F, 0.08726646259971647F); + bipedRightLeg.addChild(RightFrontL); + + BeltBuckle = new ModelRenderer(this, "Belt Buckle"); + BeltBuckle.setTextureOffset(0, 58); + BeltBuckle.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltBuckle.addBox(-2.0F, 9.0F, -3.5F, 4, 4, 2, -0.3F); + bipedBody.addChild(BeltBuckle); + + LegPlateBackL = new ModelRenderer(this, "Leg Plate Back Left"); + LegPlateBackL.setTextureOffset(0, 43); + LegPlateBackL.mirror = true; + LegPlateBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + LegPlateBackL.addBox(-2.0F, 0.1F, 2.1F, 4, 5, 1, 0.0F); + setRotateAngle(LegPlateBackL, 0.2617993877991494F, 0.0F, 0.0F); + bipedLeftLeg.addChild(LegPlateBackL); + + LeftFrontL = new ModelRenderer(this, "Left Front Left"); + LeftFrontL.setTextureOffset(42, 49); + LeftFrontL.mirror = true; + LeftFrontL.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftFrontL.addBox(-1.8F, -0.3F, -2.5F, 4, 11, 4, 0.0F); + setRotateAngle(LeftFrontL, -0.08726646259971647F, 0.0F, -0.08726646259971647F); + bipedLeftLeg.addChild(LeftFrontL); + + CenterBackL = new ModelRenderer(this, "Center Back Left"); + CenterBackL.setTextureOffset(29, 43); + CenterBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterBackL.addBox(-2.9F, -0.2F, 0.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterBackL, 0.08726646259971647F, 0.0F, 0.0F); + bipedLeftLeg.addChild(CenterBackL); + + CenterBackR = new ModelRenderer(this, "Center Back Right"); + CenterBackR.setTextureOffset(29, 43); + CenterBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + CenterBackR.addBox(0.9F, -0.2F, 0.5F, 2, 11, 2, 0.0F); + setRotateAngle(CenterBackR, 0.08726646259971647F, 0.0F, 0.0F); + bipedRightLeg.addChild(CenterBackR); + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java index 005b182..8e35b7c 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersHelm.java @@ -1,15 +1,7 @@ package lance5057.tDefense.armor.renderers.heavy; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** * TinkerHelm - Either Mojang or a mod author @@ -18,59 +10,201 @@ import cpw.mods.fml.client.FMLClientHandler; public class ModelTinkersHelm extends ArmorRenderer { public ModelRenderer Visor; + public ModelRenderer Helm2; + public ModelRenderer WingR; + public ModelRenderer WingL; public ModelRenderer Helm; public ModelRenderer Trim; + public ModelRenderer HornR; + public ModelRenderer HornL; + public ModelRenderer HornTipR; + public ModelRenderer HornTipL; + public ModelRenderer FeatherRod; + public ModelRenderer Feathers; + public ModelRenderer FeatherBase; + public ModelRenderer HornR_1; + public ModelRenderer HornL_1; + public ModelRenderer HornTipR_1; + public ModelRenderer HornTipL_1; + public ModelRenderer HornR_2; + public ModelRenderer HornL_2; + public ModelRenderer HornTipR_2; + public ModelRenderer HornTipL_2; + public ModelRenderer SpikeBase; + public ModelRenderer Spike2; + public ModelRenderer Spike1; public ModelTinkersHelm() { - super(1.5f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - this.Helm = new ModelRenderer(this, 0, 47); - this.Helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Helm.addBox(-4.0F, -8.0F, -4.0F, 8, 9, 8, 0.5F); - this.bipedHead.addChild(this.Helm); - - this.Visor = new ModelRenderer(this, 0, 32); - this.Visor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Visor.addBox(-4.5F, -6.5F, -4.7F, 9, 5, 8, 0.1F); - this.bipedHead.addChild(this.Visor); - - this.Trim = new ModelRenderer(this, 44, 47); - this.Trim.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Trim.addBox(-1.0F, -8.3F, -4.0F, 2, 9, 8, 0.7F); - this.bipedHead.addChild(this.Trim); - - this.bipedBody.isHidden = true; - this.bipedCloak.isHidden = true; - this.bipedLeftArm.isHidden = true; - this.bipedLeftLeg.isHidden = true; - this.bipedRightArm.isHidden = true; - this.bipedRightLeg.isHidden = true; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 128, 64); + + textureWidth = 128; + textureHeight = 64; + + HornR = new ModelRenderer(this, "Horn Right"); + HornR.setTextureOffset(26, 32); + HornR.setRotationPoint(0.0F, -2.0F, 0.0F); + HornR.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornR, 0.0F, 0.0F, 0.7853981633974483F); + bipedHead.addChild(HornR); + + HornTipR = new ModelRenderer(this, "Horn Tip Right"); + HornTipR.setTextureOffset(26, 32); + HornTipR.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipR.addBox(-0.8F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipR, 0.0F, 0.0F, 2.007128639793479F); + + HornR_1 = new ModelRenderer(this, "Horn Right 2"); + HornR_1.setTextureOffset(26, 32); + HornR_1.setRotationPoint(2.25F, -6.0F, 2.0F); + HornR_1.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornR_1, 1.3962634015954636F, 0.2617993877991494F, 1.5707963267948966F); + bipedHead.addChild(HornR_1); + + HornTipR_1 = new ModelRenderer(this, "Horn Tip Right 2"); + HornTipR_1.setTextureOffset(26, 32); + HornTipR_1.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipR_1.addBox(-0.8F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipR_1, 0.0F, 0.0F, 2.007128639793479F); + + HornR_2 = new ModelRenderer(this, "Horn Right 3"); + HornR_2.setTextureOffset(26, 32); + HornR_2.setRotationPoint(1.75F, -3.0F, 4.0F); + HornR_2.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornR_2, 1.3962634015954636F, -0.2617993877991494F, 1.5707963267948966F); + bipedHead.addChild(HornR_2); + + HornTipR_2 = new ModelRenderer(this, "Horn Tip Right 3"); + HornTipR_2.setTextureOffset(26, 32); + HornTipR_2.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipR_2.addBox(-0.8F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipR_2, 0.0F, 0.0F, 2.007128639793479F); + + HornL = new ModelRenderer(this, "Horn Left"); + HornL.setTextureOffset(26, 32); + HornL.setRotationPoint(0.0F, -2.0F, 0.0F); + HornL.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornL, 0.0F, 0.0F, -0.7853981633974483F); + bipedHead.addChild(HornL); + + HornTipL = new ModelRenderer(this, "Horn Tip Left"); + HornTipL.setTextureOffset(26, 32); + HornTipL.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipL.addBox(-1.2F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipL, 0.0F, 0.0F, -2.007128639793479F); + + HornL_1 = new ModelRenderer(this, "Horn Left 2"); + HornL_1.setTextureOffset(26, 32); + HornL_1.setRotationPoint(-2.25F, -6.0F, 2.0F); + HornL_1.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornL_1, 1.3962634015954636F, -0.2617993877991494F, -1.5707963267948966F); + bipedHead.addChild(HornL_1); + + HornTipL_1 = new ModelRenderer(this, "Horn Tip Left 2"); + HornTipL_1.setTextureOffset(26, 32); + HornTipL_1.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipL_1.addBox(-1.2F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipL_1, 0.0F, 0.0F, -2.007128639793479F); + + HornL_2 = new ModelRenderer(this, "Horn Left 3"); + HornL_2.setTextureOffset(26, 32); + HornL_2.setRotationPoint(-1.75F, -3.0F, 4.0F); + HornL_2.addBox(-1.0F, -10.0F, -1.0F, 2, 5, 2, 0.25F); + setRotateAngle(HornL_2, 1.3962634015954636F, 0.2617993877991494F, -1.5707963267948966F); + bipedHead.addChild(HornL_2); + + HornTipL_2 = new ModelRenderer(this, "Horn Tip Left 3"); + HornTipL_2.setTextureOffset(26, 32); + HornTipL_2.setRotationPoint(0.0F, -10.0F, 0.0F); + HornTipL_2.addBox(-1.2F, -1.0F, -1.0F, 2, 6, 2, 0.0F); + setRotateAngle(HornTipL_2, 0.0F, 0.0F, -2.007128639793479F); + + FeatherBase = new ModelRenderer(this, "Feather Base"); + FeatherBase.setTextureOffset(64, 13); + FeatherBase.setRotationPoint(0.0F, 0.0F, 0.0F); + FeatherBase.addBox(-2.0F, -10.0F, -5.3F, 4, 1, 9, 0.0F); + setRotateAngle(FeatherBase, -0.08726646259971647F, 0.0F, 0.0F); + bipedHead.addChild(FeatherBase); + + WingL = new ModelRenderer(this, "Wing Left"); + WingL.setTextureOffset(0, 44); + WingL.setRotationPoint(0.0F, 0.0F, 0.0F); + WingL.addBox(5.7F, -11.0F, -3.5F, 0, 12, 8, 0.0F); + setRotateAngle(WingL, 0.0F, 0.2617993877991494F, 0.0F); + bipedHead.addChild(WingL); + + Trim = new ModelRenderer(this, "Trim"); + Trim.setTextureOffset(64, 23); + Trim.setRotationPoint(0.0F, 0.0F, 0.0F); + Trim.addBox(-1.0F, -8.3F, -4.0F, 2, 9, 8, 0.7F); + bipedHead.addChild(Trim); + + Visor = new ModelRenderer(this, "Visor"); + Visor.setTextureOffset(0, 32); + Visor.setRotationPoint(0.0F, 0.0F, 0.0F); + Visor.addBox(-4.5F, -9.5F, -4.7F, 9, 12, 8, 0.1F); + bipedHead.addChild(Visor); + + Feathers = new ModelRenderer(this, "Feathers"); + Feathers.setTextureOffset(64, 0); + Feathers.setRotationPoint(0.0F, 0.0F, 0.0F); + Feathers.addBox(-2.0F, -12.7F, -6.1F, 4, 4, 9, -0.3F); + setRotateAngle(Feathers, -0.17453292519943295F, 0.0F, 0.0F); + bipedHead.addChild(Feathers); + + FeatherRod = new ModelRenderer(this, "Feather Rod"); + FeatherRod.setTextureOffset(0, 32); + FeatherRod.setRotationPoint(0.0F, 0.0F, 0.0F); + FeatherRod.addBox(-1.0F, -9.3F, -1.2F, 2, 1, 2, 0.2F); + bipedHead.addChild(FeatherRod); + + Helm2 = new ModelRenderer(this, "Heavy Visor"); + Helm2.setTextureOffset(34, 32); + Helm2.setRotationPoint(0.0F, 0.0F, 0.0F); + Helm2.addBox(-4.0F, -9.0F, -4.0F, 8, 10, 8, 0.6F); + bipedHead.addChild(Helm2); + + Spike1 = new ModelRenderer(this, "Spike"); + Spike1.setTextureOffset(16, 52); + Spike1.setRotationPoint(0.0F, 0.0F, 0.0F); + Spike1.addBox(-2.5F, -14.0F, 0.0F, 5, 5, 0, 0.0F); + bipedHead.addChild(Spike1); + + SpikeBase = new ModelRenderer(this, "Spike Base"); + SpikeBase.setTextureOffset(66, 40); + SpikeBase.setRotationPoint(0.0F, 0.0F, 0.0F); + SpikeBase.addBox(-2.0F, -8.6F, -2.0F, 4, 1, 4, 0.5F); + bipedHead.addChild(SpikeBase); + + Spike2 = new ModelRenderer(this, "Spike"); + Spike2.setTextureOffset(16, 47); + Spike2.setRotationPoint(0.0F, 0.0F, 0.0F); + Spike2.addBox(0.0F, -14.0F, -2.5F, 0, 5, 5, 0.0F); + bipedHead.addChild(Spike2); + + Helm = new ModelRenderer(this, "Helm"); + Helm.setTextureOffset(64, 47); + Helm.setRotationPoint(0.0F, 0.0F, 0.0F); + Helm.addBox(-4.0F, -8.0F, -4.0F, 8, 9, 8, 0.5F); + bipedHead.addChild(Helm); + + WingR = new ModelRenderer(this, "Wing Right"); + WingR.setTextureOffset(0, 44); + WingR.setRotationPoint(0.0F, 0.0F, 0.0F); + WingR.addBox(-5.7F, -11.0F, -3.5F, 0, 12, 8, 0.0F); + setRotateAngle(WingR, 0.0F, -0.2617993877991494F, 0.0F); + bipedHead.addChild(WingR); + + HornR.addChild(HornTipR); + HornL.addChild(HornTipL); + + HornL_1.addChild(HornTipL_1); + HornR_1.addChild(HornTipR_1); + + HornL_2.addChild(HornTipL_2); + HornR_2.addChild(HornTipR_2); + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java index ca24d32..bb88643 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/heavy/ModelTinkersSabatons.java @@ -1,24 +1,16 @@ package lance5057.tDefense.armor.renderers.heavy; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * TinkersSabatons - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersSabatons extends ArmorRenderer { public ModelRenderer BootL; - public ModelRenderer KneeGuardR; + public ModelRenderer FlairBackR; public ModelRenderer ShinGuardL; public ModelRenderer KneeGuardCapL; public ModelRenderer LegBackL; @@ -27,110 +19,161 @@ public class ModelTinkersSabatons extends ArmorRenderer public ModelRenderer BootCapR; public ModelRenderer BootCapL; public ModelRenderer LegBackR; - public ModelRenderer KneeGuardL; + public ModelRenderer FlairL; public ModelRenderer KneeGuardCapR; + public ModelRenderer BootTipR; + public ModelRenderer BootTipL; + public ModelRenderer KneeGuardR; + public ModelRenderer KneeGuardL; + public ModelRenderer FlairR; + public ModelRenderer BackFlairL; public ModelTinkersSabatons() { - super(1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.ShinGuardL = new ModelRenderer(this, 0, 48); - this.ShinGuardL.mirror = true; - this.ShinGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShinGuardL.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); - this.setRotateAngle(ShinGuardL, 0.05759586531581287F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.ShinGuardL); - - this.KneeGuardL = new ModelRenderer(this, 6, 32); - this.KneeGuardL.mirror = true; - this.KneeGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardL.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); - this.bipedLeftLeg.addChild(this.KneeGuardL); - - this.BootL = new ModelRenderer(this, 0, 56); - this.BootL.mirror = true; - this.BootL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootL.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); - this.bipedLeftLeg.addChild(this.BootL); - - this.KneeGuardCapL = new ModelRenderer(this, 0, 37); - this.KneeGuardCapL.mirror = true; - this.KneeGuardCapL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardCapL.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); - this.bipedLeftLeg.addChild(this.KneeGuardCapL); - - this.KneeGuardR = new ModelRenderer(this, 6, 32); - this.KneeGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardR.addBox(-2.0F, 3.0F, -2.5F, 4, 3, 4, 0.2F); - this.bipedRightLeg.addChild(this.KneeGuardR); - - this.LegBackL = new ModelRenderer(this, 0, 40); - this.LegBackL.mirror = true; - this.LegBackL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegBackL.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); - this.setRotateAngle(LegBackL, 0.05759586531581287F, 3.141592653589793F, 0.0F); - this.bipedLeftLeg.addChild(this.LegBackL); - - this.BootCapL = new ModelRenderer(this, 0, 33); - this.BootCapL.mirror = true; - this.BootCapL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootCapL.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); - this.setRotateAngle(BootCapL, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedLeftLeg.addChild(this.BootCapL); - - this.KneeGuardCapR = new ModelRenderer(this, 0, 37); - this.KneeGuardCapR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.KneeGuardCapR.addBox(-1.0F, 2.4F, -3.0F, 2, 2, 1, 0.2F); - this.bipedRightLeg.addChild(this.KneeGuardCapR); - - this.BootR = new ModelRenderer(this, 0, 56); - this.BootR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootR.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); - this.bipedRightLeg.addChild(this.BootR); - - this.ShinGuardR = new ModelRenderer(this, 0, 48); - this.ShinGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ShinGuardR.addBox(-2.0F, 4.0F, -2.6F, 4, 5, 3, 0.11F); - this.setRotateAngle(ShinGuardR, 0.05759586531581287F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.ShinGuardR); - - this.LegBackR = new ModelRenderer(this, 0, 40); - this.LegBackR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegBackR.addBox(-2.0F, 3.0F, -2.6F, 4, 6, 2, 0.1F); - this.setRotateAngle(LegBackR, 0.05759586531581287F, 3.141592653589793F, 0.0F); - this.bipedRightLeg.addChild(this.LegBackR); - - this.BootCapR = new ModelRenderer(this, 0, 33); - this.BootCapR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.BootCapR.addBox(-1.0F, 9.1F, -5.2F, 2, 2, 1, 0.2F); - this.setRotateAngle(BootCapR, 0.17453292519943295F, 0.0F, 0.0F); - this.bipedRightLeg.addChild(this.BootCapR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + BootR = new ModelRenderer(this, "Boot Right"); + BootR.setTextureOffset(0, 56); + BootR.setRotationPoint(0.0F, 0.0F, 0.0F); + BootR.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); + bipedRightLeg.addChild(BootR); + + BootL = new ModelRenderer(this, "Boot Left"); + BootL.setTextureOffset(0, 56); + BootL.mirror = true; + BootL.setRotationPoint(0.0F, 0.0F, 0.0F); + BootL.addBox(-2.0F, 9.0F, -3.0F, 4, 3, 5, 0.2F); + bipedLeftLeg.addChild(BootL); + + KneeGuardR = new ModelRenderer(this, "Knee Guard Right"); + KneeGuardR.setTextureOffset(0, 32); + KneeGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); + KneeGuardR.addBox(-2.0F, 3.1F, -2.5F, 4, 3, 4, 0.3F); + bipedRightLeg.addChild(KneeGuardR); + + KneeGuardL = new ModelRenderer(this, "Knee Guard Left"); + KneeGuardL.setTextureOffset(0, 32); + KneeGuardL.mirror = true; + KneeGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); + KneeGuardL.addBox(-2.0F, 3.1F, -2.5F, 4, 3, 4, 0.3F); + bipedLeftLeg.addChild(KneeGuardL); + + ShinGuardR = new ModelRenderer(this, "Shin Guard Right"); + ShinGuardR.setTextureOffset(0, 48); + ShinGuardR.setRotationPoint(0.0F, 0.0F, 0.0F); + ShinGuardR.addBox(-2.0F, 4.0F, -2.5F, 4, 5, 3, 0.11F); + setRotateAngle(ShinGuardR, 0.05759586531581287F, 0.0F, 0.0F); + bipedRightLeg.addChild(ShinGuardR); + + ShinGuardL = new ModelRenderer(this, "Shin Guard Left"); + ShinGuardL.setTextureOffset(0, 48); + ShinGuardL.mirror = true; + ShinGuardL.setRotationPoint(0.0F, 0.0F, 0.0F); + ShinGuardL.addBox(-2.0F, 4.0F, -2.5F, 4, 5, 3, 0.11F); + setRotateAngle(ShinGuardL, 0.05759586531581287F, 0.0F, 0.0F); + bipedLeftLeg.addChild(ShinGuardL); + + LegBackL = new ModelRenderer(this, "Leg Back Left"); + LegBackL.setTextureOffset(0, 40); + LegBackL.mirror = true; + LegBackL.setRotationPoint(0.0F, 0.0F, 0.0F); + LegBackL.addBox(-2.0F, 3.0F, 0.6F, 4, 6, 2, 0.1F); + setRotateAngle(LegBackL, -0.05759586531581287F, 0.0F, 0.0F); + bipedLeftLeg.addChild(LegBackL); + + LegBackR = new ModelRenderer(this, "Leg Back Right"); + LegBackR.setTextureOffset(0, 40); + LegBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + LegBackR.addBox(-2.0F, 3.0F, 0.6F, 4, 6, 2, 0.1F); + setRotateAngle(LegBackR, -0.05759586531581287F, 0.0F, 0.0F); + bipedRightLeg.addChild(LegBackR); + + FlairR = new ModelRenderer(this, "Flair Right"); + FlairR.setTextureOffset(18, 53); + FlairR.setRotationPoint(0.0F, 0.0F, 0.0F); + FlairR.addBox(0.9F, 0.2F, -2.5F, 5, 11, 0, 0.0F); + setRotateAngle(FlairR, 0.0F, -0.6108652381980153F, 0.0F); + bipedLeftLeg.addChild(FlairR); + + FlairL = new ModelRenderer(this, "Flair Left"); + FlairL.setTextureOffset(18, 53); + FlairL.mirror = true; + FlairL.setRotationPoint(0.0F, 0.0F, 0.0F); + FlairL.addBox(-5.9F, 0.2F, -2.5F, 5, 11, 0, 0.0F); + setRotateAngle(FlairL, 0.0F, 0.6108652381980153F, 0.0F); + bipedRightLeg.addChild(FlairL); + + FlairBackR = new ModelRenderer(this, "Flair Back Right"); + FlairBackR.setTextureOffset(28, 47); + FlairBackR.setRotationPoint(0.0F, 0.0F, 0.0F); + FlairBackR.addBox(0.0F, 0.0F, 2.0F, 0, 12, 5, 0.0F); + bipedRightLeg.addChild(FlairBackR); + + BackFlairL = new ModelRenderer(this, "Flair Back Left"); + BackFlairL.setTextureOffset(28, 47); + BackFlairL.mirror = true; + BackFlairL.setRotationPoint(0.0F, 0.0F, 0.0F); + BackFlairL.addBox(0.0F, 0.0F, 2.0F, 0, 12, 5, 0.0F); + bipedLeftLeg.addChild(BackFlairL); + + KneeGuardCapR = new ModelRenderer(this, "Knee Guard Cap Right"); + KneeGuardCapR.setTextureOffset(16, 36); + KneeGuardCapR.setRotationPoint(0.0F, 0.0F, 0.0F); + KneeGuardCapR.addBox(-1.5F, 2.4F, -3.8F, 3, 2, 1, 0.2F); + setRotateAngle(KneeGuardCapR, 0.17453292519943295F, 0.0F, 0.0F); + bipedRightLeg.addChild(KneeGuardCapR); + + KneeGuardCapL = new ModelRenderer(this, "Knee Guard Cap Left"); + KneeGuardCapL.setTextureOffset(16, 36); + KneeGuardCapL.mirror = true; + KneeGuardCapL.setRotationPoint(0.0F, 0.0F, 0.0F); + KneeGuardCapL.addBox(-1.5F, 2.4F, -3.8F, 3, 2, 1, 0.2F); + setRotateAngle(KneeGuardCapL, 0.17453292519943295F, 0.0F, 0.0F); + bipedLeftLeg.addChild(KneeGuardCapL); + + BootTipR = new ModelRenderer(this, "Boot Tip Right"); + BootTipR.setTextureOffset(22, 32); + BootTipR.setRotationPoint(0.0F, 0.0F, 0.0F); + BootTipR.addBox(-1.4F, 10.0F, -2.5F, 3, 2, 2, -0.1F); + setRotateAngle(BootTipR, -0.3490658503988659F, 0.0F, 0.0F); + bipedRightLeg.addChild(BootTipR); + + BootCapR = new ModelRenderer(this, "Boot Cap Right"); + BootCapR.setTextureOffset(12, 32); + BootCapR.setRotationPoint(0.0F, 0.0F, 0.0F); + BootCapR.addBox(-1.5F, 10.0F, -2.5F, 3, 2, 2, 0.3F); + setRotateAngle(BootCapR, -0.17453292519943295F, 0.0F, 0.0F); + bipedRightLeg.addChild(BootCapR); + + BootTipL = new ModelRenderer(this, "Boot Tip Left"); + BootTipL.setTextureOffset(22, 32); + BootTipL.mirror = true; + BootTipL.setRotationPoint(0.0F, 0.0F, 0.0F); + BootTipL.addBox(-1.5F, 10.0F, -2.6F, 3, 2, 2, -0.1F); + setRotateAngle(BootTipL, -0.3490658503988659F, 0.0F, 0.0F); + bipedLeftLeg.addChild(BootTipL); + + BootCapL = new ModelRenderer(this, "Boot Cap Left"); + BootCapL.setTextureOffset(12, 32); + BootCapL.mirror = true; + BootCapL.setRotationPoint(0.0F, 0.0F, 0.0F); + BootCapL.addBox(-1.5F, 10.0F, -2.5F, 3, 2, 2, 0.3F); + setRotateAngle(BootCapL, -0.17453292519943295F, 0.0F, 0.0F); + bipedLeftLeg.addChild(BootCapL); + + BootCapL.isHidden = true; + BootCapR.isHidden = true; + BootTipL.isHidden = true; + BootTipR.isHidden = true; + FlairBackR.isHidden = true; + BackFlairL.isHidden = true; + FlairL.isHidden = true; + FlairR.isHidden = true; + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java index 41dff40..3294e83 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersBoots.java @@ -1,76 +1,89 @@ package lance5057.tDefense.armor.renderers.light; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * ModelTinkersBoots - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersBoots extends ArmorRenderer { - public ModelRenderer LegR; - public ModelRenderer LegL; + public ModelRenderer BootTopR; + public ModelRenderer BootTopL; public ModelRenderer FootL; public ModelRenderer FootR; + public ModelRenderer LegGuardL; + public ModelRenderer LegGuardR; + public ModelRenderer FootTipL; + public ModelRenderer FootTipR; public ModelTinkersBoots() { - super(1.1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.FootL = new ModelRenderer(this, 0, 43); - this.FootL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootL.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.01F); - this.bipedLeftLeg.addChild(this.FootL); - - this.LegL = new ModelRenderer(this, 0, 48); - this.LegL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.01F); - this.bipedLeftLeg.addChild(this.LegL); - - this.FootR = new ModelRenderer(this, 0, 43); - this.FootR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.FootR.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.01F); - this.bipedRightLeg.addChild(this.FootR); - - this.LegR = new ModelRenderer(this, 0, 48); - this.LegR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.01F); - this.bipedRightLeg.addChild(this.LegR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + FootR = new ModelRenderer(this, "FootR"); + FootR.setTextureOffset(0, 41); + FootR.setRotationPoint(0f, 0f, 0f); + FootR.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); + bipedRightLeg.addChild(FootR); + + BootTopR = new ModelRenderer(this, "BootTopR"); + BootTopR.setTextureOffset(0, 32); + BootTopR.setRotationPoint(0f, 0f, 0f); + BootTopR.addBox(-2.5F, 3.5F, -2.5F, 5, 4, 5, -0.2F); + bipedRightLeg.addChild(BootTopR); + + BootTopL = new ModelRenderer(this, "BootTopL"); + BootTopL.setTextureOffset(0, 32); + BootTopL.setRotationPoint(0f, 0f, 0f); + BootTopL.addBox(-2.5F, 3.5F, -2.5F, 5, 4, 5, -0.2F); + bipedLeftLeg.addChild(BootTopL); + + LegGuardR = new ModelRenderer(this, "LegGuardR"); + LegGuardR.setTextureOffset(0, 44); + LegGuardR.setRotationPoint(0f, 0f, 0f); + LegGuardR.addBox(-2.0F, 5.5F, -3.8F, 4, 4, 2, 0.2F); + setRotateAngle(LegGuardR, 0.17453292519943295F, 0.0F, 0.0F); + bipedRightLeg.addChild(LegGuardR); + + FootTipR = new ModelRenderer(this, "FootTipR"); + FootTipR.setTextureOffset(10, 41); + FootTipR.setRotationPoint(0f, 0f, 0f); + FootTipR.addBox(-1.5F, 9.5F, -5.6F, 3, 2, 2, -0.2F); + setRotateAngle(FootTipR, 0.17453292519943295F, 0.0F, 0.0F); + bipedRightLeg.addChild(FootTipR); + + FootL = new ModelRenderer(this, "FootL"); + FootL.setTextureOffset(0, 41); + FootL.mirror = true; + FootL.setRotationPoint(0f, 0f, 0f); + FootL.addBox(-2.0F, 10.0F, -3.0F, 4, 2, 1, 0.0F); + bipedLeftLeg.addChild(FootL); + + LegGuardL = new ModelRenderer(this, "LegGuardL"); + LegGuardL.setTextureOffset(0, 44); + LegGuardL.setRotationPoint(0f, 0f, 0f); + LegGuardL.addBox(-2.0F, 5.5F, -3.8F, 4, 4, 2, 0.2F); + setRotateAngle(LegGuardL, 0.17453292519943295F, 0.0F, 0.0F); + bipedLeftLeg.addChild(LegGuardL); + + FootTipL = new ModelRenderer(this, "FootTipL"); + FootTipL.setTextureOffset(10, 41); + FootTipL.setRotationPoint(0f, 0f, 0f); + FootTipL.addBox(-1.5F, 9.5F, -5.6F, 3, 2, 2, -0.2F); + setRotateAngle(FootTipL, 0.17453292519943295F, 0.0F, 0.0F); + bipedLeftLeg.addChild(FootTipL); + + BootTopL.isHidden = true; + BootTopR.isHidden = true; + FootTipL.isHidden = true; + FootTipR.isHidden = true; + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java index 010e06b..b667ef2 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersChausses.java @@ -1,109 +1,122 @@ package lance5057.tDefense.armor.renderers.light; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * ModelTinkersChausses - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersChausses extends ArmorRenderer { - public ModelRenderer LegL; public ModelRenderer FrontL; + public ModelRenderer FrontR; public ModelRenderer HipGuardL; public ModelRenderer HipGuardR; - public ModelRenderer LegR; public ModelRenderer BackL; - public ModelRenderer FrontR; public ModelRenderer BackR; + public ModelRenderer HipGuardL_1; + public ModelRenderer HipGuardR_1; public ModelRenderer Belt; + public ModelRenderer BeltR; + public ModelRenderer BeltL; public ModelTinkersChausses() { - super(1.1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.Belt = new ModelRenderer(this, 16, 54); - this.Belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Belt.addBox(-4.5F, 10.0F, -3F, 9, 2, 6, 0.1F); - this.bipedBody.addChild(this.Belt); - - this.HipGuardR = new ModelRenderer(this, 10, 37); - this.HipGuardR.setRotationPoint(0F, 0F, 0F); - this.HipGuardR.addBox(-2.5F, 0.0F, -2.5F, 4, 6, 5, 0.01F); - this.setRotateAngle(HipGuardR, 0.0F, 0.0F, 0.17453292519943295F); - this.bipedRightLeg.addChild(this.HipGuardR); - - this.LegL = new ModelRenderer(this, 0, 48); - this.LegL.setRotationPoint(0F, 0F, 0F); - this.LegL.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.01F); - this.bipedLeftLeg.addChild(this.LegL); - - this.BackR = new ModelRenderer(this, 0, 40); - this.BackR.setRotationPoint(0F, 0F, 0F); - this.BackR.addBox(-0.1F, 0.0F, 1.7F, 4, 7, 1, 0.02F); - this.bipedRightLeg.addChild(this.BackR); - - this.FrontL = new ModelRenderer(this, 0, 40); - this.FrontL.setRotationPoint(0F, 0F, 0F); - this.FrontL.addBox(-4.0F, 0.0F, -2.7F, 4, 7, 1, 0.01F); - this.bipedLeftLeg.addChild(this.FrontL); - - this.LegR = new ModelRenderer(this, 0, 48); - this.LegR.setRotationPoint(0F, 0F, 0F); - this.LegR.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.01F); - this.bipedRightLeg.addChild(this.LegR); - - this.BackL = new ModelRenderer(this, 0, 40); - this.BackL.setRotationPoint(0F, 0F, 0F); - this.BackL.addBox(-4.0F, 0.0F, 1.7F, 4, 7, 1, 0.01F); - this.bipedLeftLeg.addChild(this.BackL); - - this.FrontR = new ModelRenderer(this, 0, 40); - this.FrontR.setRotationPoint(0F, 0F, 0F); - this.FrontR.addBox(-0.1F, 0.0F, -2.7F, 4, 7, 1, 0.02F); - this.bipedRightLeg.addChild(this.FrontR); - - this.HipGuardL = new ModelRenderer(this, 10, 37); - this.HipGuardL.mirror = true; - this.HipGuardL.setRotationPoint(0F, 0F, 0F); - this.HipGuardL.addBox(-1.5F, 0.0F, -2.5F, 4, 6, 5, 0.01F); - this.setRotateAngle(HipGuardL, 0.0F, 0.0F, -0.17453292519943295F); - this.bipedLeftLeg.addChild(this.HipGuardL); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + bipedRightLeg = new ModelRenderer(this, "Right Leg"); + bipedRightLeg.setTextureOffset(0, 16); + bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.1f); + bipedRightLeg.setRotationPoint(-1.9F, 12.0F + 0, 0.0F); + + bipedLeftLeg = new ModelRenderer(this, "Left Leg"); + bipedLeftLeg.setTextureOffset(0, 16); + bipedLeftLeg.mirror = true; + bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.1f); + bipedLeftLeg.setRotationPoint(1.9F, 12.0F + 0, 0.0F); + + HipGuardR = new ModelRenderer(this, "Hip Guard Right"); + HipGuardR.setTextureOffset(0, 49); + HipGuardR.setRotationPoint(0f, 0f, 0f); + HipGuardR.addBox(-2.5F, 0.0F, -2.6F, 4, 6, 5, 0.1F); + setRotateAngle(HipGuardR, 0.0F, 0.0F, 0.17453292519943295F); + bipedRightLeg.addChild(HipGuardR); + + Belt = new ModelRenderer(this, "Belt"); + Belt.setTextureOffset(18, 48); + Belt.setRotationPoint(0.0F, 0.0F, 0.0F); + Belt.addBox(-5.0F, 10.5F, -3.0F, 10, 2, 6, -0.19F); + bipedBody.addChild(Belt); + + FrontR = new ModelRenderer(this, "Front Right"); + FrontR.setTextureOffset(0, 40); + FrontR.setRotationPoint(1.9f, 0f, -0.1f); + FrontR.addBox(-2.0F, 0.0F, -2.4F, 4, 7, 1, 0.0F); + setRotateAngle(FrontR, -0.1F, 0.0F, 0.0f); + bipedRightLeg.addChild(FrontR); + + FrontL = new ModelRenderer(this, "Front Left"); + FrontL.setTextureOffset(0, 40); + FrontL.setRotationPoint(-1.9f, 0f, -0.1f); + FrontL.addBox(-2.0F, 0.0F, -2.4F, 4, 7, 1, 0.0F); + setRotateAngle(FrontL, -0.1F, 0.0F, 0.0f); + bipedLeftLeg.addChild(FrontL); + + HipGuardL_1 = new ModelRenderer(this, "Hip Guard Left 2"); + HipGuardL_1.setTextureOffset(10, 37); + HipGuardL_1.mirror = true; + HipGuardL_1.setRotationPoint(0f, 0f, 0f); + HipGuardL_1.addBox(-1.5F, 0.0F, -2.6F, 4, 10, 5, 0.0F); + setRotateAngle(HipGuardL_1, 0.0F, 0.0F, -0.08726646259971647F); + bipedLeftLeg.addChild(HipGuardL_1); + + BeltR = new ModelRenderer(this, "Belt Right"); + BeltR.setTextureOffset(18, 56); + BeltR.mirror = true; + BeltR.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltR.addBox(-6F, 1.0F, -3.1F, 12, 2, 6, -0.2F); + setRotateAngle(BeltR, 0.0F, 0.0F, -0.4363323129985824F); + bipedRightLeg.addChild(BeltR); + + BeltL = new ModelRenderer(this, "Belt Left"); + BeltL.setTextureOffset(18, 56); + BeltL.setRotationPoint(0.0F, 0.0F, 0.0F); + BeltL.addBox(-6F, 1.0F, -3.1F, 12, 2, 6, -0.21F); + setRotateAngle(BeltL, 0.0F, 0.0F, 0.4363323129985824F); + bipedLeftLeg.addChild(BeltL); + + HipGuardR_1 = new ModelRenderer(this, "Hip Guard Right 2"); + HipGuardR_1.setTextureOffset(10, 37); + HipGuardR_1.setRotationPoint(0f, 0f, 0f); + HipGuardR_1.addBox(-2.5F, 0.0F, -2.6F, 4, 10, 5, 0.0F); + setRotateAngle(HipGuardR_1, 0.0F, 0.0F, 0.08726646259971647F); + bipedRightLeg.addChild(HipGuardR_1); + + BackR = new ModelRenderer(this, "Back Right"); + BackR.setTextureOffset(0, 40); + BackR.setRotationPoint(1.9f, 0f, 0f); + BackR.addBox(-2.0F, 0.0F, 1.2F, 4, 7, 1, 0.0F); + setRotateAngle(BackR, 0.1F, 0.0F, 0.0f); + bipedRightLeg.addChild(BackR); + + BackL = new ModelRenderer(this, "Back Light"); + BackL.setTextureOffset(0, 40); + BackL.setRotationPoint(-1.9f, 0f, 0f); + BackL.addBox(-2.0F, 0.0F, 1.2F, 4, 7, 1, 0.0F); + setRotateAngle(BackL, 0.1F, 0.0F, 0.0f); + bipedLeftLeg.addChild(BackL); + + HipGuardL = new ModelRenderer(this, "Hip Guard Left"); + HipGuardL.setTextureOffset(0, 48); + HipGuardL.mirror = true; + HipGuardL.setRotationPoint(0f, 0f, 0f); + HipGuardL.addBox(-1.5F, 0.0F, -2.6F, 4, 6, 5, 0.1F); + setRotateAngle(HipGuardL, 0.0F, 0.0F, -0.17453292519943295F); + bipedLeftLeg.addChild(HipGuardL); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java index da3f80b..44a64d7 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersCoif.java @@ -1,15 +1,7 @@ package lance5057.tDefense.armor.renderers.light; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** * ModelBiped - Either Mojang or a mod author @@ -18,47 +10,75 @@ import cpw.mods.fml.client.FMLClientHandler; public class ModelTinkersCoif extends ArmorRenderer { public ModelRenderer Coif; - public ModelRenderer Head; + public ModelRenderer WingR; + public ModelRenderer Mask; + public ModelRenderer Overlay; + public ModelRenderer WingL; + public ModelRenderer Mohawk; + public ModelRenderer MohawkR; + public ModelRenderer MohawkL; public ModelTinkersCoif() { - super(1.1f, 0, 64, 64); + super(0.1f, 0, 128, 64); - this.textureWidth = 64; - this.textureHeight = 64; + textureWidth = 128; + textureHeight = 64; - this.Head = new ModelRenderer(this, 32, 48); - this.Head.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.01F); - this.bipedHead.addChild(this.Head); + Overlay = new ModelRenderer(this, "Overlay"); + Overlay.setTextureOffset(32, 32); + Overlay.setRotationPoint(0.0F, 0.0F, 0.0F); + Overlay.addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, 0.7F); + bipedHead.addChild(Overlay); - this.Coif = new ModelRenderer(this, 0, 46); - this.Coif.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Coif.addBox(-4.0F, -8.0F, -4.0F, 8, 10, 8, 0.51F); - this.bipedHead.addChild(this.Coif); - } + WingL = new ModelRenderer(this, "WingL"); + WingL.setTextureOffset(64, 0); + WingL.setRotationPoint(-0.7F, 0.0F, 0.0F); + WingL.addBox(2.3F, -13.5F, -6.6F, 8, 18, 0, 0.0F); + setRotateAngle(WingL, 0.0F, -0.5235987755982988F, 0.0F); + bipedHead.addChild(WingL); - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); + MohawkR = new ModelRenderer(this, "MohawkR"); + MohawkR.setTextureOffset(80, -14); + MohawkR.setRotationPoint(0.0F, 0.0F, 0.0F); + MohawkR.addBox(-3.0F, -14.0F, -3.6F, 0, 18, 14, 0.0F); + setRotateAngle(MohawkR, 0.0F, -0.4363323129985824F, 0.0F); + bipedHead.addChild(MohawkR); + + Mohawk = new ModelRenderer(this, "Mohawk"); + Mohawk.setTextureOffset(64, 4); + Mohawk.setRotationPoint(0.0F, 0.0F, 0.0F); + Mohawk.addBox(0.0F, -14.0F, -4.6F, 0, 18, 14, 0.0F); + bipedHead.addChild(Mohawk); - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { + Mask = new ModelRenderer(this, "Mask"); + Mask.setTextureOffset(0, 43); + Mask.setRotationPoint(0.0F, 0.0F, 0.0F); + Mask.addBox(-4.5F, -8.0F, -5.0F, 9, 10, 4, 0.11F); + bipedHead.addChild(Mask); - GL11.glPushMatrix(); + WingR = new ModelRenderer(this, "WingR"); + WingR.setTextureOffset(64, 0); + WingR.mirror = true; + WingR.setRotationPoint(-0.5F, 0.0F, 0.0F); + WingR.addBox(-9.2F, -13.5F, -6.0F, 8, 18, 0, 0.0F); + setRotateAngle(WingR, 0.0F, 0.5235987755982988F, 0.0F); + bipedHead.addChild(WingR); - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); + MohawkL = new ModelRenderer(this, "MohawkL"); + MohawkL.setTextureOffset(80, -14); + MohawkL.setRotationPoint(0.0F, 0.0F, 0.0F); + MohawkL.addBox(3.0F, -14.0F, -3.6F, 0, 18, 14, 0.0F); + setRotateAngle(MohawkL, 0.0F, 0.4363323129985824F, 0.0F); + bipedHead.addChild(MohawkL); - GL11.glPopMatrix(); - } - } + Coif = new ModelRenderer(this, "Coif"); + Coif.setTextureOffset(0, 32); + Coif.setRotationPoint(0.0F, 0.0F, 0.0F); + Coif.addBox(-4.0F, 1.0F, -4.0F, 8, 3, 8, 0.5F); + bipedHead.addChild(Coif); - GL11.glPopMatrix(); + init(); } /** diff --git a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHauberk.java b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHauberk.java index 9e3f192..d68c816 100644 --- a/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHauberk.java +++ b/src/main/java/lance5057/tDefense/armor/renderers/light/ModelTinkersHauberk.java @@ -1,116 +1,163 @@ package lance5057.tDefense.armor.renderers.light; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.ArmorCore; import lance5057.tDefense.armor.renderers.ArmorRenderer; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; /** - * ModelBiped - Either Mojang or a mod author + * ModelTinkersHauberk - Either Mojang or a mod author * Created using Tabula 4.1.1 */ public class ModelTinkersHauberk extends ArmorRenderer { + public ModelRenderer ChestBeltR; + public ModelRenderer ChestBelt; + public ModelRenderer ChestBeltR_1; + public ModelRenderer ChestBelt_1; + public ModelRenderer ChestBeltL; + public ModelRenderer ChestBeltL_1; + public ModelRenderer ChestBelt_2; public ModelRenderer Pauldron1; public ModelRenderer Pauldron2; - public ModelRenderer Pauldron3; - public ModelRenderer ArmR; - public ModelRenderer Body; - public ModelRenderer Pauldron1_1; - public ModelRenderer Pauldron2_1; - public ModelRenderer Pauldron3_1; - public ModelRenderer ArmL; + public ModelRenderer PauldronStudR; + public ModelRenderer Pauldron3R; + public ModelRenderer PauldronFlairR; + public ModelRenderer Pauldron1L; + public ModelRenderer Pauldron2L; + public ModelRenderer PauldronStudL; + public ModelRenderer Pauldron3L; + public ModelRenderer PauldronFlairL; public ModelTinkersHauberk() { - super(1.1f, 0, 64, 64); - - this.textureWidth = 64; - this.textureHeight = 64; - - this.Pauldron2_1 = new ModelRenderer(this, 0, 32); - this.Pauldron2_1.mirror = true; - this.Pauldron2_1.setRotationPoint(0.0F, 0.0F, 0.01F); - this.Pauldron2_1.addBox(-0.7F, -2.7F, -2.0F, 3, 3, 4, 0.1F); - this.setRotateAngle(Pauldron2_1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron2_1); - - this.Body = new ModelRenderer(this, 16, 48); - this.Body.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.01F); - this.bipedBody.addChild(this.Body); - - this.Pauldron1_1 = new ModelRenderer(this, 30, 32); - this.Pauldron1_1.mirror = true; - this.Pauldron1_1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1_1.addBox(0.5F, -1.9F, -2.5F, 3, 4, 5, 0.01F); - this.setRotateAngle(Pauldron1_1, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron1_1); - - this.Pauldron3 = new ModelRenderer(this, 16, 32); - this.Pauldron3.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3.addBox(-1.2F, -1.5F, -2.5F, 2, 2, 5, 0.11F); - this.setRotateAngle(Pauldron3, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron3); - - this.ArmL = new ModelRenderer(this, 0, 48); - this.ArmL.mirror = true; - this.ArmL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmL.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.02F); - this.bipedLeftArm.addChild(this.ArmL); - - this.Pauldron1 = new ModelRenderer(this, 30, 32); - this.Pauldron1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron1.addBox(-3.5F, -1.9F, -2.5F, 3, 4, 5, 0.01F); - this.setRotateAngle(Pauldron1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron1); - - this.Pauldron3_1 = new ModelRenderer(this, 16, 32); - this.Pauldron3_1.mirror = true; - this.Pauldron3_1.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron3_1.addBox(-0.8F, -1.5F, -2.5F, 2, 2, 5, 0.11F); - this.setRotateAngle(Pauldron3_1, 0.0F, 0.0F, 0.2617993877991494F); - this.bipedLeftArm.addChild(this.Pauldron3_1); - - this.Pauldron2 = new ModelRenderer(this, 0, 32); - this.Pauldron2.setRotationPoint(0.0F, 0.0F, 0.0F); - this.Pauldron2.addBox(-2.3F, -2.7F, -2.0F, 3, 3, 4, 0.11F); - this.setRotateAngle(Pauldron2, 0.0F, 0.0F, -0.2617993877991494F); - this.bipedRightArm.addChild(this.Pauldron2); - - this.ArmR = new ModelRenderer(this, 0, 48); - this.ArmR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.ArmR.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.02F); - this.bipedRightArm.addChild(this.ArmR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - GL11.glPushMatrix(); - - for(int i = 0; i < 10; i++) - { - String texture = ((ArmorCore) this.stack.getItem()).getTexture(i, stack); - if(texture != "") - { - - GL11.glPushMatrix(); - - ((ArmorCore) this.stack.getItem()).renderArmor(entity, f, f1, f2, f3, f4, f5, colors, stack, i); - super.render(entity, f, f1, f2, f3, f4, f5); - - GL11.glPopMatrix(); - } - } - - GL11.glPopMatrix(); + super(0.1f, 0, 64, 64); + + textureWidth = 64; + textureHeight = 64; + + ChestBelt_1 = new ModelRenderer(this, "ChestBelt_1"); + ChestBelt_1.setTextureOffset(0, 57); + ChestBelt_1.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBelt_1.addBox(-4.5F, 9.0F, -2.5F, 9, 2, 5, -0.19F); + bipedBody.addChild(ChestBelt_1); + + ChestBelt_2 = new ModelRenderer(this, "ChestBelt_2"); + ChestBelt_2.setTextureOffset(28, 32); + ChestBelt_2.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBelt_2.addBox(-4.5F, 5.0F, -2.5F, 9, 2, 5, -0.19F); + bipedBody.addChild(ChestBelt_2); + + Pauldron3R = new ModelRenderer(this, "Pauldron3R"); + Pauldron3R.setTextureOffset(0, 32); + Pauldron3R.setRotationPoint(-0.0F, 0.0F, 0.0F); + Pauldron3R.addBox(-3.2F, -0.5F, -2.0F, 3, 4, 4, 0.1F); + setRotateAngle(Pauldron3R, 0.0F, 0.0F, 0.08726646259971647F); + bipedRightArm.addChild(Pauldron3R); + + Pauldron2L = new ModelRenderer(this, "Pauldron2L"); + Pauldron2L.setTextureOffset(0, 49); + Pauldron2L.mirror = true; + Pauldron2L.setRotationPoint(0.0F, 0.0F, 0.0F); + Pauldron2L.addBox(-1.0F, -3.0F, -2.0F, 3, 3, 4, 0.1F); + setRotateAngle(Pauldron2L, 0.0F, 0.0F, 0.2617993877991494F); + bipedLeftArm.addChild(Pauldron2L); + + Pauldron3L = new ModelRenderer(this, "Pauldron3L"); + Pauldron3L.setTextureOffset(0, 32); + Pauldron3L.mirror = true; + Pauldron3L.setRotationPoint(0.0F, 0.0F, 0.0F); + Pauldron3L.addBox(0.2F, -0.5F, -2.0F, 3, 4, 4, 0.1F); + setRotateAngle(Pauldron3L, 0.0F, 0.0F, -0.08726646259971647F); + bipedLeftArm.addChild(Pauldron3L); + + ChestBeltR = new ModelRenderer(this, "ChestBeltR"); + ChestBeltR.setTextureOffset(0, 57); + ChestBeltR.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBeltR.addBox(-1.7F, 5.7F, -2.5F, 11, 2, 5, -0.2F); + setRotateAngle(ChestBeltR, 0.0F, 0.0F, 0.5235987755982988F); + bipedBody.addChild(ChestBeltR); + + ChestBeltL = new ModelRenderer(this, "ChestBeltL"); + ChestBeltL.setTextureOffset(0, 57); + ChestBeltL.mirror = true; + ChestBeltL.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBeltL.addBox(-7.5F, 2.3F, -2.5F, 11, 2, 5, -0.2F); + setRotateAngle(ChestBeltL, 0.0F, 0.0F, -0.5235987755982988F); + bipedBody.addChild(ChestBeltL); + + ChestBeltL_1 = new ModelRenderer(this, "ChestBeltL_1"); + ChestBeltL_1.setTextureOffset(0, 57); + ChestBeltL_1.mirror = true; + ChestBeltL_1.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBeltL_1.addBox(-9.3F, 5.7F, -2.5F, 11, 2, 5, -0.21F); + setRotateAngle(ChestBeltL_1, 0.0F, 0.0F, -0.5235987755982988F); + bipedBody.addChild(ChestBeltL_1); + + PauldronStudR = new ModelRenderer(this, "PauldronStudR"); + PauldronStudR.setTextureOffset(14, 32); + PauldronStudR.setRotationPoint(-0.0F, 0.0F, 0.0F); + PauldronStudR.addBox(-1.0F, -1.5F, -2.5F, 2, 2, 5, 0.1F); + setRotateAngle(PauldronStudR, 0.0F, 0.0F, -0.2617993877991494F); + bipedRightArm.addChild(PauldronStudR); + + Pauldron1 = new ModelRenderer(this, "Pauldron1"); + Pauldron1.setTextureOffset(0, 40); + Pauldron1.setRotationPoint(-0.0F, 0.0F, 0.0F); + Pauldron1.addBox(-3.5F, -1.9F, -2.5F, 4, 4, 5, 0.0F); + setRotateAngle(Pauldron1, 0.0F, 0.0F, 0.2617993877991494F); + bipedRightArm.addChild(Pauldron1); + + ChestBeltR_1 = new ModelRenderer(this, "ChestBeltR_1"); + ChestBeltR_1.setTextureOffset(0, 57); + ChestBeltR_1.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBeltR_1.addBox(-3.5F, 2.3F, -2.5F, 11, 2, 5, -0.21F); + setRotateAngle(ChestBeltR_1, 0.0F, 0.0F, 0.5235987755982988F); + bipedBody.addChild(ChestBeltR_1); + + PauldronFlairR = new ModelRenderer(this, "PauldronFlairR"); + PauldronFlairR.setTextureOffset(18, 39); + PauldronFlairR.mirror = true; + PauldronFlairR.setRotationPoint(-0.0F, 0.0F, 0.0F); + PauldronFlairR.addBox(-8.5F, -4.5F, 0.0F, 7, 9, 0, 0.0F); + setRotateAngle(PauldronFlairR, 0.0F, 0.0F, 0.2617993877991494F); + bipedRightArm.addChild(PauldronFlairR); + + PauldronFlairL = new ModelRenderer(this, "PauldronFlairL"); + PauldronFlairL.setTextureOffset(18, 39); + PauldronFlairL.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronFlairL.addBox(1.5F, -4.5F, 0.0F, 7, 9, 0, 0.0F); + setRotateAngle(PauldronFlairL, 0.0F, 0.0F, -0.2617993877991494F); + bipedLeftArm.addChild(PauldronFlairL); + + Pauldron2 = new ModelRenderer(this, "Pauldron2"); + Pauldron2.setTextureOffset(0, 49); + Pauldron2.setRotationPoint(-0.0F, 0.0F, 0.0F); + Pauldron2.addBox(-2.0F, -3.0F, -2.0F, 3, 3, 4, 0.1F); + setRotateAngle(Pauldron2, 0.0F, 0.0F, -0.2617993877991494F); + bipedRightArm.addChild(Pauldron2); + + PauldronStudL = new ModelRenderer(this, "PauldronStudL"); + PauldronStudL.setTextureOffset(14, 32); + PauldronStudL.mirror = true; + PauldronStudL.setRotationPoint(0.0F, 0.0F, 0.0F); + PauldronStudL.addBox(-1.0F, -1.5F, -2.5F, 2, 2, 5, 0.1F); + setRotateAngle(PauldronStudL, 0.0F, 0.0F, 0.2617993877991494F); + bipedLeftArm.addChild(PauldronStudL); + + Pauldron1L = new ModelRenderer(this, "Pauldron1L"); + Pauldron1L.setTextureOffset(0, 40); + Pauldron1L.mirror = true; + Pauldron1L.setRotationPoint(0.0F, 0.0F, 0.0F); + Pauldron1L.addBox(-0.5F, -1.9F, -2.5F, 4, 4, 5, 0.0F); + setRotateAngle(Pauldron1L, 0.0F, 0.0F, -0.2617993877991494F); + bipedLeftArm.addChild(Pauldron1L); + + ChestBelt = new ModelRenderer(this, "ChestBelt"); + ChestBelt.setTextureOffset(28, 32); + ChestBelt.setRotationPoint(0.0F, 0.0F, 0.0F); + ChestBelt.addBox(-4.5F, 3.0F, -2.5F, 9, 2, 5, -0.19F); + bipedBody.addChild(ChestBelt); + + init(); } /** diff --git a/src/main/java/lance5057/tDefense/baubles/blocks/JewelersBench.java b/src/main/java/lance5057/tDefense/baubles/blocks/JewelersBench.java new file mode 100644 index 0000000..e7f54fb --- /dev/null +++ b/src/main/java/lance5057/tDefense/baubles/blocks/JewelersBench.java @@ -0,0 +1,57 @@ +package lance5057.tDefense.baubles.blocks; + +import lance5057.tDefense.baubles.tileentities.TileEntity_JewelersBench; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class JewelersBench extends Block implements ITileEntityProvider +{ + + public JewelersBench() + { + super(Material.iron); + } + + //You don't want the normal render type, or it wont render properly. + @Override + public int getRenderType() + { + return -1; + } + + //It's not an opaque cube, so you need this. + @Override + public boolean isOpaqueCube() + { + return false; + } + + //It's not a normal block, so you need this too. + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + //This is the icon to use for showing the block in your hand. + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister icon) + { + blockIcon = icon.registerIcon("tinkersdefense:WIP"); + } + + @Override + public TileEntity createNewTileEntity(World w, int md) + { + final TileEntity_JewelersBench te = new TileEntity_JewelersBench(); + return te; + } + +} diff --git a/src/main/java/lance5057/tDefense/baubles/models/ModelJewelersBench.java b/src/main/java/lance5057/tDefense/baubles/models/ModelJewelersBench.java new file mode 100644 index 0000000..164c522 --- /dev/null +++ b/src/main/java/lance5057/tDefense/baubles/models/ModelJewelersBench.java @@ -0,0 +1,104 @@ +package lance5057.tDefense.baubles.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +/** + * JewelersBench - lance5057 + * Created using Tabula 4.1.1 + */ +public class ModelJewelersBench extends ModelBase +{ + public ModelRenderer TableSide2; + public ModelRenderer SawBlock1; + public ModelRenderer SawBlock2; + public ModelRenderer SawBlock3; + public ModelRenderer SawBlockClamp; + public ModelRenderer Leg1; + public ModelRenderer Leg2; + public ModelRenderer Leg3; + public ModelRenderer Leg4; + public ModelRenderer TableTop; + public ModelRenderer TableBack; + public ModelRenderer TableSide1; + public ModelRenderer Drawer; + public ModelRenderer Handle; + + public ModelJewelersBench() + { + textureWidth = 64; + textureHeight = 64; + SawBlock1 = new ModelRenderer(this, 0, 0); + SawBlock1.setRotationPoint(2.0F, 8.2F, -12.0F); + SawBlock1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 4, 0.0F); + Leg4 = new ModelRenderer(this, 0, 0); + Leg4.setRotationPoint(6.0F, 10.0F, 6.0F); + Leg4.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); + Drawer = new ModelRenderer(this, 0, 46); + Drawer.setRotationPoint(-6.0F, 11.5F, -8.0F); + Drawer.addBox(0.0F, 0.0F, 0.0F, 12, 2, 16, 0.0F); + TableSide2 = new ModelRenderer(this, 0, 0); + TableSide2.setRotationPoint(-8.0F, 7.0F, -7.0F); + TableSide2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 14, 0.0F); + Leg2 = new ModelRenderer(this, 0, 0); + Leg2.setRotationPoint(6.0F, 10.0F, -8.0F); + Leg2.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); + TableSide1 = new ModelRenderer(this, 0, 0); + TableSide1.setRotationPoint(7.0F, 7.0F, -7.0F); + TableSide1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 14, 0.0F); + SawBlock3 = new ModelRenderer(this, 0, 0); + SawBlock3.setRotationPoint(3.0F, 8.2F, -11.0F); + SawBlock3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3, 0.0F); + Handle = new ModelRenderer(this, 55, 0); + Handle.setRotationPoint(-2.0F, 12.0F, -9.0F); + Handle.addBox(0.0F, 0.0F, 0.0F, 4, 1, 1, 0.0F); + Leg1 = new ModelRenderer(this, 0, 0); + Leg1.setRotationPoint(-8.0F, 10.0F, -8.0F); + Leg1.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); + TableTop = new ModelRenderer(this, 0, 28); + TableTop.setRotationPoint(-8.0F, 8.0F, -8.0F); + TableTop.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F); + TableBack = new ModelRenderer(this, 0, 0); + TableBack.setRotationPoint(-8.0F, 7.0F, 7.0F); + TableBack.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); + SawBlockClamp = new ModelRenderer(this, 54, 0); + SawBlockClamp.setRotationPoint(1.5F, 8.0F, -9.0F); + SawBlockClamp.addBox(0.0F, 0.0F, 0.0F, 4, 2, 1, 0.0F); + Leg3 = new ModelRenderer(this, 0, 0); + Leg3.setRotationPoint(-8.0F, 10.0F, 6.0F); + Leg3.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); + SawBlock2 = new ModelRenderer(this, 0, 0); + SawBlock2.setRotationPoint(4.0F, 8.2F, -12.0F); + SawBlock2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 4, 0.0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + SawBlock1.render(f5); + Leg4.render(f5); + Drawer.render(f5); + TableSide2.render(f5); + Leg2.render(f5); + TableSide1.render(f5); + SawBlock3.render(f5); + Handle.render(f5); + Leg1.render(f5); + TableTop.render(f5); + TableBack.render(f5); + SawBlockClamp.render(f5); + Leg3.render(f5); + SawBlock2.render(f5); + } + + /** + * This is a helper function from Tabula to set the rotation of model parts + */ + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) + { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } +} diff --git a/src/main/java/lance5057/tDefense/baubles/models/Renderer_JewelersBench.java b/src/main/java/lance5057/tDefense/baubles/models/Renderer_JewelersBench.java new file mode 100644 index 0000000..c2985c5 --- /dev/null +++ b/src/main/java/lance5057/tDefense/baubles/models/Renderer_JewelersBench.java @@ -0,0 +1,43 @@ +package lance5057.tDefense.baubles.models; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +public class Renderer_JewelersBench extends TileEntitySpecialRenderer +{ + private final ModelJewelersBench model; + + public Renderer_JewelersBench() + { + model = new ModelJewelersBench(); + } + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + + final ResourceLocation textures = (new ResourceLocation( + "tinkersdefense:textures/blocks/JewelersBench.png")); + + Minecraft.getMinecraft().renderEngine.bindTexture(textures); + + GL11.glPushMatrix(); + + te.getBlockMetadata(); + + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + + model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + + } + +} diff --git a/src/main/java/lance5057/tDefense/baubles/tileentities/TileEntity_JewelersBench.java b/src/main/java/lance5057/tDefense/baubles/tileentities/TileEntity_JewelersBench.java new file mode 100644 index 0000000..5d6e187 --- /dev/null +++ b/src/main/java/lance5057/tDefense/baubles/tileentities/TileEntity_JewelersBench.java @@ -0,0 +1,8 @@ +package lance5057.tDefense.baubles.tileentities; + +import net.minecraft.tileentity.TileEntity; + +public class TileEntity_JewelersBench extends TileEntity +{ + +} diff --git a/src/main/java/lance5057/tDefense/blocks/JewelersBench.java b/src/main/java/lance5057/tDefense/blocks/JewelersBench.java deleted file mode 100644 index 06d6f11..0000000 --- a/src/main/java/lance5057/tDefense/blocks/JewelersBench.java +++ /dev/null @@ -1,56 +0,0 @@ -package lance5057.tDefense.blocks; - -import lance5057.tDefense.tileentities.TileEntity_JewelersBench; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class JewelersBench extends Block implements ITileEntityProvider -{ - - public JewelersBench() - { - super(Material.iron); - } - - //You don't want the normal render type, or it wont render properly. - @Override - public int getRenderType() - { - return -1; - } - - //It's not an opaque cube, so you need this. - @Override - public boolean isOpaqueCube() - { - return false; - } - - //It's not a normal block, so you need this too. - public boolean renderAsNormalBlock() - { - return false; - } - - //This is the icon to use for showing the block in your hand. - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister icon) - { - this.blockIcon = icon.registerIcon("tinkersdefense:WIP"); - } - - @Override - public TileEntity createNewTileEntity(World w, int md) - { - TileEntity_JewelersBench te = new TileEntity_JewelersBench(); - return te; - } - -} diff --git a/src/main/java/lance5057/tDefense/core/entity/EntityHookshotHook.java b/src/main/java/lance5057/tDefense/core/entity/EntityHookshotHook.java new file mode 100644 index 0000000..bf24e82 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/entity/EntityHookshotHook.java @@ -0,0 +1,158 @@ +package lance5057.tDefense.core.entity; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import tconstruct.library.tools.ToolCore; + +public class EntityHookshotHook extends EntityThrowable +{ + public int maxChain; + + public static final int DATA_PLAYER = 22; + public static final int DATA_TARGET = 23; + public static final int DATA_ARRIVED = 24; + public static final int DATA_HOOK = 25; + public static final int HIT_POS_X = 26, HIT_POS_Y = 27, + HIT_POS_Z = 28; + public static final int DATA_ITEM = 29; + + boolean playerTouching = false; + + public EntityHookshotHook(World world) + { + super(world); + } + + public EntityHookshotHook(World world, EntityLivingBase entity) + { + super(world, entity); + } + + public EntityHookshotHook(World world, double x, double y, double z) + { + super(world, x, y, z); + } + + @Override + protected void entityInit() + { + super.entityInit(); + setSize(0.25F, 0.25F); + dataWatcher.addObject(DATA_PLAYER, ""); + dataWatcher.addObject(DATA_TARGET, -1); + dataWatcher.addObject(DATA_ARRIVED, (byte) 0); + dataWatcher.addObject(DATA_HOOK, ""); + dataWatcher.addObject(HIT_POS_X, 0.0F); + dataWatcher.addObject(HIT_POS_Y, 0.0F); + dataWatcher.addObject(HIT_POS_Z, 0.0F); + dataWatcher.addObject(DATA_ITEM, new ItemStack(Blocks.air, 1, 0)); + } + + @Override + protected void onImpact(MovingObjectPosition Op) + { + motionX = motionY = motionZ = 0.0D; + if(Op.typeOfHit == MovingObjectType.BLOCK) + { + final Block block = worldObj.getBlock(Op.blockX, Op.blockY, Op.blockZ); + + if(!block.getMaterial().blocksMovement()) + return; + if(ticksExisted < getChainLength()) + { + dataWatcher.updateObject(DATA_ARRIVED, (byte) 1); + posX = Op.blockX + 0.5D; + posY = Op.blockY + 0.5D; + posZ = Op.blockZ + 0.5D; + } + } + } + + @Override + public void onUpdate() + { + super.onUpdate(); + if(ticksExisted > 0)// getChainLength()) + { + if(worldObj.isRemote && getThrower() instanceof EntityPlayer && ticksExisted % 4 == 0 && dataWatcher.getWatchableObjectByte(DATA_ARRIVED) == (byte) 1) + { + ((EntityPlayer) getThrower()).playSound("tinkersdefense:hookshotChain", 1.0F, 1.0F); + } + } + else + { + setDead(); + } + } + + @Override + public EntityLivingBase getThrower() + { + final String name = dataWatcher.getWatchableObjectString(DATA_PLAYER); + if(name == "") + return null; + return worldObj.getPlayerEntityByName(name); + } + + @Override + protected float func_70182_d() + { + return 1.25F; + } + + @Override + protected float getGravityVelocity() + { + return 0.0F; + } + + public void setHook(String type) + { + dataWatcher.updateObject(DATA_HOOK, type); + } + + public String getHook() + { + return dataWatcher.getWatchableObjectString(DATA_HOOK); + } + + public void setHookshot(ItemStack hookshot) + { + dataWatcher.updateObject(DATA_ITEM, hookshot); + } + + public ItemStack getHookshot() + { + return dataWatcher.getWatchableObjectItemStack(DATA_ITEM); + } + + public String getPlayer() + { + return dataWatcher.getWatchableObjectString(DATA_PLAYER); + } + + public void setPlayer(EntityPlayer player) + { + dataWatcher.updateObject(DATA_PLAYER, player.getDisplayName()); + } + + public int getChainLength() + { + final ItemStack tool = dataWatcher.getWatchableObjectItemStack(DATA_ITEM); + if(tool != null && tool.getItem() instanceof ToolCore) + { + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + return tags.getInteger("ChainLength"); + } + return 0; + } +} diff --git a/src/main/java/lance5057/tDefense/core/events/TDEventHandler.java b/src/main/java/lance5057/tDefense/core/events/TDEventHandler.java index 2d653e1..fd4875c 100644 --- a/src/main/java/lance5057/tDefense/core/events/TDEventHandler.java +++ b/src/main/java/lance5057/tDefense/core/events/TDEventHandler.java @@ -2,25 +2,15 @@ package lance5057.tDefense.core.events; import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.armor.parts.ClothMaterial; +import lance5057.tDefense.core.tools.RoundShield; import mods.battlegear2.api.PlayerEventChild.ShieldBlockEvent; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; +import net.minecraft.entity.EntityLiving; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; -import net.minecraft.util.Vec3; import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.living.LivingSpawnEvent; import tconstruct.library.TConstructRegistry; import tconstruct.library.event.PartBuilderEvent; -import tconstruct.library.tools.BowstringMaterial; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -41,9 +31,11 @@ public class TDEventHandler { ItemStack result = null; - ClothMaterial mat = (ClothMaterial) TConstructRegistry.getCustomMaterial(event.material, ClothMaterial.class); + final ClothMaterial mat = (ClothMaterial) TConstructRegistry.getCustomMaterial(event.material, ClothMaterial.class); if(mat != null && event.material.stackSize >= 3) + { result = mat.craftingItem.copy(); + } if(result != null) { @@ -56,58 +48,13 @@ public class TDEventHandler @Optional.Method(modid = "battlegear2") public void TD_ShieldBlock(ShieldBlockEvent event) { - NBTTagCompound tags = event.shield.getTagCompound().getCompoundTag("InfiTool"); - - if(!tags.getBoolean("Broken")) + if(event.shield.getItem() instanceof RoundShield) { - - if(tags.hasKey("Crest of Mirrors")) - { - Entity test = event.source.getSourceOfDamage(); - - if(event.source.getSourceOfDamage() instanceof EntityLargeFireball || event.source.getSourceOfDamage() instanceof EntityFireball) - { - EntityFireball ent = (EntityFireball) event.source.getSourceOfDamage(); - //EntityFireball newEnt = new EntityFireball(); - Vec3 playerlook = event.getPlayer().getLookVec(); - - //ent.attackEntityFrom(, 1); - - //ent.setBeenAttacked(); - - ent.motionX = playerlook.xCoord; - ent.motionY = playerlook.yCoord; - ent.motionZ = playerlook.zCoord; - ent.accelerationX = ent.motionX * 0.1D; - ent.accelerationY = ent.motionY * 0.1D; - ent.accelerationZ = ent.motionZ * 0.1D; - - ent.shootingEntity = event.getPlayer(); - - ent.motionX += ent.accelerationX * 2; - ent.motionY += ent.accelerationY * 2; - ent.motionZ += ent.accelerationZ * 2; - - //ent. - - ent.setDead(); - } - } - - if(tags.hasKey("Crest of Legends")) - { - event.getPlayer().addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 4, 30)); - event.getPlayer().addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 4, 30)); - event.getPlayer().addPotionEffect(new PotionEffect(Potion.resistance.getId(), 4, 30)); - } - - if(tags.hasKey("Crest of Vampires")) - { - event.getPlayer().heal(event.ammount / tags.getInteger("Crest of Vampires")); - } + final EntityLiving entity = (EntityLiving) event.source.getEntity(); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5, + 10)); } } - // public void TD_LivingHurt(LivingHurtEvent event) // { // if(event.entityLiving instanceof EntityPlayer) @@ -128,24 +75,24 @@ public class TDEventHandler // } // } - @SubscribeEvent - public void giveCandyToUndead(LivingSpawnEvent event) - { - //if(!Minecraft.getMinecraft().theWorld.isRemote) - if(TinkersDefense.month == 12) - { - if(event.entityLiving.isEntityUndead()) - { - Integer chance = Minecraft.getMinecraft().theWorld.rand.nextInt(100); - Boolean candy = Minecraft.getMinecraft().theWorld.rand.nextBoolean(); - if(chance < 25) - { - if(candy == true) - event.entityLiving.setCurrentItemOrArmor(0, new ItemStack(TinkersDefense.item_RedMintcane, 1, 0)); - else - event.entityLiving.setCurrentItemOrArmor(0, new ItemStack(TinkersDefense.item_GreenMintcane, 1, 0)); - } - } - } - } + // @SubscribeEvent + // public void giveCandyToUndead(LivingSpawnEvent event) + // { + // //if(!Minecraft.getMinecraft().theWorld.isRemote) + // if(TinkersDefense.month == 12) + // { + // if(event.entityLiving.isEntityUndead()) + // { + // Integer chance = Minecraft.getMinecraft().theWorld.rand.nextInt(100); + // Boolean candy = Minecraft.getMinecraft().theWorld.rand.nextBoolean(); + // if(chance < 25) + // { + // if(candy == true) + // event.entityLiving.setCurrentItemOrArmor(0, new ItemStack(TinkersDefense.item_RedMintcane, 1, 0)); + // else + // event.entityLiving.setCurrentItemOrArmor(0, new ItemStack(TinkersDefense.item_GreenMintcane, 1, 0)); + // } + // } + // } + // } } diff --git a/src/main/java/lance5057/tDefense/core/gui/GuiTDGuideBook.java b/src/main/java/lance5057/tDefense/core/gui/GuiTDGuideBook.java new file mode 100644 index 0000000..d5c5fee --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/gui/GuiTDGuideBook.java @@ -0,0 +1,591 @@ +package lance5057.tDefense.core.gui; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import lance5057.tDefense.TinkersDefense; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +import org.lwjgl.opengl.GL11; + +import tconstruct.library.crafting.ToolBuilder; +import tconstruct.library.tools.DynamicToolPart; +import tconstruct.tools.TinkerTools; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class GuiTDGuideBook extends GuiScreen +{ + static RenderItem itemRender = new RenderItem(); + List chapters = new ArrayList(); + + private int chapter = 0; + private int page = 0; + + private static final ResourceLocation guiLocation = new ResourceLocation( + "tinkersdefense", + "textures/gui/guide.png"); + + private static final ResourceLocation guiLocation2 = new ResourceLocation( + "tinkersdefense", + "textures/gui/guide2.png"); + + public GuiTDGuideBook() + { + + } + + @Override + public void initGui() + { + final List pages = new ArrayList(); + Page page; + chapters.add(new Chapter(0, 1)); + + page = new Page(1, 0); + pages.add(page); + + page = new Page(1, 1, (DynamicToolPart) TinkersDefense.partArmorplate, + (DynamicToolPart) TinkerTools.toughRod, + (DynamicToolPart) TinkersDefense.partArmorplate, + (DynamicToolPart) TinkersDefense.partRivet); + pages.add(page); + + page = new Page(1, 2, (DynamicToolPart) TinkersDefense.partArmorplate, + (DynamicToolPart) TinkerTools.toolRod, + (DynamicToolPart) TinkerTools.frypanHead, null); + pages.add(page); + + chapters.add(new Chapter(1, pages)); + + buttonList.clear(); + + buttonList.add(new BookButton(0, ((width - 256) / 2) + 3, 240, false, + 80, 0, 18, 12)); + buttonList.add(new BookButton(1, ((width + 256) / 2) - 3 - 18, 240, + true, 80, 0, 18, 12)); + buttonList.add(new BookButton(2, ((width - 14) / 2), 238, true, 120, 0, + 14, 13)); + + for(int i = 0; i < chapters.size(); i++) + { + buttonList.add(chapters.get(i).getButton(3 + i, width, height)); + } + + // this.buttonList.add(new BookButton(3, ((this.width + 256) / 2) - 8, 15 + 64, true, 71, 180, 35, 21)); + // this.buttonList.add(new BookButton(4, ((this.width + 256) / 2) - 8, 35 + 64, true, 71, 200, 35, 21)); + // this.buttonList.add(new BookButton(5, ((this.width + 256) / 2) - 8, 55 + 64, true, 71, 220, 35, 21)); + // this.buttonList.add(new BookButton(6, ((this.width + 256) / 2) - 8, 75 + 64, true, 144, 180, 35, 21)); + // this.buttonList.add(new BookButton(7, ((this.width + 256) / 2) - 8, 95 + 64, true, 144, 200, 35, 21)); + // + // + ((GuiButton) buttonList.get(chapter + 3)).enabled = false; + } + + @Override + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(guiLocation); + + drawTexturedModalRect((width - 256) / 2, (height - 224) / 2, 0, 0, 256, 179); + + //chapters.get(chapter - 1).pages.get(page - 1).drawText(fontRendererObj, this.width, this.height); + if(chapters.size() > 0 && chapters.get(chapter).pages.size() > 0) + { + chapters.get(chapter).pages.get(page).draw(this, fontRendererObj, width, height, itemRender); + } + + mc.getTextureManager().bindTexture(guiLocation2); + + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } + + @Override + protected void actionPerformed(GuiButton button) + { + switch(button.id) + { + case 0: + if(page > 0) + { + page--; + } + else if(chapter > 0) + { + ((GuiButton) buttonList.get(chapter + 3)).enabled = true; + chapter--; + page = 0; + ((GuiButton) buttonList.get(chapter + 3)).enabled = false; + } + break; + case 1: + if(page + 1 < chapters.get(chapter).pages.size()) + { + page++; + } + else if(chapter + 1 <= chapters.size() - 1) + { + ((GuiButton) buttonList.get(chapter + 3)).enabled = true; + chapter++; + page = 0; + ((GuiButton) buttonList.get(chapter + 3)).enabled = false; + } + break; + case 2: + ((GuiButton) buttonList.get(chapter + 3)).enabled = true; + chapter = 0; + page = 0; + ((GuiButton) buttonList.get(chapter + 3)).enabled = false; + break; + default: + ((GuiButton) buttonList.get(chapter + 3)).enabled = true; + chapter = button.id - 3; + ((GuiButton) buttonList.get(chapter + 3)).enabled = false; + break; + } + } + + @SideOnly(Side.CLIENT) + static class BookButton extends GuiButton + { + private final boolean mirror; + + int iconX, iconY, iconW, iconH; + + public BookButton(int id, int x, int y, boolean mirror, int iconX, int iconY, int iconW, int iconH) + { + super(id, x, y, iconW, iconH, ""); + this.mirror = mirror; + this.iconX = iconX; + this.iconY = iconY; + this.iconW = iconW; + this.iconH = iconH; + } + + /** + * Draws this button to the screen. + */ + @Override + public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) + { + if(visible) + { + final boolean flag = (p_146112_2_ >= xPosition && p_146112_3_ >= yPosition && p_146112_2_ < xPosition + width && p_146112_3_ < yPosition + height) || !enabled; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + //p_146112_1_.getTextureManager().bindTexture(guiLocation2); + int k = iconX; + int l = iconY; + + if(flag) + { + k += iconW; + } + + if(!mirror) + { + l += iconH; + } + + drawTexturedModalRect(xPosition, yPosition, k, l, iconW, iconH); + } + } + + } + + @SideOnly(Side.CLIENT) + static class Chapter + { + List pages; + int buttonU, buttonV; + int number; + + public Chapter(int number, int pages2) + { + this.number = number; + + pages = new ArrayList(); + + for(int i = 0; i < pages2; i++) + { + pages.add(new Page(number, i)); + } + } + + public Chapter(int number, List pages) + { + this.number = number; + this.pages = pages; + } + + public BookButton getButton(int id, int w, int h) + { + return new BookButton(id, ((w + 256) / 2) - 8, + 64 + 15 + (id - 3) * 22, true, 0, (id - 3) * 22, 35, 22); + } + } + + @SideOnly(Side.CLIENT) + static class Page + { + /* enum TYPES {TEXT, CRAFTING1, CRAFTING2, FORGE1, FORGE2, FORGE3, ALLOY}; + 0 = TEXT + 1 = CRAFTING1 + 2 = CRAFTING2 + 3 = FORGE1 + 4 = FORGE2 + 5 = FORGE3 + 6 = ALLOY + + because apparently java overcomplicated enums to all hell + */ + + int type; + int chapter; + int page; + + List TCRecipe; + int TCCycleTimer = 0; + List TCItemCycle = new ArrayList(); + + ItemStack result1, result2, result3; + + //Text + public Page(int chapter, int number) + { + type = 0; + this.chapter = chapter; + page = number; + } + + /*Crafting 1 recipe + * recipe - up to 9 stacks + * + * list to grid looks like + * 1 2 3 + * 4 5 6 + * 7 8 9 + */ + public Page(int chapter, int number, ItemStack result) + { + type = 1; + this.chapter = chapter; + page = number; + result1 = result; + } + + /*Crafting 2 recipe + * recipe1 - up to 9 stacks + * recipe2 - up to 9 stacks + * + * list to grid looks like + * 1 2 3 + * 4 5 6 + * 7 8 9 + */ + public Page(int chapter, int number, ItemStack result1, ItemStack result2) + { + type = 2; + this.chapter = chapter; + page = number; + + this.result1 = result1; + this.result2 = result2; + } + + public Page(int chapter, int number, DynamicToolPart item1, DynamicToolPart item2, DynamicToolPart item3, DynamicToolPart item4) + { + type = 3; + this.chapter = chapter; + page = number; + + TCRecipe = new ArrayList(); + TCRecipe.add(item1); + TCRecipe.add(item2); + if(item3 != null) + { + TCRecipe.add(item3); + } + if(item4 != null) + { + TCRecipe.add(item4); + } + } + + public void draw(GuiScreen gui, FontRenderer fontRendererObj, int w, int h, RenderItem itemRender) + { + drawText(fontRendererObj, w, h); + switch(type) + { + case 0: + drawTextRight(fontRendererObj, w, h); + break; + case 1: + drawCraftPage(gui, 1, w, h, fontRendererObj, itemRender); + break; + case 2: + drawCraftPage(gui, 2, w, h, fontRendererObj, itemRender); + break; + case 3: + drawForgePage(gui, 2, w, h, fontRendererObj, itemRender); + break; + } + } + + public void drawText(FontRenderer fontRendererObj, int w, int h) + { + final int titleSize = fontRendererObj.getStringWidth(StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".titleL")); + fontRendererObj.drawString(StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".titleL"), ((w - 256) / 2) + 64 - titleSize, 64 + 14, 0); + + drawCenteredSplit(((w - 256) / 2) + 68, 84, StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".ContentL"), fontRendererObj); + } + + public void drawTextRight(FontRenderer fontRendererObj, int w, int h) + { + final int titleSize = fontRendererObj.getStringWidth(StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".titleR")); + fontRendererObj.drawString(StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".titleR"), ((w + 256) / 2) - 72 - titleSize, 64 + 14, 0); + + drawCenteredSplit(((w + 256) / 2) - 72, 84, StatCollector.translateToLocal("book.chapter" + chapter + ".page" + page + ".ContentR"), fontRendererObj); + } + + private void drawCraftPage(GuiScreen gui, int numOfCrafts, int w, int h, FontRenderer fontRendererObj, RenderItem itemRender) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + gui.mc.getTextureManager().bindTexture(guiLocation2); + final IRecipe recipe; + switch(numOfCrafts) + { + case 1: + gui.drawTexturedModalRect(w / 2 + 7, h / 2 - 49, 157, 0, 99, 56); + recipe = lookUpRecipe(result1); + + DrawRecipe(fontRendererObj, gui.mc.getTextureManager(), recipe, 10, -46, w, h); + break; + case 2: + gui.drawTexturedModalRect((w - 256) / 2 + 7, 64 + 33, 157, 0, 99, 56); + + recipe = lookUpRecipe(result1); + + DrawRecipe(fontRendererObj, gui.mc.getTextureManager(), recipe, 7, 60, w, h); + + gui.drawTexturedModalRect((w - 256) / 2 + 7, 64 + 94, 157, 0, 99, 56); + break; + default: + break; + } + GL11.glEnable(GL11.GL_BLEND); + } + + private void drawForgePage(GuiScreen gui, int numOfCrafts, int w, int h, FontRenderer fontRendererObj, RenderItem itemRender) + { + if(TCCycleTimer == 0) + { + TCItemCycle.clear(); + for(int i = 0; i < 4; i++) + { + TCItemCycle.add(gui.mc.theWorld.rand.nextInt(18)); + } + TCCycleTimer = 100; + } + else + { + TCCycleTimer--; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.enableGUIStandardItemLighting(); + gui.mc.getTextureManager().bindTexture(guiLocation2); + final IRecipe recipe; + + gui.drawTexturedModalRect(w / 2 + 7, h / 2 - 48, 157, 57, 99, 40); + + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), new ItemStack( + TCRecipe.get(0), 1, TCItemCycle.get(0)), w / 2 + 45, h / 2 - 37); + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), new ItemStack( + TCRecipe.get(1), 1, TCItemCycle.get(1)), w / 2 + 27, h / 2 - 45); + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), new ItemStack( + TCRecipe.get(2), 1, TCItemCycle.get(2)), w / 2 + 28, h / 2 - 27); + + if(TCRecipe.size() <= 3) + { + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), ToolBuilder.instance.buildTool(new ItemStack( + TCRecipe.get(0), 1, TCItemCycle.get(0)), new ItemStack( + TCRecipe.get(1), 1, TCItemCycle.get(1)), new ItemStack( + TCRecipe.get(2), 1, TCItemCycle.get(2)), "Result"), w / 2 + 87, h / 2 - 37); + } + else + { + + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), new ItemStack( + TCRecipe.get(3), 1, TCItemCycle.get(3)), w / 2 + 11, h / 2 - 37); + itemRender.renderItemAndEffectIntoGUI(fontRendererObj, gui.mc.getTextureManager(), ToolBuilder.instance.buildTool(new ItemStack( + TCRecipe.get(0), 1, TCItemCycle.get(0)), new ItemStack( + TCRecipe.get(1), 1, TCItemCycle.get(1)), new ItemStack( + TCRecipe.get(2), 1, TCItemCycle.get(2)), new ItemStack( + TCRecipe.get(3), 1, TCItemCycle.get(3)), "Result"), w / 2 + 87, h / 2 - 37); + } + + GL11.glEnable(GL11.GL_BLEND); + } + } + + static void drawCenteredSplit(int x, int y, String str, FontRenderer fontRendererObj) + { + int index = 0; + int h = 0; + int endIndex = 0; + int spaceIndex = 0; + while(str.length() > index) + { + endIndex = index + 22; + if(index + 22 > str.length()) + { + endIndex = str.length(); + } + + String sub = ""; + spaceIndex = endIndex; + + for(int i = index; i < endIndex; i++) + { + final char test = str.toCharArray()[i]; + if(test == ' ') + { + spaceIndex = i; + } + if(i == endIndex - 1) + { + if(test != ' ' && i != str.length() - 1) + { + sub = str.substring(index, spaceIndex); + index = spaceIndex; + } + else + { + sub = str.substring(index, endIndex); + index = endIndex; + } + } + } + + h += fontRendererObj.FONT_HEIGHT; + fontRendererObj.drawString(sub, x - fontRendererObj.getStringWidth(sub) / 2, h + y, 0); + } + } + + static IRecipe lookUpRecipe(ItemStack stack) + { + final List recipes = CraftingManager.getInstance().getRecipeList(); + final Iterator recipe = recipes.iterator(); + + while(recipe.hasNext()) + { + final ItemStack next = recipe.next().getRecipeOutput(); + if(next != null) + { + if(next.getItem() == stack.getItem()) + return recipe.next(); + } + } + return null; + } + + static void DrawRecipe(FontRenderer font, TextureManager tex, IRecipe recipe, int x, int y, int w, int h) + { + if(recipe instanceof ShapelessRecipes) + { + final ShapelessRecipes SRecipe = (ShapelessRecipes) recipe; + for(int i = 0; i < 9; i++) + { + if(SRecipe.recipeItems.get(i) != null) + { + if(((ItemStack) SRecipe.recipeItems.get(i)).getItem() instanceof ItemBlock) + { + RenderHelper.enableStandardItemLighting(); + } + else + { + RenderHelper.enableGUIStandardItemLighting(); + } + itemRender.renderItemAndEffectIntoGUI(font, tex, (ItemStack) SRecipe.recipeItems.get(i), w / 2 + x + ((i % 3) * 17), h / 2 + y + (i / 3 * 17)); + } + } + } + else if(recipe instanceof ShapedOreRecipe) + { + // final ShapedOreRecipe SRecipe = (ShapedOreRecipe) recipe; + // for(int i = 0; i < 9; i++) + // { + // if(SRecipe.getInput() != null && OreDictionary. SRecipe.getInput()[i] instanceof ItemStack) + // { + // if(((ItemStack) SRecipe.getInput()[i]).getItem() instanceof ItemBlock) + // { + // RenderHelper.enableStandardItemLighting(); + // } + // else + // { + // RenderHelper.enableGUIStandardItemLighting(); + // } + // itemRender.renderItemAndEffectIntoGUI(font, tex, (ItemStack) SRecipe.getInput()[i], w / 2 + x + ((i % 3) * 17), h / 2 + y + (i / 3 * 17)); + // } + // } + } + else if(recipe instanceof ShapelessOreRecipe) + { + // final ShapelessOreRecipe SRecipe = (ShapelessOreRecipe) recipe; + // for(int i = 0; i < 9; i++) + // { + // if(SRecipe.getInput() != null && SRecipe.getInput().get(i) instanceof ItemStack) + // { + // if(((ItemStack) SRecipe.getInput().get(i)).getItem() instanceof ItemBlock) + // { + // RenderHelper.enableStandardItemLighting(); + // } + // else + // { + // RenderHelper.enableGUIStandardItemLighting(); + // } + // itemRender.renderItemAndEffectIntoGUI(font, tex, (ItemStack) SRecipe.getInput().get(i), w / 2 + x + ((i % 3) * 17), h / 2 + y + (i / 3 * 17)); + // } + // } + } + else + { + final ShapedRecipes SRecipe = (ShapedRecipes) recipe; + for(int i = 0; i < 9; i++) + { + if(SRecipe.recipeItems[i] != null) + { + if(SRecipe.recipeItems[i].getItem() instanceof ItemBlock) + { + RenderHelper.enableStandardItemLighting(); + } + else + { + RenderHelper.enableGUIStandardItemLighting(); + } + itemRender.renderItemAndEffectIntoGUI(font, tex, SRecipe.recipeItems[i], w / 2 + x + ((i % 3) * 17), h / 2 + y + (i / 3 * 17)); + } + } + } + itemRender.renderItemAndEffectIntoGUI(font, tex, recipe.getRecipeOutput(), w / 2 + 87, 64 + 83); + + } +} diff --git a/src/main/java/lance5057/tDefense/core/items/GuideBook.java b/src/main/java/lance5057/tDefense/core/items/GuideBook.java new file mode 100644 index 0000000..215b8a1 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/items/GuideBook.java @@ -0,0 +1,25 @@ +package lance5057.tDefense.core.items; + +import lance5057.tDefense.Reference; +import lance5057.tDefense.TinkersDefense; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class GuideBook extends Item +{ + public GuideBook() + { + this.setCreativeTab(TinkersDefense.tabName); + this.setMaxStackSize(1); + this.setUnlocalizedName("guidebook"); + this.setTextureName(Reference.MOD_ID + ":tdbook"); + } + + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + player.openGui(TinkersDefense.instance, TinkersDefense.GUI_GUIDEBOOK, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ); + return stack; + } +} diff --git a/src/main/java/lance5057/tDefense/core/items/MetaModifierItem.java b/src/main/java/lance5057/tDefense/core/items/MetaModifierItem.java new file mode 100644 index 0000000..0bd5f11 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/items/MetaModifierItem.java @@ -0,0 +1,63 @@ +package lance5057.tDefense.core.items; + +import java.util.List; + +import lance5057.tDefense.Reference; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +public class MetaModifierItem extends Item +{ + public IIcon[] icons; + public String[] names; + int metaAmount; + + public MetaModifierItem(String unlocalizedName, int metaAmount, String[] names) + { + super(); + setHasSubtypes(true); + setUnlocalizedName(unlocalizedName); + setCreativeTab(CreativeTabs.tabMaterials); + this.metaAmount = metaAmount; + this.names = names; + icons = new IIcon[metaAmount]; + } + + @Override + public void registerIcons(IIconRegister reg) + { + for(int i = 0; i < metaAmount; i++) + { + icons[i] = reg.registerIcon(Reference.MOD_ID + ":item_" + names[i]); + } + } + + @Override + public IIcon getIconFromDamage(int meta) + { + if(meta > metaAmount - 1) + { + meta = 0; + } + + return icons[meta]; + } + + @Override + public void getSubItems(Item item, CreativeTabs tab, List list) + { + for(int i = 0; i < metaAmount; i++) + { + list.add(new ItemStack(item, 1, i)); + } + } + + @Override + public String getUnlocalizedName(ItemStack stack) + { + return this.getUnlocalizedName() + "_" + names[stack.getItemDamage()]; + } +} diff --git a/src/main/java/lance5057/tDefense/core/renderer/BigFlexibleToolRenderer.java b/src/main/java/lance5057/tDefense/core/renderer/BigFlexibleToolRenderer.java deleted file mode 100644 index c69f966..0000000 --- a/src/main/java/lance5057/tDefense/core/renderer/BigFlexibleToolRenderer.java +++ /dev/null @@ -1,329 +0,0 @@ -package lance5057.tDefense.core.renderer; - -//Owned by Tinkers Construct with small edit - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import tconstruct.TConstruct; -import tconstruct.client.FlexibleToolRenderer; -import tconstruct.library.tools.ToolCore; - -public class BigFlexibleToolRenderer extends FlexibleToolRenderer -{ - public float depth = 1 / 32f; - - public void setDepth(float d) - { - depth = d; - } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - if(!item.hasTagCompound()) - return false; - - switch(type) - { - case ENTITY: - //GL11.glTranslatef(-0.0625F, -0.0625F, 0F); - return true; - case EQUIPPED: - //GL11.glTranslatef(0.03f, 0F, -0.09375F); - case EQUIPPED_FIRST_PERSON: - return true; - case INVENTORY: - return true; - default: - TConstruct.logger.warn("[TCon] Unhandled render case!"); - case FIRST_PERSON_MAP: - return false; - } - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return handleRenderType(item, type) & helper.ordinal() < ItemRendererHelper.EQUIPPED_BLOCK.ordinal(); - } - - private static final int toolIcons = 10; - - protected void specialAnimation(ItemRenderType type, ItemStack item) - { - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - if(item == null || item.getItem() == null || !(item.getItem() instanceof ToolCore)) - return; - - Entity ent = null; - if(data.length > 1) - ent = (Entity) data[1]; - - IIcon[] parts = new IIcon[toolIcons]; - int iconParts = getIcons(item, type, ent, parts); - - // drawing the inventory is a simple procedure - if(type == ItemRenderType.INVENTORY) - { - renderInventory(iconParts, parts, item); - return; - } - - Tessellator tess = Tessellator.instance; - float[] xMax = new float[iconParts]; - float[] yMin = new float[iconParts]; - float[] xMin = new float[iconParts]; - float[] yMax = new float[iconParts]; - - float[] width = new float[iconParts]; - float[] height = new float[iconParts]; - float[] xDiff = new float[iconParts]; - float[] yDiff = new float[iconParts]; - float[] xSub = new float[iconParts]; - float[] ySub = new float[iconParts]; - for(int i = 0; i < iconParts; ++i) - { - IIcon icon = parts[i]; - xMin[i] = icon.getMinU(); - xMax[i] = icon.getMaxU(); - yMin[i] = icon.getMinV(); - yMax[i] = icon.getMaxV(); - width[i] = icon.getIconWidth(); - height[i] = icon.getIconHeight(); - xDiff[i] = xMin[i] - xMax[i]; - yDiff[i] = yMin[i] - yMax[i]; - xSub[i] = 0.5f * (xMax[i] - xMin[i]) / width[i]; - ySub[i] = 0.5f * (yMax[i] - yMin[i]) / height[i]; - } - - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - - GL11.glScalef(1.5f, 1.5f, 1.5f); - GL11.glTranslatef(-0.325f, -0.025f, 0f); - - if(type != ItemRenderType.ENTITY) - { - specialAnimation(type, item); - } - else - GL11.glTranslatef(-0.5f, -0.25f, 0); // why? because.. minecraft. - - // prepare colors - int[] color = new int[iconParts]; - for(int i = 0; i < iconParts; i++) - color[i] = item.getItem().getColorFromItemStack(item, i); - - // one side - tess.startDrawingQuads(); - tess.setNormal(0, 0, 1); - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - tess.addVertexWithUV(0, 0, +depth, xMax[i], yMax[i]); - tess.addVertexWithUV(1, 0, +depth, xMin[i], yMax[i]); - tess.addVertexWithUV(1, 1, +depth, xMin[i], yMin[i]); - tess.addVertexWithUV(0, 1, +depth, xMax[i], yMin[i]); - } - tess.draw(); - - // other side - tess.startDrawingQuads(); - tess.setNormal(0, 0, -1); - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - tess.addVertexWithUV(0, 1, -depth, xMax[i], yMin[i]); - tess.addVertexWithUV(1, 1, -depth, xMin[i], yMin[i]); - tess.addVertexWithUV(1, 0, -depth, xMin[i], yMax[i]); - tess.addVertexWithUV(0, 0, -depth, xMax[i], yMax[i]); - } - tess.draw(); - - // make it have "depth" - tess.startDrawingQuads(); - tess.setNormal(-1, 0, 0); - float pos; - float iconPos; - - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - float w = width[i], m = xMax[i], d = xDiff[i], s = xSub[i]; - for(int k = 0, e = (int) w; k < e; ++k) - { - pos = k / w; - iconPos = m + d * pos - s; - tess.addVertexWithUV(pos, 0, -depth, iconPos, yMax[i]); - tess.addVertexWithUV(pos, 0, +depth, iconPos, yMax[i]); - tess.addVertexWithUV(pos, 1, +depth, iconPos, yMin[i]); - tess.addVertexWithUV(pos, 1, -depth, iconPos, yMin[i]); - } - } - - tess.draw(); - tess.startDrawingQuads(); - tess.setNormal(1, 0, 0); - float posEnd; - - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - float w = width[i], m = xMax[i], d = xDiff[i], s = xSub[i]; - float d2 = 1f / w; - for(int k = 0, e = (int) w; k < e; ++k) - { - pos = k / w; - iconPos = m + d * pos - s; - posEnd = pos + d2; - tess.addVertexWithUV(posEnd, 1, -depth, iconPos, yMin[i]); - tess.addVertexWithUV(posEnd, 1, +depth, iconPos, yMin[i]); - tess.addVertexWithUV(posEnd, 0, +depth, iconPos, yMax[i]); - tess.addVertexWithUV(posEnd, 0, -depth, iconPos, yMax[i]); - } - } - - tess.draw(); - tess.startDrawingQuads(); - tess.setNormal(0, 1, 0); - - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - float h = height[i], m = yMax[i], d = yDiff[i], s = ySub[i]; - float d2 = 1f / h; - for(int k = 0, e = (int) h; k < e; ++k) - { - pos = k / h; - iconPos = m + d * pos - s; - posEnd = pos + d2; - tess.addVertexWithUV(0, posEnd, +depth, xMax[i], iconPos); - tess.addVertexWithUV(1, posEnd, +depth, xMin[i], iconPos); - tess.addVertexWithUV(1, posEnd, -depth, xMin[i], iconPos); - tess.addVertexWithUV(0, posEnd, -depth, xMax[i], iconPos); - } - } - - tess.draw(); - tess.startDrawingQuads(); - tess.setNormal(0, -1, 0); - - for(int i = 0; i < iconParts; ++i) - { - tess.setColorOpaque_I(color[i]); - float h = height[i], m = yMax[i], d = yDiff[i], s = ySub[i]; - for(int k = 0, e = (int) h; k < e; ++k) - { - pos = k / h; - iconPos = m + d * pos - s; - tess.addVertexWithUV(1, pos, +depth, xMin[i], iconPos); - tess.addVertexWithUV(0, pos, +depth, xMax[i], iconPos); - tess.addVertexWithUV(0, pos, -depth, xMax[i], iconPos); - tess.addVertexWithUV(1, pos, -depth, xMin[i], iconPos); - } - } - - tess.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - - //edit - GL11.glScalef(2f, 2f, 2f); - - GL11.glPopMatrix(); - } - - public void renderInventory(int count, IIcon[] icons, ItemStack item) - { - Tessellator tess = Tessellator.instance; - GL11.glPushMatrix(); - - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); - //GL11.glDisable(GL11.GL_BLEND); - - tess.startDrawingQuads(); - - // draw a simple rectangle for the inventory icon - for(int i = 0; i < count; ++i) - { - tess.setColorOpaque_I(item.getItem().getColorFromItemStack(item, i)); - - final IIcon icon = icons[i]; - final float xmin = icon.getMinU(); - final float xmax = icon.getMaxU(); - final float ymin = icon.getMinV(); - final float ymax = icon.getMaxV(); - tess.addVertexWithUV(0, 16, 0, xmin, ymax); - tess.addVertexWithUV(16, 16, 0, xmax, ymax); - tess.addVertexWithUV(16, 0, 0, xmax, ymin); - tess.addVertexWithUV(0, 0, 0, xmin, ymin); - } - tess.draw(); - - //GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - - public int getIcons(ItemStack item, ItemRenderType type, Entity ent, IIcon[] parts) - { - int iconParts = toolIcons;//tool.getRenderPasses(item.getItemDamage()); - // TODO: have the tools define how many render passes they have - // (requires more logic rewrite than it sounds like) - - boolean isInventory = type == ItemRenderType.INVENTORY; - ToolCore tool = (ToolCore) item.getItem(); - - IIcon[] tempParts = new IIcon[iconParts]; - label: - { - if(!isInventory && ent instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) ent; - ItemStack itemInUse = player.getItemInUse(); - if(itemInUse != null) - { - int useCount = player.getItemInUseCount(); - for(int i = iconParts; i-- > 0;) - tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount); - break label; - } - } - for(int i = iconParts; i-- > 0;) - tempParts[i] = tool.getIcon(item, i); - } - - int count = 0; - for(int i = 0; i < iconParts; ++i) - { - IIcon part = tempParts[i]; - if(part == null || part == ToolCore.blankSprite || part == ToolCore.emptyIcon) - ++count; - else - parts[i - count] = part; - } - iconParts -= count; - - if(iconParts <= 0) - { - iconParts = 1; - parts[0] = ToolCore.blankSprite; - } - - return iconParts; - } -} diff --git a/src/main/java/lance5057/tDefense/core/renderer/HookRenderer.java b/src/main/java/lance5057/tDefense/core/renderer/HookRenderer.java new file mode 100644 index 0000000..04ea899 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/renderer/HookRenderer.java @@ -0,0 +1,122 @@ +package lance5057.tDefense.core.renderer; + +import lance5057.tDefense.core.entity.EntityHookshotHook; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class HookRenderer extends Render +{ + ResourceLocation head = new ResourceLocation( + "tinkersdefense:textures/entity/swordhead.png"); + ResourceLocation chain = new ResourceLocation( + "tinkersdefense:textures/entity/chain.png"); + + public HookRenderer() + { + + } + + @Override + public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + drawHook(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + drawChain(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); + } + + void drawHook(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + bindEntityTexture(p_76986_1_); + GL11.glPushMatrix(); + GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); + GL11.glRotatef(p_76986_1_.prevRotationYaw + (p_76986_1_.rotationYaw - p_76986_1_.prevRotationYaw) * p_76986_9_ - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_, 0.0F, 0.0F, 1.0F); + final Tessellator tessellator = Tessellator.instance; + final float f2 = 0.0F; + final float f3 = 1.0F; + final float f10 = 0.5F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + for(int i = 0; i < 4; ++i) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-1.0D, -1.0D, 0.0D, f2, f2); + tessellator.addVertexWithUV(1.0D, -1.0D, 0.0D, f2, f3); + tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, f3, f3); + tessellator.addVertexWithUV(-1.0D, 1.0D, 0.0D, f3, f2); + tessellator.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + void drawChain(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) + { + final EntityHookshotHook hook = (EntityHookshotHook) p_76986_1_; + final EntityPlayer player = hook.worldObj.getPlayerEntityByName(hook.getPlayer()); + + final float f2 = 0; + float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F; + f3 = (f3 * f3 + f3) * 0.2F; + final float f4 = (float) (player.posX - p_76986_1_.posX - (p_76986_1_.prevPosX - p_76986_1_.posX) * (1.0F - p_76986_9_)); + final float f5 = (float) (f3 + player.posY - 1.0D - p_76986_1_.posY - (p_76986_1_.prevPosY - p_76986_1_.posY) * (1.0F - p_76986_9_)); + final float f6 = (float) (player.posZ - p_76986_1_.posZ - (p_76986_1_.prevPosZ - p_76986_1_.posZ) * (1.0F - p_76986_9_)); + final float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6); + final float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6); + GL11.glPushMatrix(); + GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); + GL11.glRotatef((float) (-Math.atan2(f6, f4)) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef((float) (-Math.atan2(f7, f5)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); + final Tessellator tessellator = Tessellator.instance; + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_CULL_FACE); + bindTexture(chain); + GL11.glShadeModel(GL11.GL_SMOOTH); + final float f9 = 0.0F - (f8) * 0.1F; + final float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F - (p_76986_1_.ticksExisted + p_76986_9_) * 0.01F; + + GL11.glScalef(0.5f, 0.5f, 1); + for(int j = 0; j < 2; j++) + { + tessellator.startDrawing(5); + final byte b0 = 2; + GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); + for(int i = 0; i < b0; ++i) + { + + final float f11 = MathHelper.sin(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F; + final float f12 = MathHelper.cos(i % b0 * (float) Math.PI * 2.0F / b0) * 0.75F; + final float f13 = i % b0 * 1.0F / b0; + tessellator.addVertexWithUV(f11, f12, 0.0D, 0, 0); + tessellator.addVertexWithUV(f11, f12, f8, 0, f9); + tessellator.addVertexWithUV(f11, f12, 0.0D, 1, 0); + tessellator.addVertexWithUV(f11, f12, f8, 1, f9); + } + tessellator.draw(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glShadeModel(GL11.GL_FLAT); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + // TODO Auto-generated method stub + return head; + } +} diff --git a/src/main/java/lance5057/tDefense/core/renderer/MoreFlexibleToolRenderer.java b/src/main/java/lance5057/tDefense/core/renderer/MoreFlexibleToolRenderer.java new file mode 100644 index 0000000..e1fe841 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/renderer/MoreFlexibleToolRenderer.java @@ -0,0 +1,355 @@ +package lance5057.tDefense.core.renderer; + +//Owned by Tinkers Construct with small edit + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import tconstruct.TConstruct; +import tconstruct.client.FlexibleToolRenderer; +import tconstruct.library.tools.ToolCore; + +public class MoreFlexibleToolRenderer extends FlexibleToolRenderer +{ + private float scale = 1f; + private final float x, y, z; + public float depth = 1 / 32f; + + public MoreFlexibleToolRenderer(float size, float x, float y, float z) + { + scale = size; + this.x = x; + this.y = y; + this.z = z; + } + + @Override + public void setDepth(float d) + { + depth = d; + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + if(!item.hasTagCompound()) + return false; + + switch(type) + { + case ENTITY: + //GL11.glTranslatef(-0.0625F, -0.0625F, 0F); + return true; + case EQUIPPED: + //GL11.glTranslatef(0.03f, 0F, -0.09375F); + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + TConstruct.logger.warn("[TCon] Unhandled render case!"); + case FIRST_PERSON_MAP: + return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return handleRenderType(item, type) & helper.ordinal() < ItemRendererHelper.EQUIPPED_BLOCK.ordinal(); + } + + private static final int toolIcons = 10; + + @Override + protected void specialAnimation(ItemRenderType type, ItemStack item) + { + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + if(item == null || item.getItem() == null || !(item.getItem() instanceof ToolCore)) + return; + + Entity ent = null; + if(data.length > 1) + { + ent = (Entity) data[1]; + } + + final IIcon[] parts = new IIcon[toolIcons]; + final int iconParts = getIcons(item, type, ent, parts); + + // drawing the inventory is a simple procedure + if(type == ItemRenderType.INVENTORY) + { + renderInventory(iconParts, parts, item); + return; + } + + final Tessellator tess = Tessellator.instance; + final float[] xMax = new float[iconParts]; + final float[] yMin = new float[iconParts]; + final float[] xMin = new float[iconParts]; + final float[] yMax = new float[iconParts]; + + final float[] width = new float[iconParts]; + final float[] height = new float[iconParts]; + final float[] xDiff = new float[iconParts]; + final float[] yDiff = new float[iconParts]; + final float[] xSub = new float[iconParts]; + final float[] ySub = new float[iconParts]; + for(int i = 0; i < iconParts; ++i) + { + final IIcon icon = parts[i]; + xMin[i] = icon.getMinU(); + xMax[i] = icon.getMaxU(); + yMin[i] = icon.getMinV(); + yMax[i] = icon.getMaxV(); + width[i] = icon.getIconWidth(); + height[i] = icon.getIconHeight(); + xDiff[i] = xMin[i] - xMax[i]; + yDiff[i] = yMin[i] - yMax[i]; + xSub[i] = 0.5f * (xMax[i] - xMin[i]) / width[i]; + ySub[i] = 0.5f * (yMax[i] - yMin[i]) / height[i]; + } + + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + //edit + //GL11.glScalef(scale, scale, scale); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(x, y, z); + + if(type != ItemRenderType.ENTITY) + { + specialAnimation(type, item); + } + else + { + GL11.glTranslatef(-0.5f, -0.25f, 0); // why? because.. minecraft. + } + + // prepare colors + final int[] color = new int[iconParts]; + for(int i = 0; i < iconParts; i++) + { + color[i] = item.getItem().getColorFromItemStack(item, i); + } + + // one side + tess.startDrawingQuads(); + tess.setNormal(0, 0, 1); + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + tess.addVertexWithUV(0, 0, +depth, xMax[i], yMax[i]); + tess.addVertexWithUV(1, 0, +depth, xMin[i], yMax[i]); + tess.addVertexWithUV(1, 1, +depth, xMin[i], yMin[i]); + tess.addVertexWithUV(0, 1, +depth, xMax[i], yMin[i]); + } + tess.draw(); + + // other side + tess.startDrawingQuads(); + tess.setNormal(0, 0, -1); + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + tess.addVertexWithUV(0, 1, -depth, xMax[i], yMin[i]); + tess.addVertexWithUV(1, 1, -depth, xMin[i], yMin[i]); + tess.addVertexWithUV(1, 0, -depth, xMin[i], yMax[i]); + tess.addVertexWithUV(0, 0, -depth, xMax[i], yMax[i]); + } + tess.draw(); + + // make it have "depth" + tess.startDrawingQuads(); + tess.setNormal(-1, 0, 0); + float pos; + float iconPos; + + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + final float w = width[i], m = xMax[i], d = xDiff[i], s = xSub[i]; + for(int k = 0, e = (int) w; k < e; ++k) + { + pos = k / w; + iconPos = m + d * pos - s; + tess.addVertexWithUV(pos, 0, -depth, iconPos, yMax[i]); + tess.addVertexWithUV(pos, 0, +depth, iconPos, yMax[i]); + tess.addVertexWithUV(pos, 1, +depth, iconPos, yMin[i]); + tess.addVertexWithUV(pos, 1, -depth, iconPos, yMin[i]); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(1, 0, 0); + float posEnd; + + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + final float w = width[i], m = xMax[i], d = xDiff[i], s = xSub[i]; + final float d2 = 1f / w; + for(int k = 0, e = (int) w; k < e; ++k) + { + pos = k / w; + iconPos = m + d * pos - s; + posEnd = pos + d2; + tess.addVertexWithUV(posEnd, 1, -depth, iconPos, yMin[i]); + tess.addVertexWithUV(posEnd, 1, +depth, iconPos, yMin[i]); + tess.addVertexWithUV(posEnd, 0, +depth, iconPos, yMax[i]); + tess.addVertexWithUV(posEnd, 0, -depth, iconPos, yMax[i]); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(0, 1, 0); + + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + final float h = height[i], m = yMax[i], d = yDiff[i], s = ySub[i]; + final float d2 = 1f / h; + for(int k = 0, e = (int) h; k < e; ++k) + { + pos = k / h; + iconPos = m + d * pos - s; + posEnd = pos + d2; + tess.addVertexWithUV(0, posEnd, +depth, xMax[i], iconPos); + tess.addVertexWithUV(1, posEnd, +depth, xMin[i], iconPos); + tess.addVertexWithUV(1, posEnd, -depth, xMin[i], iconPos); + tess.addVertexWithUV(0, posEnd, -depth, xMax[i], iconPos); + } + } + + tess.draw(); + tess.startDrawingQuads(); + tess.setNormal(0, -1, 0); + + for(int i = 0; i < iconParts; ++i) + { + tess.setColorOpaque_I(color[i]); + final float h = height[i], m = yMax[i], d = yDiff[i], s = ySub[i]; + for(int k = 0, e = (int) h; k < e; ++k) + { + pos = k / h; + iconPos = m + d * pos - s; + tess.addVertexWithUV(1, pos, +depth, xMin[i], iconPos); + tess.addVertexWithUV(0, pos, +depth, xMax[i], iconPos); + tess.addVertexWithUV(0, pos, -depth, xMax[i], iconPos); + tess.addVertexWithUV(1, pos, -depth, xMin[i], iconPos); + } + } + + tess.draw(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + + GL11.glPopMatrix(); + } + + @Override + public void renderInventory(int count, IIcon[] icons, ItemStack item) + { + final Tessellator tess = Tessellator.instance; + GL11.glPushMatrix(); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); + //GL11.glDisable(GL11.GL_BLEND); + + tess.startDrawingQuads(); + + // draw a simple rectangle for the inventory icon + for(int i = 0; i < count; ++i) + { + tess.setColorOpaque_I(item.getItem().getColorFromItemStack(item, i)); + + final IIcon icon = icons[i]; + final float xmin = icon.getMinU(); + final float xmax = icon.getMaxU(); + final float ymin = icon.getMinV(); + final float ymax = icon.getMaxV(); + tess.addVertexWithUV(0, 16, 0, xmin, ymax); + tess.addVertexWithUV(16, 16, 0, xmax, ymax); + tess.addVertexWithUV(16, 0, 0, xmax, ymin); + tess.addVertexWithUV(0, 0, 0, xmin, ymin); + } + tess.draw(); + + //GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + @Override + public int getIcons(ItemStack item, ItemRenderType type, Entity ent, IIcon[] parts) + { + int iconParts = toolIcons;//tool.getRenderPasses(item.getItemDamage()); + // TODO: have the tools define how many render passes they have + // (requires more logic rewrite than it sounds like) + + final boolean isInventory = type == ItemRenderType.INVENTORY; + final ToolCore tool = (ToolCore) item.getItem(); + + final IIcon[] tempParts = new IIcon[iconParts]; + label: + { + if(!isInventory && ent instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) ent; + final ItemStack itemInUse = player.getItemInUse(); + if(itemInUse != null) + { + final int useCount = player.getItemInUseCount(); + for(int i = iconParts; i-- > 0;) + { + tempParts[i] = tool.getIcon(item, i, player, itemInUse, useCount); + } + break label; + } + } + for(int i = iconParts; i-- > 0;) + { + tempParts[i] = tool.getIcon(item, i); + } + } + + int count = 0; + for(int i = 0; i < iconParts; ++i) + { + final IIcon part = tempParts[i]; + if(part == null || part == ToolCore.blankSprite || part == ToolCore.emptyIcon) + { + ++count; + } + else + { + parts[i - count] = part; + } + } + iconParts -= count; + + if(iconParts <= 0) + { + iconParts = 1; + parts[0] = ToolCore.blankSprite; + } + + return iconParts; + } +} diff --git a/src/main/java/lance5057/tDefense/core/renderer/TestSkinChanger.java b/src/main/java/lance5057/tDefense/core/renderer/TestSkinChanger.java new file mode 100644 index 0000000..047b305 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/renderer/TestSkinChanger.java @@ -0,0 +1,58 @@ +//package lance5057.tDefense.core.renderer; +// +//import java.util.Map; +// +//import com.google.common.collect.Maps; +// +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.model.ModelHorse; +//import net.minecraft.client.renderer.entity.RenderHorse; +//import net.minecraft.client.renderer.texture.ITextureObject; +//import net.minecraft.client.renderer.texture.LayeredTexture; +//import net.minecraft.entity.Entity; +//import net.minecraft.entity.passive.EntityHorse; +//import net.minecraft.util.ResourceLocation; +// +//public class TestSkinChanger extends RenderHorse +//{ +// private static final Map textures = Maps.newHashMap(); +// private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; +// private String[] combinedHorseTextures = new String[3]; +// +// public TestSkinChanger() +// { +// super(new ModelHorse(), 1); +// } +// +// @Override +// protected ResourceLocation getEntityTexture(Entity ent) +// { +// if(ent instanceof EntityHorse) +// { +// EntityHorse entHorse = (EntityHorse) ent; +// +// String rc = "tinkersdefense:textures/skin/horse/horse_witherskeleton.png"; +// +// return renderHorse(entHorse, rc); +// } +// return null; +// } +// +// private ResourceLocation renderHorse(EntityHorse ent, String rc) +// { +// String s = ent.getHorseTexture(); +// ResourceLocation resourcelocation = (ResourceLocation)textures.get(s); +// +// if (resourcelocation == null) +// { +// resourcelocation = new ResourceLocation(s); +// String[] str = ent.getVariantTexturePaths(); +// str[0] = rc; +// str[1] = null; +// Minecraft.getMinecraft().getTextureManager().loadTexture(resourcelocation, new LayeredTexture(str)); +// textures.put(s, resourcelocation); +// } +// +// return resourcelocation; +// } +//} diff --git a/src/main/java/lance5057/tDefense/core/tools/ModifierSoul.java b/src/main/java/lance5057/tDefense/core/tools/ModifierSoul.java new file mode 100644 index 0000000..b4d03ac --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/ModifierSoul.java @@ -0,0 +1,30 @@ +package lance5057.tDefense.core.tools; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; + +public class ModifierSoul extends ModifierBoolExclusive +{ + String name; + public ModifierSoul(ItemStack[] items, int effect, String tag, String c, String tip, String[] exclusive, int modsNeeded, String[] excludeMods, String name) + { + super(items, effect, tag, c, tip, exclusive, modsNeeded, excludeMods); + this.name = name; + } + + @Override + public void modify(ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + tags.setBoolean(key, true); + tags.setString("Soul", name); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= modsNeeded; + tags.setInteger("Modifiers", modifiers); + + addToolTip(tool, color + tooltipName, color + key); + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/RoundShield.java b/src/main/java/lance5057/tDefense/core/tools/RoundShield.java index 9a7cd45..474854e 100644 --- a/src/main/java/lance5057/tDefense/core/tools/RoundShield.java +++ b/src/main/java/lance5057/tDefense/core/tools/RoundShield.java @@ -1,19 +1,11 @@ package lance5057.tDefense.core.tools; -import java.util.List; - import lance5057.tDefense.TinkersDefense; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import tconstruct.tools.TinkerTools; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class RoundShield extends Shield { @@ -22,7 +14,7 @@ public class RoundShield extends Shield public RoundShield() { super(0); - this.setUnlocalizedName("shield"); + setUnlocalizedName("shield"); } @Override @@ -49,6 +41,12 @@ public class RoundShield extends Shield return 2; } + @Override + public int getModifierAmount() + { + return 1; + } + @Override public float getRepairCost() { @@ -58,7 +56,7 @@ public class RoundShield extends Shield @Override public float getDurabilityModifier() { - return 1.5f; + return 1f; } @Override diff --git a/src/main/java/lance5057/tDefense/core/tools/Shears.java b/src/main/java/lance5057/tDefense/core/tools/Shears.java index 8870766..046acdc 100644 --- a/src/main/java/lance5057/tDefense/core/tools/Shears.java +++ b/src/main/java/lance5057/tDefense/core/tools/Shears.java @@ -87,23 +87,22 @@ public class Shears extends ToolCore return new String[] {"shears"}; } + @Override public boolean onBlockDestroyed(ItemStack p_150894_1_, World p_150894_2_, Block p_150894_3_, int p_150894_4_, int p_150894_5_, int p_150894_6_, EntityLivingBase p_150894_7_) { if(p_150894_3_.getMaterial() != Material.leaves && p_150894_3_ != Blocks.web && p_150894_3_ != Blocks.tallgrass && p_150894_3_ != Blocks.vine && p_150894_3_ != Blocks.tripwire && !(p_150894_3_ instanceof IShearable)) - { return super.onBlockDestroyed(p_150894_1_, p_150894_2_, p_150894_3_, p_150894_4_, p_150894_5_, p_150894_6_, p_150894_7_); - } else - { return true; - } } + @Override public boolean func_150897_b(Block p_150897_1_) { return p_150897_1_ == Blocks.web || p_150897_1_ == Blocks.redstone_wire || p_150897_1_ == Blocks.tripwire; } + @Override public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { return p_150893_2_ != Blocks.web && p_150893_2_.getMaterial() != Material.leaves ? (p_150893_2_ == Blocks.wool ? 5.0F : super.func_150893_a(p_150893_1_, p_150893_2_)) : 15.0F; @@ -116,15 +115,14 @@ public class Shears extends ToolCore public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) { if(entity.worldObj.isRemote) - { return false; - } if(entity instanceof IShearable) { - IShearable target = (IShearable) entity; + final IShearable target = (IShearable) entity; if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) { - ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + final int enchant = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack); + final ArrayList drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, enchant); if(itemstack.getTagCompound().getCompoundTag("InfiTool").hasKey("Rainbow")) { @@ -137,10 +135,10 @@ public class Shears extends ToolCore } } - Random rand = new Random(); - for(ItemStack stack : drops) + final Random rand = new Random(); + for(final ItemStack stack : drops) { - EntityItem ent = entity.entityDropItem(stack, 1.0F); + final EntityItem ent = entity.entityDropItem(stack, 1.0F); ent.motionY += rand.nextFloat() * 0.05F; ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F; ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F; @@ -156,25 +154,24 @@ public class Shears extends ToolCore public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { if(player.worldObj.isRemote) - { return false; - } - Block block = player.worldObj.getBlock(x, y, z); + final Block block = player.worldObj.getBlock(x, y, z); if(block instanceof IShearable) { - IShearable target = (IShearable) block; + final IShearable target = (IShearable) block; if(target.isShearable(itemstack, player.worldObj, x, y, z)) { - ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); - Random rand = new Random(); + final ArrayList drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack)); + final Random rand = new Random(); - for(ItemStack stack : drops) + for(final ItemStack stack : drops) { - float f = 0.7F; - double d = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; - double d1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; - double d2 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; - EntityItem entityitem = new EntityItem(player.worldObj, (double) x + d, (double) y + d1, (double) z + d2, stack); + final float f = 0.7F; + final double d = rand.nextFloat() * f + (1.0F - f) * 0.5D; + final double d1 = rand.nextFloat() * f + (1.0F - f) * 0.5D; + final double d2 = rand.nextFloat() * f + (1.0F - f) * 0.5D; + final EntityItem entityitem = new EntityItem( + player.worldObj, x + d, y + d1, z + d2, stack); entityitem.delayBeforeCanPickup = 10; player.worldObj.spawnEntityInWorld(entityitem); } diff --git a/src/main/java/lance5057/tDefense/core/tools/Shield.java b/src/main/java/lance5057/tDefense/core/tools/Shield.java index f867dd0..030a62f 100644 --- a/src/main/java/lance5057/tDefense/core/tools/Shield.java +++ b/src/main/java/lance5057/tDefense/core/tools/Shield.java @@ -52,16 +52,7 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche @Override public float getDigSpeed(ItemStack stack, Block block, int meta) { - if(stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) - return 0.1f; - for(int i = 0; i < web.length; i++) - { - if(web[i] == block.getMaterial()) - { - return effectiveSpeed(); - } - } - return baseSpeed(); + return 0.0f; } /** @@ -90,7 +81,7 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + player.setItemInUse(stack, getMaxItemUseDuration(stack)); return stack; } @@ -126,8 +117,8 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche super.onUpdate(stack, world, entity, par4, par5); if(entity instanceof EntityPlayerSP) { - EntityPlayerSP player = (EntityPlayerSP) entity; - ItemStack usingItem = player.getItemInUse(); + final EntityPlayerSP player = (EntityPlayerSP) entity; + final ItemStack usingItem = player.getItemInUse(); if(usingItem != null && usingItem.getItem() == this) { player.movementInput.moveForward *= 2.5F; @@ -155,9 +146,7 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche public int getArrowCount(ItemStack stack) { if(stack.hasTagCompound() && stack.getTagCompound().hasKey("arrows")) - { return stack.getTagCompound().getShort("arrows"); - } else return 0; } @@ -247,8 +236,8 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche @Optional.Method(modid = "battlegear2") public float getDecayRate(ItemStack stack) { - NBTTagCompound tags = stack.getTagCompound(); - float recovery = tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") / 1.5f; + final NBTTagCompound tags = stack.getTagCompound(); + final float recovery = tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") + (tags.getCompoundTag("InfiTool").getInteger("feathers") * 300) / 1.5f; return 10f / recovery; } @@ -256,8 +245,8 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche @Optional.Method(modid = "battlegear2") public float getRecoveryRate(ItemStack stack) { - NBTTagCompound tags = stack.getTagCompound(); - float recovery = tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") / 1.5f; + final NBTTagCompound tags = stack.getTagCompound(); + final float recovery = tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") + (tags.getCompoundTag("InfiTool").getInteger("feathers") * 300) / 1.5f; return 10f / recovery; } @@ -296,11 +285,11 @@ public class Shield extends ToolCore implements IShield, ISheathed, IArrowCatche @SideOnly(Side.CLIENT) public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - NBTTagCompound tags = par1ItemStack.getTagCompound(); + final NBTTagCompound tags = par1ItemStack.getTagCompound(); super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); par3List.add(""); - par3List.add(EnumChatFormatting.DARK_GREEN + ItemStack.field_111284_a.format(1F / (10f / (tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") / 1.5f)) / 20F) + StatCollector.translateToLocal("attribute.shield.block.time")); - int arrowCount = getArrowCount(par1ItemStack); + par3List.add(EnumChatFormatting.DARK_GREEN + ItemStack.field_111284_a.format(1F / (10f / (tags.getCompoundTag("InfiTool").getInteger("MiningSpeed") + (tags.getCompoundTag("InfiTool").getInteger("feathers") * 300) / 1.5f)) / 20F) + StatCollector.translateToLocal("attribute.shield.block.time")); + final int arrowCount = getArrowCount(par1ItemStack); if(arrowCount > 0) { par3List.add(String.format("%s%s %s", EnumChatFormatting.GOLD, arrowCount, StatCollector.translateToLocal("attribute.shield.arrow.count"))); diff --git a/src/main/java/lance5057/tDefense/core/tools/TinkerWrench.java b/src/main/java/lance5057/tDefense/core/tools/TinkerWrench.java index 514718b..da288be 100644 --- a/src/main/java/lance5057/tDefense/core/tools/TinkerWrench.java +++ b/src/main/java/lance5057/tDefense/core/tools/TinkerWrench.java @@ -1,33 +1,25 @@ package lance5057.tDefense.core.tools; +import ic2.api.tile.IWrenchable; + import java.util.List; -import ic2.api.tile.IWrenchable; -import mekanism.api.IMekWrench; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; 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.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; import tconstruct.tools.TinkerTools; import buildcraft.api.tools.IToolWrench; import cofh.api.block.IDismantleable; import cofh.api.item.IToolHammer; -import cofh.lib.util.helpers.BlockHelper; import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.event.FMLMissingMappingsEvent.Action; -import cpw.mods.fml.common.eventhandler.Event.Result; @Optional.InterfaceList({@Optional.Interface(modid = "buildcraft", iface = "buildcraft.api.tools.IToolWrench"), @Optional.Interface(modid = "cofh", iface = "cofh.api.item.IToolHammer")}) public class TinkerWrench extends ToolCore implements IToolWrench, IToolHammer @@ -37,7 +29,7 @@ public class TinkerWrench extends ToolCore implements IToolWrench, IToolHammer public TinkerWrench() { super(0); - this.setUnlocalizedName("tinkerwrench"); + setUnlocalizedName("tinkerwrench"); } @Override @@ -122,12 +114,10 @@ public class TinkerWrench extends ToolCore implements IToolWrench, IToolHammer @Optional.Method(modid = "buildcraft") public boolean canWrench(EntityPlayer player, int x, int y, int z) { - NBTTagCompound tags = player.inventory.getCurrentItem().getTagCompound().getCompoundTag("InfiTool"); + final NBTTagCompound tags = player.inventory.getCurrentItem().getTagCompound().getCompoundTag("InfiTool"); if(!tags.getBoolean("Broken")) - { return true; - } return false; } @@ -157,44 +147,59 @@ public class TinkerWrench extends ToolCore implements IToolWrench, IToolHammer } + // //Skin Changer + // @Override + // public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) + // { + // if(entity.worldObj.isRemote) + // { + // return false; + // } + // if(entity instanceof EntityAnimal) + // { + // EntityAnimal target = (EntityAnimal) entity; + // player.openGui(TinkersDefense.instance, TinkersDefense.GUI_ANVIL_INV, player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ); + // return true; + // } + // return false; + // } + @Override public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { - Block block = world.getBlock(x, y, z); - TileEntity te = world.getTileEntity(x, y, z); - int metaData = world.getBlockMetadata(x, y, z); + final Block block = world.getBlock(x, y, z); + final TileEntity te = world.getTileEntity(x, y, z); + final int metaData = world.getBlockMetadata(x, y, z); if(te != null && te instanceof IWrenchable) { - IWrenchable wte = (IWrenchable) te; + final IWrenchable wte = (IWrenchable) te; if(!player.isSneaking()) { -// for(int step = 1; step < 6; step++) -// { - //side = (wte.getFacing() + 6 - step) % 6; + // for(int step = 1; step < 6; step++) + // { + //side = (wte.getFacing() + 6 - step) % 6; if(!world.isRemote) { //side = side % -3;//(wte.getFacing() + step) % 6; -// + // if(wte.wrenchCanSetFacing(player, side)) { - wte.setFacing((short)side); + wte.setFacing((short) side); return true; } } -// } + // } } else { if(!world.isRemote) { - List drops = block.getDrops(world, x, y, z, metaData, 0); - boolean dropBlock = false; - + final List drops = block.getDrops(world, x, y, z, metaData, 0); if(world.rand.nextFloat() <= wte.getWrenchDropRate()) { - ItemStack drop = wte.getWrenchDrop(player); + final ItemStack drop = wte.getWrenchDrop(player); if(drop != null) { if(drops.isEmpty()) @@ -207,9 +212,10 @@ public class TinkerWrench extends ToolCore implements IToolWrench, IToolHammer } } } - for(ItemStack itemStack : drops) + for(final ItemStack itemStack : drops) { - EntityItem ei = new EntityItem(world, x, y, z, itemStack.copy()); + final EntityItem ei = new EntityItem(world, x, y, z, + itemStack.copy()); world.spawnEntityInWorld(ei); } world.removeTileEntity(x, y, z); diff --git a/src/main/java/lance5057/tDefense/core/tools/TinkerZweihander.java b/src/main/java/lance5057/tDefense/core/tools/TinkerZweihander.java index c6b2cef..7f99f22 100644 --- a/src/main/java/lance5057/tDefense/core/tools/TinkerZweihander.java +++ b/src/main/java/lance5057/tDefense/core/tools/TinkerZweihander.java @@ -2,9 +2,6 @@ package lance5057.tDefense.core.tools; import java.util.List; -import mods.battlegear2.api.PlayerEventChild; -import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -17,8 +14,6 @@ import net.minecraft.world.World; import tconstruct.library.tools.Weapon; import tconstruct.tools.TinkerTools; import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @Optional.InterfaceList({@Optional.Interface(modid = "battlegear2", iface = "mods.battlegear2.api.weapons.IBattlegearWeapon"),}) public class TinkerZweihander extends Weapon @@ -27,7 +22,7 @@ public class TinkerZweihander extends Weapon public TinkerZweihander(int baseDamage) { super(3); - this.setUnlocalizedName("zweihander"); + setUnlocalizedName("zweihander"); } @Override @@ -59,7 +54,7 @@ public class TinkerZweihander extends Weapon { if(!player.isPotionActive(Potion.moveSlowdown)) { - List entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.posX - 2, player.posY - 2, player.posZ - 2, player.posX + 2, player.posY + 2, player.posZ + 2)); + final List entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.posX - 2, player.posY - 2, player.posZ - 2, player.posX + 2, player.posY + 2, player.posZ + 2)); for(int i = 0; i < entities.size(); i++) { @@ -70,7 +65,8 @@ public class TinkerZweihander extends Weapon player.worldObj.playSoundAtEntity((Entity) entities.get(i), "mob.zombie.metal", 15f, 1f); } } - player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, 3)); + player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 20, + 3)); player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 1)); } @@ -148,24 +144,13 @@ public class TinkerZweihander extends Weapon // } // } - @Override - @Optional.Method(modid = "battlegear2") - public boolean isOffhandHandDual(ItemStack off) - { - return false; - } - - @Override - @Optional.Method(modid = "battlegear2") - public boolean offhandAttackEntity(PlayerEventChild.OffhandAttackEvent event, ItemStack mainhandItem, ItemStack offhandItem) - { - return false; - } - @Override @Optional.Method(modid = "battlegear2") public boolean allowOffhand(ItemStack mainhand, ItemStack offhand) { - return false; + if(offhand == null) + return true; + else + return false; } } diff --git a/src/main/java/lance5057/tDefense/core/tools/TinkersHookshot.java b/src/main/java/lance5057/tDefense/core/tools/TinkersHookshot.java new file mode 100644 index 0000000..b0b3ef0 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/TinkersHookshot.java @@ -0,0 +1,119 @@ +package lance5057.tDefense.core.tools; + +import java.util.List; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.entity.EntityHookshotHook; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import tconstruct.library.crafting.ToolBuilder; +import tconstruct.library.tools.ToolCore; +import tconstruct.tools.TinkerTools; + +public class TinkersHookshot extends ToolCore +{ + + public TinkersHookshot() + { + super(0); + // TODO Auto-generated constructor stub + } + + @Override + public String getDefaultFolder() + { + return "hookshot"; + } + + @Override + public String getEffectSuffix() + { + return "_hookshot_effect"; + } + + @Override + public int getPartAmount() + { + return 3; + } + + @Override + public Item getHeadItem() + { + return TinkersDefense.partArmorplate; + } + + @Override + public Item getAccessoryItem() + { + return TinkersDefense.partChainmaille; + } + + @Override + public Item getHandleItem() + { + return TinkerTools.toughRod; + } + + @Override + public String getIconSuffix(int partType) + { + switch(partType) + { + case 0: + return "_hookshot_chamber"; + case 1: + return "_hookshot_chamber_broken"; + case 2: + return "_hookshot_handle"; + case 3: + return "_hookshot_chain"; + default: + return ""; + } + } + + @Override + public String[] getTraits() + { + return new String[] {"hookshot"}; + } + + @Override + public void buildTool(int id, String name, List list) + { + final Item accessory = getAccessoryItem(); + final ItemStack accessoryStack = accessory != null ? new ItemStack( + getAccessoryItem(), 1, id) : null; + final Item extra = getExtraItem(); + final ItemStack extraStack = extra != null ? new ItemStack(extra, 1, id) : null; + final ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack( + getHeadItem(), 1, id), new ItemStack(getHandleItem(), 1, id), accessoryStack, extraStack, name); + if(tool != null) + { + tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true); + tool.getTagCompound().getCompoundTag("InfiTool").setInteger("ChainLength", 10); + list.add(tool); + } + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + player.setItemInUse(stack, getMaxItemUseDuration(stack)); + final EntityHookshotHook hook = new EntityHookshotHook(player.worldObj, + player); + hook.setPlayer(player); + hook.setHook("test"); + hook.setHookshot(stack); + if(!player.worldObj.isRemote) + { + player.worldObj.spawnEntityInWorld(hook); + } + return stack; + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ActiveToolMods/TDefenseActiveToolMod.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ActiveToolMods/TDefenseActiveToolMod.java index ece08f3..52663ce 100644 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/ActiveToolMods/TDefenseActiveToolMod.java +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/ActiveToolMods/TDefenseActiveToolMod.java @@ -1,21 +1,16 @@ package lance5057.tDefense.core.tools.modifiers.ActiveToolMods; -import java.util.Random; - import lance5057.tDefense.core.tools.modifiers.Modifiers; -import lance5057.tDefense.core.tools.modifiers.ToolMods; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import tconstruct.library.ActiveToolMod; import tconstruct.library.tools.ToolCore; public class TDefenseActiveToolMod extends ActiveToolMod { - Modifiers TDMods = new Modifiers(); + Modifiers mods = new Modifiers(); // BotaniaToolMods FlowerMods = new BotaniaToolMods(); @@ -24,47 +19,13 @@ public class TDefenseActiveToolMod extends ActiveToolMod { if(stack.hasTagCompound() && stack.getTagCompound().hasKey("InfiTool")) { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + final NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); if(!tags.getBoolean("Broken")) { // TDefense - TDMods.UpdateAll(tool, stack, world, entity, tags); - - // Botania - // if(Loader.isModLoaded("Botania")) - // { - // FlowerMods.UpdateAll(tool, stack, world, entity, tags); - // } - + mods.UpdateAll(tool, stack, world, entity, tags); } } } - - @Override - public int baseAttackDamage(int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity) - { - if(!toolTags.hasKey("Broken")) - { - if(toolTags.hasKey("Daze")) - { - int[] array = toolTags.getIntArray("Daze"); - int chance = array[0] * 5; - - Random roll = new Random(); - int num = roll.nextInt(100) + 1; - - if(num <= chance) - { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(2, 3 * 20, 100)); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(9, 3 * 20, 100)); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(15, 3 * 20, 100)); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(18, 3 * 20, 100)); - } - } - } - - return 0; - } - } diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/BloodMagic/BloodMagicMods.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/BloodMagic/BloodMagicMods.java new file mode 100644 index 0000000..1d1d284 --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/BloodMagic/BloodMagicMods.java @@ -0,0 +1,133 @@ +package lance5057.tDefense.core.tools.modifiers.BloodMagic; + +import lance5057.tDefense.TDIntegration; +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; +import tconstruct.library.crafting.ModifyBuilder; +import tconstruct.library.tools.ToolCore; +import WayofTime.alchemicalWizardry.ModItems; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; +import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe; +import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; +import WayofTime.alchemicalWizardry.common.items.EnergyItems; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; + +public class BloodMagicMods extends ModifiersBase +{ + + public BloodMagicMods() + { + super(new String[] {"bindingwrap", "bloodybandages"}, "modItemsBloodMagic"); + } + + @Override + public void RegisterRecipes() + { + GameRegistry.addRecipe(new ShapedBloodOrbRecipe(new ItemStack(modItems, + 1, 0), new Object[] {"sts", "cbc", "sos", 's', new ItemStack( + ModItems.weakBloodShard, 1, 0), 't', new ItemStack( + TinkersDefense.partChainmaille, 1, 2), 'c', new ItemStack( + ModItems.standardBindingAgent, 1, 0), 'b', new ItemStack( + ModItems.energySword, 1, 0), 'o', new ItemStack( + ModItems.magicianBloodOrb, 1, 0)})); + + AltarRecipeRegistry.registerAltarRecipe(new ItemStack(modItems, 1, 1), new ItemStack( + TinkersDefense.partCloth, 1, -1), 2, 12000, 10, 10, false); + + } + + @Override + public void RegisterModifiers() + { + // TODO Auto-generated method stub + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 0)}, + TinkersDefense.config.BloodOathModID, "BloodOath", + EnumChatFormatting.RED.toString(), "Blood Oath", + new String[] {"weapon"}, 1, null)); + + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 1)}, + TinkersDefense.config.ScabbingModID, "Scabbing", + EnumChatFormatting.DARK_RED.toString(), "Scabbing", + new String[] {}, 1, new String[] {"Supping"})); + + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(ModItems.apprenticeBloodOrb, 1), new ItemStack( + ModItems.sacrificialDagger, 1)}, + TinkersDefense.config.SuppingModID, "Supping", + EnumChatFormatting.DARK_RED.toString(), "Supping", + new String[] {"weapon"}, 1, new String[] {"Scabbing"})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.BloodOathModID, "tinker", "bloodoath", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ScabbingModID, "tinker", "scabbing", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.SuppingModID, "tinker", "supping", true); + } + } + + @Override + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + if(!world.isRemote) + { + if(tags.hasKey("Scabbing")) + { + SoulNetworkHandler.checkAndSetItemOwner(stack, (EntityPlayer) entity); + UpdateScabbing(tool, stack, world, entity, tags); + } + } + } + + public void UpdateScabbing(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + if(tags.getInteger("Damage") > 0 && EnergyItems.syphonBatteries(stack, (EntityPlayer) entity, 50)) + { + tags.setInteger("Damage", tags.getInteger("Damage") - 1); + } + } + + @SubscribeEvent + public void BloodOathInteractEvent(LivingAttackEvent event) + { + if(TDIntegration.bloodMagic && !event.entity.worldObj.isRemote) + { + if(event.source.getEntity() instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.source.getEntity(); + final ItemStack heldItem = player.getHeldItem(); + + if(heldItem != null && heldItem.getItem() != null && heldItem.getItem() instanceof ToolCore) + { + SoulNetworkHandler.checkAndSetItemOwner(heldItem, player); + final NBTTagCompound tags = heldItem.getTagCompound().getCompoundTag("InfiTool"); + + if(tags.hasKey("BloodOath") && EnergyItems.syphonBatteries(heldItem, player, 50)) + { + event.entityLiving.addPotionEffect(new PotionEffect( + Potion.weakness.id, 30, 2)); + } + + if(tags.hasKey("Supping")) + { + SoulNetworkHandler.addCurrentEssenceToMaximum(SoulNetworkHandler.getOwnerName(heldItem), 10, SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(SoulNetworkHandler.getOwnerName(heldItem)))); + } + } + } + } + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/BotaniaMods.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/BotaniaMods.java index cf19f23..eda2388 100644 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/BotaniaMods.java +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/BotaniaMods.java @@ -1,80 +1,210 @@ package lance5057.tDefense.core.tools.modifiers.Botania; +import lance5057.tDefense.TDIntegration; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifierIntExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.oredict.ShapedOreRecipe; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.ModifyBuilder; +import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; import tconstruct.tools.TinkerTools; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.common.entity.EntityManaBurst; import vazkii.botania.common.item.ModItems; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; +import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraSword; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibOreDict; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.registry.GameRegistry; @Optional.InterfaceList({@Optional.Interface(modid = "botania", iface = "vazkii.botania.common.entity.EntityManaBurst"), @Optional.Interface(modid = "botania", iface = "vazkii.botania.common.item.ModItems"), @Optional.Interface(modid = "botania", iface = "vazkii.botania.common.item.equipment.tool.ToolCommons"), @Optional.Interface(modid = "botania", iface = "vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraSword"),}) -public class BotaniaMods +public class BotaniaMods extends ModifiersBase { - Item corpseIvyGraft; - Item corpseIvy; - public BotaniaMods() { - LoadItems(); + super(new String[] {"corpseIvyGraft", "corpseIvy", "terraCore", "manaCore", "elementiumcore"}, "modItemsBotania"); } - public void LoadItems() + @Override + public void RegisterRecipes() { - corpseIvyGraft = new Item().setUnlocalizedName("corpseivygraft").setCreativeTab(TinkersDefense.tabName).setTextureName("tinkersdefense:corpseIvyGraft"); + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe( + new ItemStack(modItems, 1, 0), + new Object[] {"fsf", "oio", "fgf", 'f', ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), 'i', new ItemStack( + ModItems.keepIvy, 1, 0), 's', LibOreDict.MANA_STRING, 'g', new ItemStack( + TinkerTools.craftedSoil, 1, 3), 'o', new ItemStack( + ModItems.fertilizer, 1, 1)})); - corpseIvy = new Item().setUnlocalizedName("corpseivy").setCreativeTab(TinkersDefense.tabName).setTextureName("tinkersdefense:corpseIvy"); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 2), new Object[] {"sis", "idi", "sis", 'i', new ItemStack( + ModItems.manaResource, 1, 4), 's', new ItemStack( + ModItems.manaResource, 1, 12), 'd', new ItemStack( + ModItems.manaResource, 1, 2)}); - GameRegistry.registerItem(corpseIvyGraft, "corpseivygraft"); - GameRegistry.registerItem(corpseIvy, "corpseivy"); - } + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 2), new Object[] {"sis", "idi", "sis", 'i', new ItemStack( + ModItems.manaResource, 1, 4), 's', new ItemStack( + ModItems.manaResource, 1, 12), 'd', new ItemStack( + ModItems.manaResource, 1, 1)}); - public void RegisterRecipes() - { - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(corpseIvyGraft), new Object[] {"fsf", "oio", "fgf", 'f', ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), 'i', new ItemStack(ModItems.keepIvy, 1, 0), 's', LibOreDict.MANA_STRING, 'g', new ItemStack(TinkerTools.craftedSoil, 1, 3), 'o', new ItemStack(ModItems.fertilizer, 1, 1)})); + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 3), new Object[] {"sis", "idi", "sis", 'i', new ItemStack( + ModItems.manaResource, 1, 0), 's', new ItemStack( + ModItems.manaResource, 1, 12), 'd', new ItemStack( + ModItems.manaTablet)}); - BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(corpseIvy, 1, 0), new ItemStack(corpseIvyGraft, 1, 0), 100000); + BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(modItems, 1, 1), new ItemStack( + modItems, 1, 0), 100000); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 4, 0), new Object[] {"sis", "idi", "sis", 'i', new ItemStack( + ModItems.manaResource, 1, 7), 's', new ItemStack( + ModItems.manaResource, 1, 12), 'd', new ItemStack( + ModItems.manaResource, 1, 2)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 4, 0), new Object[] {"sis", "idi", "sis", 'i', new ItemStack( + ModItems.manaResource, 1, 7), 's', new ItemStack( + ModItems.manaResource, 1, 12), 'd', new ItemStack( + ModItems.manaResource, 1, 1)}); } + @Override public void RegisterModifiers() { - ModifyBuilder.registerModifier(new modifierCorpseIvy("Corpse Ivy", TinkersDefense.config.CorpseIvyModID, new ItemStack[] {new ItemStack(corpseIvy)}, new int[] {1})); + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 1)}, + TinkersDefense.config.CorpseIvyModID, "CorpseIvy", + EnumChatFormatting.DARK_GREEN.toString(), "Corpse Ivy", + new String[] {"weapon"}, 1, new String[] {"ManaCore"})); + + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 2)}, + TinkersDefense.config.TerraCoreModID, "TerraCore", + EnumChatFormatting.GREEN.toString(), "TerraCore", + new String[] {"weapon"}, 1, null)); + + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 3)}, + TinkersDefense.config.ManaRepairModID, "ManaCore", + EnumChatFormatting.AQUA.toString(), "ManaCore", + new String[] {}, 1, new String[] {"CorpseIvy"})); + + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 4)}, + TinkersDefense.config.ArmorPixieCoreModID, "ElementiumCore", 1, + EnumChatFormatting.LIGHT_PURPLE.toString(), "Elementium Core", + new String[] {"armor", "weapon"}, 1, new String[] {})); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CorpseIvyModID, "tinker", "corpseivy", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.TerraCoreModID, "tinker", "terracore", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ManaRepairModID, "tinker", "manacore", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ArmorPixieCoreModID, "tinker", "elementiumcore", true); + + } } + @Override public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { - UpdateTerraCore(tool, stack, world, entity, tags); + if(!world.isRemote) + { + if(tags.hasKey("TerraCore")) + { + UpdateTerraCore(tool, stack, world, entity, tags); + } + // if(tags.hasKey("CorpseIvy")) + // { + // UpdateCorpseIvy(tool, stack, world, entity, tags); + // } + if(tags.hasKey("ManaCore")) + { + UpdateManaRepair(tool, stack, world, entity, tags); + } + } } public void UpdateTerraCore(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { if(entity instanceof EntityPlayer) { - // EntityPlayer player = (EntityPlayer) entity; - // PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); - // float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; + final EntityPlayer player = (EntityPlayer) entity; + final PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed); + final float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F; - // if(player.getCurrentEquippedItem() == stack && player.swingProgress == check && !world.isRemote && world.rand.nextInt(2) == 0) - // { - // int color = TConstructRegistry.getMaterial(tags.getInteger("Head")).primaryColor(); - // EntityManaBurst burst = ((ItemTerraSword)ModItems.terraSword).getBurst(player, new ItemStack(ModItems.terraSword)); - // burst.setColor(color); - // world.spawnEntityInWorld(burst); - // ToolCommonSoundAtEntity(player, "botania:terraBlade", 0.4F, 1.4F); - // } + if(player.getCurrentEquippedItem() == stack && player.swingProgress == check && !world.isRemote && world.rand.nextInt(2) == 0) + { + final int color = TConstructRegistry.getMaterial(tags.getInteger("Head")).primaryColor(); + final EntityManaBurst burst = ((ItemTerraSword) ModItems.terraSword).getBurst(player, new ItemStack( + ModItems.terraSword)); + burst.setColor(color); + world.spawnEntityInWorld(burst); + //ToolCommonSoundAtEntity(player, "botania:terraBlade", 0.4F, 1.4F); + AbilityHelper.damageTool(stack, 1, player, false); + } + } + } + + // public void UpdateCorpseIvy(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + // { + // if(entity instanceof EntityPlayer) + // { + // final int mana = stack.getTagCompound().getCompoundTag("InfiTool").getInteger("CorpseIvyMana"); + // final int returned = ManaItemHandler.dispatchMana(stack, (EntityPlayer) entity, mana, true); + // stack.getTagCompound().getCompoundTag("InfiTool").setInteger("CorpseIvyMana", mana - returned); + // } + // } + + @SubscribeEvent + public void BotaniaAttackEvent(LivingAttackEvent event) + { + if(TDIntegration.botania) + { + if(event.source.getEntity() instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.source.getEntity(); + final ItemStack heldItem = player.getHeldItem(); + + if(heldItem != null && heldItem.getItem() != null && heldItem.getItem() instanceof ToolCore) + { + final NBTTagCompound tags = heldItem.getTagCompound().getCompoundTag("InfiTool"); + + if(tags.hasKey("CorpseIvy")) + { + ManaItemHandler.dispatchMana(heldItem, player, 100, true); + } + } + } + } + } + + public void UpdateManaRepair(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + if(entity instanceof EntityPlayer) + { + if(tags.getInteger("Damage") > 0) + { + + if(ManaItemHandler.requestManaExact(stack, (EntityPlayer) entity, 100, true)) + { + tags.setInteger("Damage", tags.getInteger("Damage") - 1); + } + + } } } } diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/modifierCorpseIvy.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/modifierCorpseIvy.java deleted file mode 100644 index 7335e93..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/Botania/modifierCorpseIvy.java +++ /dev/null @@ -1,67 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.Botania; - -import java.util.Arrays; -import java.util.List; - -import lance5057.tDefense.core.tools.Shield; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ItemModTypeFilter; - -public class modifierCorpseIvy extends ItemModTypeFilter -{ - String tooltipName; - String guiType; - - public modifierCorpseIvy(String type, int effect, ItemStack[] items, int[] values) - { - super(effect, "corpseivy", items, values); - tooltipName = "\u00A7fCorpse Drinker"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - if(list.contains("weapon")) - { - return tags.getInteger("Modifiers") > 0; - } - - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int increase = matchingAmount(input); - if(tags.hasKey(key)) - { - int[] keyPair = tags.getIntArray(key); - - updateModTag(tool, keyPair); - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00A76" + guiType; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A76" + guiType; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierBoolExclusive.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierBoolExclusive.java new file mode 100644 index 0000000..b785daf --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierBoolExclusive.java @@ -0,0 +1,83 @@ +package lance5057.tDefense.core.tools.modifiers; + +import java.util.Arrays; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import tconstruct.library.tools.ToolCore; +import tconstruct.modifiers.tools.ModBoolean; + +public class ModifierBoolExclusive extends ModBoolean +{ + String[] exclusive; + protected int modsNeeded = 0; + protected String color; + protected String tooltipName; + String[] modExclusions; + + /* + * excludeMods: If these modifier keys are present this modifier wont take. + */ + public ModifierBoolExclusive(ItemStack[] items, int effect, String tag, String c, String tip, String[] exclusive, int modsNeeded, String[] excludeMods) + { + super(items, effect, tag, c, tip); + this.exclusive = exclusive; + this.modsNeeded = modsNeeded; + color = c; + tooltipName = tip; + modExclusions = excludeMods; + } + + @Override + protected boolean canModify(ItemStack tool, ItemStack[] input) + { + final List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + boolean isExclusive = false; + boolean hasModRejection = false; + + if(exclusive.length > 0) + { + for(int i = 0; i < exclusive.length; i++) + { + if(list.contains(exclusive[i])) + { + isExclusive = true; + } + } + } + else + { + isExclusive = true; + } + + if(modExclusions != null) + { + for(int i = 0; i < modExclusions.length; i++) + { + if(tags.hasKey(modExclusions[i])) + { + hasModRejection = true; + } + } + } + + return isExclusive && !hasModRejection && !tags.hasKey(key); + } + + @Override + public void modify(ItemStack[] input, ItemStack tool) + { + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + tags.setBoolean(key, true); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= modsNeeded; + tags.setInteger("Modifiers", modifiers); + + addToolTip(tool, color + tooltipName, color + key); + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierIntExclusive.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierIntExclusive.java new file mode 100644 index 0000000..2db9f6b --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierIntExclusive.java @@ -0,0 +1,96 @@ +package lance5057.tDefense.core.tools.modifiers; + +import java.util.Arrays; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import tconstruct.library.tools.ToolCore; +import tconstruct.modifiers.tools.ModInteger; + +public class ModifierIntExclusive extends ModInteger +{ + String[] exclusive; + int modsNeeded = 0; + String color; + String tooltipName; + int initialIncrease; + int secondaryIncrease; + int max = 5; + String[] modExclusions; + + public ModifierIntExclusive(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip, String[] exclusive, int modsNeeded, String[] excludeMods) + { + super(items, effect, dataKey, increase, c, tip); + this.exclusive = exclusive; + this.modsNeeded = modsNeeded; + initialIncrease = secondaryIncrease = increase; + color = c; + tooltipName = tip; + this.modExclusions = excludeMods; + } + + public ModifierIntExclusive(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip, String[] exclusive, int modsNeeded, int max) + { + super(items, effect, dataKey, increase, c, tip); + this.exclusive = exclusive; + this.modsNeeded = modsNeeded; + initialIncrease = secondaryIncrease = increase; + color = c; + tooltipName = tip; + this.max = max; + } + + @Override + protected boolean canModify(ItemStack tool, ItemStack[] input) + { + List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + boolean isExclusive = false; + boolean hasModRejection = false; + + for(int i = 0; i < exclusive.length; i++) + { + if(list.contains(exclusive[i])) + { + isExclusive = true; + } + } + + if(modExclusions != null) + { + for(int i = 0; i < modExclusions.length; i++) + { + if(tags.hasKey(modExclusions[i])) + { + hasModRejection = true; + } + } + } + + return tags.getInteger(tooltipName) < max; + } + + @Override + public void modify(ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if(tags.hasKey(key)) + { + int increase = tags.getInteger(key); + increase += secondaryIncrease; + tags.setInteger(key, increase); + } + else + { + tags.setInteger(key, initialIncrease); + } + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= modsNeeded; + tags.setInteger("Modifiers", modifiers); + + addToolTip(tool, color + tooltipName, color + key); + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierSoulHandler.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierSoulHandler.java new file mode 100644 index 0000000..895675b --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifierSoulHandler.java @@ -0,0 +1,389 @@ +package lance5057.tDefense.core.tools.modifiers; + +import java.util.List; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.ArmorCore; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.event.ModifyEvent; +import tconstruct.library.tools.ToolCore; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class ModifierSoulHandler +{ + String name; + int time = 160; + boolean broken = false; + boolean newlymade = false; + boolean newlymodified = false; + boolean onFire = false; + boolean playerharmed = false; + boolean playerattacked = false; + float dmg = 0; + //boolean playerdead = false; + boolean storymode = false; + int story = 0; + int storyline = 0; + int numofstories = 0; + + public ModifierSoulHandler(int stories, String name) + { + MinecraftForge.EVENT_BUS.register(this); + numofstories = stories; + this.name = name; + } + + public void Update(ItemStack tool) + { + final WorldClient world = Minecraft.getMinecraft().theWorld; + final EntityPlayer player = Minecraft.getMinecraft().thePlayer; + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + String output = ""; + + if(time <= 0) + { + if(!tags.getBoolean("Broken")) + { + //player.addChatMessage(new ChatComponentText("Test")); + final List entities = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(player.posX - 20, player.posY - 20, player.posZ - 20, player.posX + 20, player.posY + 20, player.posZ + 20)); + int choice = world.rand.nextInt(3); + final float dmg = tags.getInteger("Damage"); + final float dur = tags.getInteger("TotalDurability"); + // if(playerdead) + // { + // output += "§4(Player Death)§f "; + // output += talk(output, world, (ToolCore) tool.getItem(), "death"); + // playerdead = false; + // } + + if(playerattacked) + { + output += "§7(Attacking)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "offense"); + playerattacked = false; + } + + else if(playerharmed) + { + output += "§4(Player Hurt)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "defense"); + playerattacked = false; + } + + else if(newlymade) + { + output += "§7(Greetings)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "creation"); + newlymade = false; + } + + else if(newlymodified) + { + output += "§7(Modified)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "modified"); + newlymodified = false; + } + + else if(onFire) + { + output += "§4(Player on Fire)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "onfire"); + } + + else if(player.getHealth() <= 6) + { + output += "§4(Player Low Health)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "lowhp"); + } + + else if(player.getFoodStats().getFoodLevel() <= 6) + { + output += "§4(Player Hungry)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "lowhunger"); + } + + else if((dur - dmg) / dur <= 0.1f) + { + output += "§4(Nearly Broken)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "lowdurability"); + } + + else if(broken) + { + output += "§7(Repaired)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "repaired"); + } + + //react entity + else if(choice == 0) + { + if(entities.size() > 0) + { + final EntityLiving ent = (EntityLiving) entities.get(world.rand.nextInt(entities.size())); + + if(ent instanceof EntityCreature || ent instanceof EntityFlying || ent instanceof EntitySlime) + { + final boolean doGeneral = world.rand.nextBoolean(); + final boolean doInsult = world.rand.nextBoolean(); + if(!doInsult) + { + if(!doGeneral) + { + output += "§7(" + ent.getClass().getName().substring(ent.getClass().getName().lastIndexOf("Entity") + 6).toLowerCase() + " Nearby)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), ent.getClass().getName().substring(ent.getClass().getName().lastIndexOf("Entity") + 6).toLowerCase() + "near"); + } + else + { + output += "§7(Creature Nearby)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "creaturenear"); + } + } + else + { + if(!doGeneral) + { + output += "§7(insult" + ent.getClass().getName().substring(ent.getClass().getName().lastIndexOf("Entity") + 6).toLowerCase() + ")§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "insult" + ent.getClass().getName().substring(ent.getClass().getName().lastIndexOf("Entity") + 6).toLowerCase()); + } + else + { + output += "§7(Generic Insult)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "insultother"); + } + } + } + + if(output.contains("~other~")) + { + output = output.replace("~other~", ent.getClass().getName().substring(ent.getClass().getName().lastIndexOf("Entity") + 6)); + } + } + } + //Story + else if(choice == 1) + { + story = world.rand.nextInt(numofstories); + output += story(output, world); + storymode = true; + } + //General Chat + else + { + choice = world.rand.nextInt(4); + if(choice == 0) + { + if(tool.getItem() instanceof ArmorCore) + { + output += talk(output, world, (ToolCore) tool.getItem(), "armor"); + + } + else + { + output += talk(output, world, (ToolCore) tool.getItem(), "weapon"); + } + } + else + { + output += talk(output, world, (ToolCore) tool.getItem(), "other"); + } + } + + if(storymode == true) + { + time = world.rand.nextInt(160) + 80; + } + else + { + time = world.rand.nextInt(1600) + 800; + if(TinkersDefense.config.debug) + { + time = world.rand.nextInt(160) + 80; + } + } + + } + else + { + if(broken == false) + { + output += "§4(Broken)§f "; + output += talk(output, world, (ToolCore) tool.getItem(), "broken"); + broken = true; + } + } + + formatOutput(output, player, tool); + } + else + { + time--; + } + + } + + String story(String output, WorldClient world) + { + final String line = StatCollector.translateToLocal("soul." + name + ".story." + story + "." + storyline); + if(!line.equals("soul." + name + ".story." + story + "." + storyline)) + { + storyline++; + return line; + } + else + { + storymode = false; + story = 0; + storyline = 0; + return ""; + } + + } + + String talk(String output, WorldClient world, ToolCore tool, String type) + { + final int lines = getAmountOfLines("soul." + name + "." + type + "."); + if(lines > 0) + return StatCollector.translateToLocal("soul." + name + "." + type + "." + world.rand.nextInt(lines)); + if(TinkersDefense.config.debug) + return "Error: No lines (" + type + " chat)"; + return ""; + } + + int getAmountOfLines(String type) + { + String nextLine = ""; + int i = -1; + do + { + i++; + nextLine = StatCollector.translateToLocal(type + i); + } + while(!nextLine.contains(type)); + return i; + } + + void formatOutput(String output, EntityPlayer player, ItemStack tool) + { + if(tool != null && output.contains("~tool~")) + { + output = output.replace("~tool~", ((ToolCore) tool.getItem()).getLocalizedToolName()); + } + if(output.contains("~player~")) + { + output = output.replace("~player~", player.getDisplayName()); + } + if(output.contains("~material~")) + { + output = output.replace("~material~", TConstructRegistry.toolMaterials.get(tool.getTagCompound().getCompoundTag("InfiTool").getInteger("Head")).localizedName()); + } + + if(output.contains("~damage~")) + { + output = output.replace("~damage~", Float.toString(dmg)); + } + + if(!output.isEmpty()) + { + player.addChatMessage(new ChatComponentText( + "[" + name + " the " + ((ToolCore) tool.getItem()).getLocalizedToolName() + "] " + output)); + } + else + { + if(TinkersDefense.config.debug) + { + player.addChatMessage(new ChatComponentText( + "Error: Soul missing line")); + } + } + } + + @SubscribeEvent + public void ModifySoulEvent(ModifyEvent event) + { + if(event.modifier.stacks != null && !event.modifier.stacks.isEmpty() && event.modifier.stacks.get(0) != null && ((ItemStack) event.modifier.stacks.get(0)).areItemStacksEqual((ItemStack) event.modifier.stacks.get(0), new ItemStack( + TinkersDefense.mods.TMod.modItems, 1, 3))) + { + newlymade = true; + + } + else if(event.itemStack.getTagCompound().getCompoundTag("InfiTool").hasKey("Ensouled")) + { + newlymodified = true; + } + + time = 0; + } + + @SubscribeEvent + public void HarmedEvent(LivingHurtEvent event) + { + if(event.entityLiving instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.entityLiving; + if(player.getUniqueID() == Minecraft.getMinecraft().thePlayer.getUniqueID()) + { + if(event.source.isFireDamage()) + { + onFire = true; + } + else + { + playerharmed = true; + dmg = event.ammount; + } + time = 0; + } + } + else if(event.source.getEntity() instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.source.getEntity(); + final String p = player.getDisplayName(); + final String s = Minecraft.getMinecraft().thePlayer.getDisplayName(); + if(p == s) + { + playerattacked = true; + dmg = event.ammount; + time = 0; + } + } + } + // @SubscribeEvent + // public void PlayerDeathEvent(LivingDeathEvent event) + // { + // if(event.entityLiving.worldObj.isRemote) + // if(event.entityLiving.isEntityEqual(Minecraft.getMinecraft().thePlayer)) + // { + // String output = ""; + // final int lines = getAmountOfLines("soul." + name + "." + "death" + "."); + // if(lines > 0) + // { + // output += StatCollector.translateToLocal("soul." + name + "." + "death" + "." + event.entityLiving.worldObj.rand.nextInt(lines)); + // } + // else if(TinkersDefense.config.debug) + // { + // output += "Error: No lines (" + "death" + " chat)"; + // } + // else + // { + // output += ""; + // } + // + // formatOutput(output, (EntityPlayer) event.entityLiving, null); + // } + // } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/Modifiers.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/Modifiers.java index fe3d4ca..f10fa68 100644 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/Modifiers.java +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/Modifiers.java @@ -1,67 +1,86 @@ package lance5057.tDefense.core.tools.modifiers; +import lance5057.tDefense.TDIntegration; +import lance5057.tDefense.armor.modifiers.ArmorMods; +import lance5057.tDefense.core.tools.modifiers.BloodMagic.BloodMagicMods; +import lance5057.tDefense.core.tools.modifiers.Botania.BotaniaMods; +import lance5057.tDefense.core.tools.modifiers.TDefense.TDMods; +import lance5057.tDefense.core.tools.modifiers.Thaumcraft.ThaumcraftMods; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import tconstruct.library.tools.ToolCore; -import lance5057.tDefense.TDIntegration; -import lance5057.tDefense.armor.modifiers.ArmorMods; -import lance5057.tDefense.core.tools.modifiers.Botania.BotaniaMods; -import lance5057.tDefense.core.tools.modifiers.Thaumcraft.ThaumcraftMods; public class Modifiers { - public static ToolMods TMod; - public static ArmorMods AMod; - public static BotaniaMods BotMod; - public static ThaumcraftMods ThaumMod; + public static TDMods TMod; + public static ArmorMods AMod; + public static BotaniaMods BotMod; + public static ThaumcraftMods ThaumMod; + public static BloodMagicMods BloodMod; public void preInit() { - TMod = new ToolMods(); - AMod = new ArmorMods(); - + TMod = new TDMods(); + AMod = new ArmorMods(); + if(TDIntegration.botania) { BotMod = new BotaniaMods(); } - + if(TDIntegration.thaumcraft) { ThaumMod = new ThaumcraftMods(); } + if(TDIntegration.bloodMagic) + { + BloodMod = new BloodMagicMods(); + } } public void Init() { TMod.RegisterRecipes(); TMod.RegisterModifiers(); - + AMod.RegisterRecipes(); AMod.RegisterModifiers(); - + if(BotMod != null) { BotMod.RegisterRecipes(); BotMod.RegisterModifiers(); } - + if(ThaumMod != null) { ThaumMod.RegisterRecipes(); ThaumMod.RegisterModifiers(); } + if(BloodMod != null) + { + BloodMod.RegisterRecipes(); + BloodMod.RegisterModifiers(); + } } - + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { TMod.UpdateAll(tool, stack, world, entity, tags); - AMod.UpdateAll(tool, stack, world, entity, tags); + //AMod.UpdateAll(tool, stack, world, entity, tags); if(BotMod != null) + { BotMod.UpdateAll(tool, stack, world, entity, tags); + } if(ThaumMod != null) + { ThaumMod.UpdateAll(tool, stack, world, entity, tags); - + } + if(BloodMod != null) + { + BloodMod.UpdateAll(tool, stack, world, entity, tags); + } } } diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifiersBase.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifiersBase.java new file mode 100644 index 0000000..94f555d --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/ModifiersBase.java @@ -0,0 +1,42 @@ +package lance5057.tDefense.core.tools.modifiers; + +import lance5057.tDefense.core.items.MetaModifierItem; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import tconstruct.library.tools.ToolCore; +import cpw.mods.fml.common.registry.GameRegistry; + +public abstract class ModifiersBase +{ + public MetaModifierItem modItems; + public String[] itemStrings; + public String name; + + public ModifiersBase(String[] strings, String name) + { + itemStrings = strings; + this.name = name; + + MinecraftForge.EVENT_BUS.register(this); + LoadItems(); + } + + public void LoadItems() + { + if(itemStrings != null && name != null) + { + modItems = new MetaModifierItem(name, itemStrings.length, + itemStrings); + GameRegistry.registerItem(modItems, name); + } + } + + public abstract void RegisterRecipes(); + + public abstract void RegisterModifiers(); + + public abstract void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags); +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/TDMods.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/TDMods.java new file mode 100644 index 0000000..9ed2d6c --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/TDMods.java @@ -0,0 +1,452 @@ +package lance5057.tDefense.core.tools.modifiers.TDefense; + +import java.util.ArrayList; +import java.util.Random; + +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.ModifierSoul; +import lance5057.tDefense.core.tools.Shield; +import lance5057.tDefense.core.tools.modifiers.ModifierBoolExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifierIntExclusive; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; +import lance5057.tDefense.core.tools.modifiers.modLapisShears; +import lance5057.tDefense.core.tools.modifiers.ActiveToolMods.TDefenseActiveToolMod; +import mods.battlegear2.api.PlayerEventChild.ShieldBlockEvent; +import mods.battlegear2.api.core.IBattlePlayer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.oredict.OreDictionary; +import tconstruct.library.TConstructRegistry; +import tconstruct.library.client.TConstructClientRegistry; +import tconstruct.library.crafting.ModifyBuilder; +import tconstruct.library.tools.ToolCore; +import tconstruct.tools.TinkerTools; +import tconstruct.weaponry.TinkerWeaponry; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; + +public class TDMods extends ModifiersBase +{ + public TDMods() + { + super(new String[] {"AncientRelic", "RainbowGem", "Textbook", "SoulStone", "CrestFeathers", "CrestMirrors", "CrestLegends", "CrestGluttony", "CrestThorns", "CrestSanguisuga", "CrestWinds", "CrestLight", "CrestPaper"}, "modItemsCore"); + } + + @Override + public void RegisterRecipes() + { + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent( + new ItemStack(modItems, 1, 0), 1, 1, 1)); + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent( + new ItemStack(modItems, 1, 3), 1, 1, 1)); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 1), new Object[] {"111", "1d1", "111", 'd', new ItemStack( + Items.diamond, 1, 0), '1', new ItemStack(Items.dye, 1, + OreDictionary.WILDCARD_VALUE)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 2), new Object[] {"-1-", "1d1", "-1-", 'd', new ItemStack( + Items.enchanted_book, 1, OreDictionary.WILDCARD_VALUE), '1', new ItemStack( + Items.experience_bottle, 1, 0)}); + + GameRegistry.addShapelessRecipe(new ItemStack(modItems, 1, 12), new ItemStack( + Items.enchanted_book, 1, OreDictionary.WILDCARD_VALUE)); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 4), new Object[] {"fcf", "sps", "fcf", 'f', new ItemStack( + Items.feather, 1, -1), 'c', new ItemStack( + TinkersDefense.partCloth, 1, OreDictionary.WILDCARD_VALUE), 's', new ItemStack( + Items.string, 1, -1), 'p', new ItemStack(modItems, 1, 12)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 5), new Object[] {"gng", "spc", "gbg", 'g', new ItemStack( + Blocks.glass_pane, 1, -1), 'c', new ItemStack( + TinkersDefense.partCloth, 1, OreDictionary.WILDCARD_VALUE), 's', new ItemStack( + Blocks.sand, 1, OreDictionary.WILDCARD_VALUE), 'p', new ItemStack( + modItems, 1, 12), 'n', new ItemStack(Items.nether_star, 1, 0), 'b', new ItemStack( + Blocks.gold_block, 1, 12)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 6), new Object[] {"-r-", "-p-", "---", 'r', new ItemStack( + modItems, 1, 0), 'p', new ItemStack(modItems, 1, 12)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 7), new Object[] {"aaa", "ipi", "aaa", 'i', TConstructRegistry.getItemStack("ingotPigIron"), 'p', new ItemStack( + modItems, 1, 12), 'a', new ItemStack(TinkerWeaponry.arrowhead, + 1, 5)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 8), new Object[] {"aia", "ipi", "aia", 'i', new ItemStack( + Items.iron_ingot, 1, 0), 'p', new ItemStack(modItems, 1, 12), 'a', new ItemStack( + TinkersDefense.partRivet, 1, 4)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 9), new Object[] {"brb", "apa", "ara", 'b', TConstructRegistry.getItemStack("necroticBone"), 'r', new ItemStack( + TinkerTools.toughRod, 1, 7), 'a', new ItemStack( + TinkerWeaponry.arrowhead, 1, 11), 'p', new ItemStack(modItems, + 1, 12)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 10), new Object[] {"PfP", "tpt", "PfP", 'P', new ItemStack( + Blocks.piston, 1, 0), 'p', new ItemStack(modItems, 1, 12), 'f', new ItemStack( + Items.feather, 1, 0), 't', new ItemStack(Items.ghast_tear, 1, 0)}); + + GameRegistry.addShapedRecipe(new ItemStack(modItems, 1, 11), new Object[] {"gbg", "tpt", "gbg", 'g', new ItemStack( + Blocks.glowstone, 1, 0), 'p', new ItemStack(modItems, 1, 12), 'b', new ItemStack( + Items.blaze_rod, 1, 0), 't', new ItemStack(Blocks.torch, 1, 0)}); + } + + @Override + public void RegisterModifiers() + { + //All + ModifyBuilder.registerModifier(new ModifierSoul( + new ItemStack[] {new ItemStack(modItems, 1, 3)}, + TinkersDefense.config.SoulSteveID, "Ensouled", + EnumChatFormatting.WHITE.toString(), "Ensouled (Steve)", + new String[] {}, 0, null, "Steve")); + + //Weapons + //TO-DO + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(Blocks.iron_block, 1, 0)}, + TinkersDefense.config.DazeID, "Daze", 1, + EnumChatFormatting.GRAY.toString(), "Daze", + new String[] {"weapon"}, 1, null)); + ModifyBuilder.registerModifier(new ModifierIntExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 2)}, + TinkersDefense.config.XPBoostID, "XPBoost", 1, + EnumChatFormatting.GREEN.toString(), "XP Boost", + new String[] {"weapon"}, 1, null)); + + //Shears + ModifyBuilder.registerModifier(new ModifierBoolExclusive( + new ItemStack[] {new ItemStack(modItems, 1, 1)}, + TinkersDefense.config.RainbowID, "Rainbow", + EnumChatFormatting.WHITE.toString(), "Rainbow", + new String[] {"shears"}, 1, null)); + + ModifyBuilder.registerModifier(new modLapisShears( + TinkersDefense.config.ShearFortuneID, + new ItemStack[] {new ItemStack(Items.dye, 1, 4), new ItemStack( + Blocks.lapis_block, 1, 0)}, new int[] {1, 9})); + + //Shields + RegisterCrestModifier(TinkersDefense.config.CrestFeathersID, "Feathers", 1, EnumChatFormatting.WHITE.toString(), new ItemStack( + modItems, 1, 4), 1); + RegisterCrestModifier(TinkersDefense.config.CrestMirrorsID, "Mirrors", EnumChatFormatting.DARK_AQUA.toString(), new ItemStack( + modItems, 1, 5), 1); + RegisterCrestModifier(TinkersDefense.config.CrestLegendsID, "Legends", EnumChatFormatting.GOLD.toString(), new ItemStack( + modItems, 1, 6), 1); + // RegisterCrestModifier(TinkersDefense.config.CrestBladesID, "Blades", 1, EnumChatFormatting.GRAY.toString(), new ItemStack( + // modItems, 1, 7), 1); + RegisterCrestModifier(TinkersDefense.config.CrestGluttonyID, "Gluttony", 1, EnumChatFormatting.DARK_GREEN.toString(), new ItemStack( + modItems, 1, 7), 1); + // RegisterCrestModifier(TinkersDefense.config.CrestPitchID, "Pitch", 1, EnumChatFormatting.DARK_GRAY.toString(), new ItemStack( + // modItems, 1, 8), 1); + RegisterCrestModifier(TinkersDefense.config.CrestThornsID, "Thorns", 1, EnumChatFormatting.GREEN.toString(), new ItemStack( + modItems, 1, 8), 1); + RegisterCrestModifier(TinkersDefense.config.CrestSanguisugaID, "Sanguisuga", 1, EnumChatFormatting.DARK_RED.toString(), new ItemStack( + modItems, 1, 9), 1); + RegisterCrestModifier(TinkersDefense.config.CrestWindsID, "Wind", 1, EnumChatFormatting.AQUA.toString(), new ItemStack( + modItems, 1, 10), 1); + // RegisterCrestModifier(TinkersDefense.config.CrestRetributionID, "Retribution", 1, EnumChatFormatting.LIGHT_PURPLE.toString(), new ItemStack( + // modItems, 1, 13), 1); + RegisterCrestModifier(TinkersDefense.config.CrestLightID, "Light", 1, EnumChatFormatting.YELLOW.toString(), new ItemStack( + modItems, 1, 11), 1); + + //Jokes + // ModifyBuilder.registerModifier(new ModifierBoolExclusive(new ItemStack[] {new ItemStack(Blocks.glass_pane)}, TinkersDefense.config.JokeInsultID, "Insulting", EnumChatFormatting.AQUA.toString(), "Joke: Insulting", null, 0, null)); + // ModifyBuilder.registerModifier(new ModifierBoolExclusive(new ItemStack[] {new ItemStack(Blocks.glass_pane)}, TinkersDefense.config.JokePyrotechID, "Pyrotech", EnumChatFormatting.AQUA.toString(), "Joke: Pyrotech", null, 0, null)); + //ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {new ItemStack(Items.slime_ball)}, TinkersDefense.config.JokeCompensateID, "Compensate", 1, EnumChatFormatting.DARK_GRAY.toString(), "Joke: Compensating", new String[] {"shield"}, 1, null)); + + TConstructRegistry.registerActiveToolMod(new TDefenseActiveToolMod()); + + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.DazeID, "tinker", "daze", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.ShearFortuneID, "tinker", "lapis", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.RainbowID, "rainbow", "daze", true); + + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestFeathersID, "tinker", "feathers", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestMirrorsID, "tinker", "mirrors", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestLegendsID, "tinker", "legends", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestBladesID, "tinker", "blades", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestGluttonyID, "tinker", "gluttony", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestPitchID, "tinker", "pitch", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestSanguisugaID, "tinker", "sanguisuga", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestWindsID, "tinker", "wind", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestRetributionID, "tinker", "retribution", true); + // TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestLightID, "tinker", "light", true); + + //TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.JokeInsultID, "tinker", "insult", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.JokePyrotechID, "tinker", "pyrotech", true); + //TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.JokeCompensateID, "tinker", "compensate", true); + + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.SoulBoundID, "tinker", "soulbound", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.RainbowID, "tinker", "rainbow", true); + TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.XPBoostID, "tinker", "textbook", true); + + } + } + + public void RegisterCrestModifier(int[] effect, String tag, int increase, String color, ItemStack item, int mods) + { + for(int i = 0; i < TinkersDefense.colors.length; i++) + { + final ItemStack[] items = {item, new ItemStack(Items.dye, 1, i)}; + ModifyBuilder.registerModifier(new ModifierIntExclusive(items, + effect[i], tag.toLowerCase(), increase, color, + "Crest of " + tag, new String[] {"shield"}, mods, null)); + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, effect[i], "tinker", TinkersDefense.colors[i] + "_" + tag.toLowerCase(), true); + } + } + } + + public void RegisterCrestModifier(int[] effect, String tag, String color, ItemStack item, int mods) + { + + for(int i = 0; i < TinkersDefense.colors.length; i++) + { + final ItemStack[] items = {item, new ItemStack(Items.dye, 1, i)}; + ModifyBuilder.registerModifier(new ModifierBoolExclusive(items, + effect[i], tag.toLowerCase(), color, "Crest of " + tag, + new String[] {"shield"}, mods, null)); + for(final ToolCore tool : TConstructRegistry.getToolMapping()) + { + TConstructClientRegistry.addEffectRenderMapping(tool, effect[i], "tinker", TinkersDefense.colors[i] + "_" + tag.toLowerCase(), true); + } + } + } + + @Override + public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + if(tags.hasKey("Mirrors")) + { + UpdateMirrors(tool, stack, world, entity); + } + if(tags.hasKey("gluttony")) + { + UpdateGluttony(tool, stack, world, entity, tags); + } + if(world.isRemote && tags.hasKey("Ensouled") && tags.hasKey("Soul")) + { + if(TinkersDefense.proxy.SoulHandler != null) + { + TinkersDefense.proxy.SoulHandler.Update(stack); + } + } + } + + public void UpdateMirrors(ToolCore tool, ItemStack stack, World world, Entity entity) + { + if(((IBattlePlayer) entity).isBlockingWithShield()) + { + final AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(((EntityLivingBase) entity).posX - 3, ((EntityLivingBase) entity).posY - 3, ((EntityLivingBase) entity).posZ - 3, ((EntityLivingBase) entity).posX + 3, ((EntityLivingBase) entity).posY + 3, ((EntityLivingBase) entity).posZ + 3); + + final ArrayList fireballs = (ArrayList) world.getEntitiesWithinAABB(EntityFireball.class, boundingBox); + for(final EntityFireball fireball : fireballs) + { + if(fireball.getDistanceSqToEntity((entity)) <= 25) + { + final Vec3 playerlook = ((EntityLivingBase) entity).getLookVec(); + + fireball.motionX = playerlook.xCoord; + fireball.motionY = playerlook.yCoord; + fireball.motionZ = playerlook.zCoord; + fireball.accelerationX = fireball.motionX * 0.1D; + fireball.accelerationY = fireball.motionY * 0.1D; + fireball.accelerationZ = fireball.motionZ * 0.1D; + + fireball.shootingEntity = ((EntityLivingBase) entity); + + ((EntityLivingBase) entity).worldObj.playSoundAtEntity((entity), "battlegear2:shield", 1, 1); + } + } + } + } + + public void UpdateGluttony(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) + { + final Shield shield = (Shield) tool; + + if(tags.getInteger("Damage") > 0 && shield.getArrowCount(stack) > 0) + { + tags.setInteger("Damage", tags.getInteger("Damage") - 2); + shield.setArrowCount(stack, shield.getArrowCount(stack) - 1); + + if(world.isRemote) + { + world.playSoundEffect(entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ, "minecraft:random.eat", 1, 1); + } + } + } + + //Events + @SubscribeEvent + public void XPBoost(LivingDeathEvent event) + { + if(!(event.entityLiving instanceof EntityPlayer) && event.source.getSourceOfDamage() instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.source.getSourceOfDamage(); + final ItemStack itemstack = player.getCurrentEquippedItem(); + if(itemstack != null) + { + final NBTTagCompound tags = itemstack.getTagCompound().getCompoundTag("InfiTool"); + + if(tags != null && tags.hasKey("XPBoost")) + { + player.worldObj.spawnEntityInWorld(new EntityXPOrb( + player.worldObj, event.entityLiving.posX, + event.entityLiving.posY, event.entityLiving.posZ, + (int) Math.pow(tags.getInteger("XPBoost"), 2))); + + } + } + } + } + + @SubscribeEvent + public void UpdateDaze(LivingAttackEvent event) + { + if(event.source.getEntity() instanceof EntityPlayer) + { + final EntityPlayer player = (EntityPlayer) event.source.getEntity(); + final ItemStack heldItem = player.getHeldItem(); + final EntityLivingBase attacked = event.entityLiving; + + if(heldItem != null && heldItem.getItem() != null && heldItem.getItem() instanceof ToolCore) + { + final NBTTagCompound tags = heldItem.getTagCompound().getCompoundTag("InfiTool"); + + if(tags.hasKey("Daze")) + { + final int daze = tags.getInteger("Daze"); + final int chance = daze * 5; + + final Random roll = new Random(); + final int num = roll.nextInt(100) + 1; + + if(num <= chance) + { + attacked.addPotionEffect(new PotionEffect(2, 3 * 20, + 100)); + attacked.addPotionEffect(new PotionEffect(9, 3 * 20, + 100)); + attacked.addPotionEffect(new PotionEffect(15, 3 * 20, + 100)); + attacked.addPotionEffect(new PotionEffect(18, 3 * 20, + 100)); + } + + } + } + } + } + + @SubscribeEvent + @Optional.Method(modid = "battlegear2") + public void TD_ShieldBlock(ShieldBlockEvent event) + { + if(event.shield.getItem() instanceof ToolCore) + { + final NBTTagCompound tags = event.shield.getTagCompound().getCompoundTag("InfiTool"); + + if(!tags.getBoolean("Broken")) + { + if(tags.hasKey("mirrors")) + { + UpdateMirrors((ToolCore) event.shield.getItem(), event.shield, event.entityPlayer.worldObj, event.entityPlayer); + } + + if(tags.hasKey("legends")) + { + event.getPlayer().addPotionEffect(new PotionEffect( + Potion.fireResistance.getId(), 200, 2)); + event.getPlayer().addPotionEffect(new PotionEffect( + Potion.moveSpeed.getId(), 200, 2)); + event.getPlayer().addPotionEffect(new PotionEffect( + Potion.resistance.getId(), 200, 2)); + } + + if(tags.hasKey("thorns")) + { + event.source.getEntity().attackEntityFrom(DamageSource.generic, tags.getInteger("thorns") * 2); + } + + if(tags.hasKey("sanguisuga")) + { + event.source.getEntity().attackEntityFrom(DamageSource.generic, tags.getInteger("sanguisuga")); + event.entityPlayer.heal(tags.getInteger("sanguisuga")); + } + + if(tags.hasKey("light")) + { + if(event.source.getEntity() instanceof EntityMob) + { + final EntityMob entity = (EntityMob) event.source.getEntity(); + if(entity.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) + { + event.source.getEntity().setFire(tags.getInteger("light")); + } + } + } + + // if(tags.hasKey("pitch")) + // { + // if(!event.entityPlayer.worldObj.isRemote && event.source.getEntity() instanceof EntityPlayer) + // { + // final EntityPlayer entity = (EntityPlayer) event.source.getEntity(); + // if(entity.getEquipmentInSlot(0) != null) + // { + // entity.entityDropItem(entity.getEquipmentInSlot(0), 5); + // entity.setCurrentItemOrArmor(0, null); + // //entity.setCanPickUpLoot(true); + // } + // } + // } + + if(tags.hasKey("wind")) + { + if(!event.entityPlayer.worldObj.isRemote && event.source.getEntity() instanceof EntityLiving) + { + final EntityLiving entity = (EntityLiving) event.source.getEntity(); + + final double x = event.entityLiving.posX - entity.posX; + final double z = event.entityLiving.posZ - entity.posZ; + //entity.knockBack(entity, tags.getInteger("winds") * 10, x, z); + + entity.isAirBorne = true; + final float f1 = MathHelper.sqrt_double(x * x + z * z); + final float f2 = 0.4F; + entity.motionX /= 2.0D; + entity.motionY /= 2.0D; + entity.motionZ /= 2.0D; + entity.motionX -= x / f1 * f2 * tags.getInteger("wind"); + entity.motionY += f2; + entity.motionZ -= z / f1 * f2 * tags.getInteger("wind"); + + } + } + } + } + } +} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/modifierSoulBound.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/modifierSoulBound.java deleted file mode 100644 index 43604b1..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/modifierSoulBound.java +++ /dev/null @@ -1,29 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.modifiers.tools.ModBoolean; - -public class modifierSoulBound extends ModBoolean -{ - String c; - String tip; - - public modifierSoulBound(ItemStack[] items, int effect, String tag, String color, String tipname) - { - super(items, effect, tag, color, tipname); - c = color; - tip = tipname; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - tags.setBoolean(key, true); - - addToolTip(tool, c + tip, c + key); - } - -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofBlades.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofBlades.java deleted file mode 100644 index 466de59..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofBlades.java +++ /dev/null @@ -1,90 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.shields; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.modifiers.tools.ItemModTypeFilter; - -public class modifierCrestofBlades extends ItemModTypeFilter -{ - String tooltipName; - int max = 5; - String guiType; - - public modifierCrestofBlades(String type, int effect, ItemStack[] items, int[] values) - { - super(effect, "Blades", items, values); - tooltipName = "\u00A7fBlades"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if(!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max; - - if(matchingAmount(input) > max) - return false; - - int keyPair[] = tags.getIntArray(key); - if(keyPair[0] + matchingAmount(input) <= keyPair[1]) - return true; - - // else if (keyPair[0] == keyPair[1]) - // return tags.getInteger("Modifiers") > 0; - - else - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int increase = matchingAmount(input); - int[] keyPair; - int current = 0; - if(tags.hasKey(key)) - { - keyPair = tags.getIntArray(key); - - if(keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00A76" + guiType + " (" + increase + "/" + max + ")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - keyPair = new int[] {increase, max, tooltipIndex}; - tags.setIntArray(key, keyPair); - } - - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A76" + guiType + " (" + keys[0] + "/" + keys[1] + ")"; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofFeathers.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofFeathers.java deleted file mode 100644 index 65b81a6..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofFeathers.java +++ /dev/null @@ -1,129 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.shields; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ItemModTypeFilter; - -public class modifierCrestofFeathers extends ItemModTypeFilter -{ - String tooltipName; - int max = 10; - String guiType; - - public modifierCrestofFeathers(String type, int effect, ItemStack[] items, int[] values) - { - super(effect, "Feathers", items, values); - tooltipName = "\u00A7fCrest of Feathers"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - - if(list.contains("shield")) - { - if(!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max; - - if(matchingAmount(input) > max) - return false; - - int keyPair[] = tags.getIntArray(key); - if(keyPair[0] + matchingAmount(input) <= keyPair[1]) - return true; - - else if(keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; - - else - return false; - } - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - int increase = matchingAmount(input); - int[] keyPair; - int current = 0; - if(tags.hasKey(key)) - { - keyPair = tags.getIntArray(key); - - if(keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00A76" + guiType + " (" + increase + "/" + max + ")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - keyPair = new int[] {increase, max, tooltipIndex}; - tags.setIntArray(key, keyPair); - } - - int miningSpeed = tags.getInteger("MiningSpeed"); - int boost = 8 + ((current - 1) / 50 * 2); - Item temp = tool.getItem(); - if(temp instanceof ToolCore) - { - ToolCore toolcore = (ToolCore) temp; - if(toolcore.durabilityTypeHandle() == 2) - boost += 2; - if(toolcore.durabilityTypeAccessory() == 2) - boost += 2; - if(toolcore.durabilityTypeExtra() == 2) - boost += 2; - } - miningSpeed += (increase * boost); - tags.setInteger("MiningSpeed", miningSpeed); - - String[] type = {"MiningSpeed2", "MiningSpeedHandle", "MiningSpeedExtra"}; - - for(int i = 0; i < 3; i++) - { - if(tags.hasKey(type[i])) - { - int speed = tags.getInteger(type[i]); - speed += (increase * boost); - tags.setInteger(type[i], speed); - } - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A76" + guiType + " (" + keys[0] + "/" + keys[1] + ")"; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofLegends.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofLegends.java deleted file mode 100644 index f328258..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofLegends.java +++ /dev/null @@ -1,60 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.shields; - -import lance5057.tDefense.core.tools.Shield; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.modifiers.tools.ItemModTypeFilter; - -public class modifierCrestofLegends extends ItemModTypeFilter -{ - String tooltipName; - String guiType; - - public modifierCrestofLegends(String type, int effect, ItemStack[] items, int[] values) - { - super(effect, "Legends", items, values); - tooltipName = "\u00A7fCrest of Legends"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - if(tool.getItem() instanceof Shield) - return tags.getInteger("Modifiers") > 0; - - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int increase = matchingAmount(input); - if(tags.hasKey(key)) - { - int[] keyPair = tags.getIntArray(key); - - updateModTag(tool, keyPair); - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00A76" + guiType; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A76" + guiType + " (" + keys[0] + "/" + keys[1] + ")"; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofMirrors.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofMirrors.java deleted file mode 100644 index 27e547e..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/shields/modifierCrestofMirrors.java +++ /dev/null @@ -1,64 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.shields; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ModBoolean; - -public class modifierCrestofMirrors extends ModBoolean -{ - String tooltipName; - String guiType; - - public modifierCrestofMirrors(String type, int effect, ItemStack[] items, int[] values) - { - super(items, effect, "Mirrors", "\u00A7", ""); - tooltipName = "\u00A7bCrest of Mirrors"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - if(tool.getItem() instanceof ToolCore) - { - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - if(list.contains("shield")) - { - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - if(tags.hasKey(key)) - return false; - - return true; - } - } - return false; - - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - tags.setBoolean(key, true); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - - addToolTip(tool, "\u00A7b" + tooltipName, "\u00A7b" + key); - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A7b" + guiType; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierDaze.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierDaze.java deleted file mode 100644 index 6c4af7a..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierDaze.java +++ /dev/null @@ -1,97 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.weapons; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ItemModTypeFilter; - -public class modifierDaze extends ItemModTypeFilter -{ - String tooltipName; - int max = 5; - String guiType; - - public modifierDaze(String type, int effect, ItemStack[] items, int[] values) - { - super(effect, "Daze", items, values); - tooltipName = "\u00A76Daze"; - guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - if(tool.getItem() instanceof ToolCore) - { - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - if(list.contains("weapon")) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if(!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0 && matchingAmount(input) <= max; - - if(matchingAmount(input) > max) - return false; - - int keyPair[] = tags.getIntArray(key); - if(keyPair[0] + matchingAmount(input) <= keyPair[1]) - return true; - - else if(keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; - } - } - - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int increase = matchingAmount(input); - if(tags.hasKey(key)) - { - int[] keyPair = tags.getIntArray(key); - - if(keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00A76" + guiType + " (" + increase + "/" + max + ")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - int[] keyPair = new int[] {increase, max, tooltipIndex}; - tags.setIntArray(key, keyPair); - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = "\u00A76" + guiType + " (" + keys[0] + "/" + keys[1] + ")"; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierTorchArrow.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierTorchArrow.java deleted file mode 100644 index b25778b..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/TDefense/weapons/modifierTorchArrow.java +++ /dev/null @@ -1,72 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers.TDefense.weapons; - -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import tconstruct.library.tools.ToolCore; -import tconstruct.modifiers.tools.ItemModTypeFilter; -import tconstruct.modifiers.tools.ModBoolean; - -public class modifierTorchArrow extends ModBoolean -{ - String tooltipName; - String guiType; - String color; - - public modifierTorchArrow(ItemStack[] items, int effect) - { - super(items, effect, "Torch", "\u00A76", "Torch"); - tooltipName = "\u00A76Daze"; - color = "\u00A76"; - //guiType = type; - } - - @Override - protected boolean canModify(ItemStack tool, ItemStack[] input) - { - if(tool.getItem() instanceof ToolCore) - { - List list = Arrays.asList(((ToolCore) tool.getItem()).getTraits()); - if(list.contains("ammo")) - { - ToolCore toolItem = (ToolCore) tool.getItem(); - if(!validType(toolItem)) - return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key); - } - } - return false; - } - - @Override - public void modify(ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - tags.setBoolean(key, true); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - - int attack = tags.getInteger("Attack"); - attack -= 3; - if(attack < 0) - attack = 0; - tags.setInteger("Attack", attack); - - addToolTip(tool, color + tooltipName, color + key); - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip" + keys[2]; - String modName = color + guiType + " (" + keys[0] + "/" + keys[1] + ")"; - tags.setString(tip, modName); - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/Thaumcraft/ThaumcraftMods.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/Thaumcraft/ThaumcraftMods.java index 9361223..a18e691 100644 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/Thaumcraft/ThaumcraftMods.java +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/Thaumcraft/ThaumcraftMods.java @@ -5,6 +5,7 @@ import java.lang.reflect.Method; import cpw.mods.fml.common.FMLLog; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.tools.modifiers.ModifiersBase; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -20,23 +21,26 @@ import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.internal.DummyInternalMethodHandler; -public class ThaumcraftMods +public class ThaumcraftMods extends ModifiersBase { public ThaumcraftMods() { - LoadItems(); + super(null, null); } + @Override public void LoadItems() { } + @Override public void RegisterRecipes() { } + @Override public void RegisterModifiers() { ModifyBuilder.registerModifier(new modifierRepairVis(new ItemStack[] {ItemApi.getItem("itemWandCap", 0)}, TinkersDefense.config.CapsModID, "Caps", EnumChatFormatting.GOLD.toString(), "Caps")); @@ -47,6 +51,7 @@ public class ThaumcraftMods } } + @Override public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) { if(!world.isRemote) diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/ToolMods.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/ToolMods.java deleted file mode 100644 index a610fee..0000000 --- a/src/main/java/lance5057/tDefense/core/tools/modifiers/ToolMods.java +++ /dev/null @@ -1,171 +0,0 @@ -package lance5057.tDefense.core.tools.modifiers; - -import java.util.ArrayList; - -import lance5057.tDefense.Reference; -import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.modifiers.modifierBoolExclusive; -import lance5057.tDefense.armor.modifiers.modifierIntExclusive; -import lance5057.tDefense.core.tools.modifiers.ActiveToolMods.TDefenseActiveToolMod; -import lance5057.tDefense.core.tools.modifiers.TDefense.modifierSoulBound; -import lance5057.tDefense.core.tools.modifiers.TDefense.shields.modifierCrestofBlades; -import lance5057.tDefense.core.tools.modifiers.TDefense.shields.modifierCrestofFeathers; -import lance5057.tDefense.core.tools.modifiers.TDefense.shields.modifierCrestofLegends; -import lance5057.tDefense.core.tools.modifiers.TDefense.shields.modifierCrestofMirrors; -import lance5057.tDefense.core.tools.modifiers.TDefense.weapons.modifierDaze; -import mods.battlegear2.api.core.IBattlePlayer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import tconstruct.library.TConstructRegistry; -import tconstruct.library.client.TConstructClientRegistry; -import tconstruct.library.crafting.ModifyBuilder; -import tconstruct.library.tools.ToolCore; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ToolMods -{ - public static Item item_relic; - public static Item itemSoulChain; - - public static Item item_RainbowGem; - public static Item item_Textbook; - - public ToolMods() - { - MinecraftForge.EVENT_BUS.register(this); - - LoadItems(); - } - - public void LoadItems() - { - item_relic = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("AncientRelic").setTextureName(Reference.MOD_ID + ":AncientRelic"); - - itemSoulChain = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("SoulChain").setTextureName(Reference.MOD_ID + ":SoulChain"); - - item_Textbook = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("Textbook").setTextureName(Reference.MOD_ID + ":Textbook"); - - //Shears - item_RainbowGem = new Item().setCreativeTab(TinkersDefense.tabName).setMaxStackSize(1).setUnlocalizedName("RainbowGem").setTextureName(Reference.MOD_ID + ":RainbowGem"); - - GameRegistry.registerItem(item_relic, "AncientRelic"); - GameRegistry.registerItem(itemSoulChain, "SoulChain"); - GameRegistry.registerItem(item_RainbowGem, "RainbowGem"); - GameRegistry.registerItem(item_Textbook, "Textbook"); - } - - public void RegisterRecipes() - { - } - - public void RegisterModifiers() - { - //All - ModifyBuilder.registerModifier(new modifierSoulBound(new ItemStack[] {new ItemStack(itemSoulChain)}, TinkersDefense.config.SoulBoundID, "Soulbound", "\u00A7b", "Soulbound")); - - //Weapons - //TO-DO - ModifyBuilder.registerModifier(new modifierDaze("Daze", TinkersDefense.config.DazeID, new ItemStack[] {new ItemStack(Blocks.light_weighted_pressure_plate), new ItemStack(Items.potionitem, 1, 8202)}, new int[] {1, 0})); - ModifyBuilder.registerModifier(new modifierIntExclusive(new ItemStack[] {new ItemStack(item_Textbook, 1, 0)}, TinkersDefense.config.XPBoostID, "XPBoost", 1, EnumChatFormatting.GREEN.toString(), "XP Boost", new String[] {"weapon"}, 1, null)); - - //Shears - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_RainbowGem, 1, 0)}, TinkersDefense.config.RainbowID, "Rainbow", EnumChatFormatting.WHITE.toString(), "Rainbow", new String[] {"shears"}, 1, null)); - - //Shields - ModifyBuilder.registerModifier(new modifierCrestofFeathers("Crest of Feathers", TinkersDefense.config.CrestFeathersID, new ItemStack[] {new ItemStack(Items.feather)}, new int[] {1})); - ModifyBuilder.registerModifier(new modifierCrestofMirrors("Crest of Mirrors", TinkersDefense.config.CrestMirrorsID, new ItemStack[] {new ItemStack(Blocks.glass_pane)}, new int[] {1})); - ModifyBuilder.registerModifier(new modifierCrestofLegends("Crest of Legends", TinkersDefense.config.CrestLegendsID, new ItemStack[] {new ItemStack(item_relic)}, new int[] {1})); - ModifyBuilder.registerModifier(new modifierCrestofBlades("Crest of Blades", TinkersDefense.config.CrestBladesID, new ItemStack[] {new ItemStack(Items.iron_sword)}, new int[] {1})); - - ModifyBuilder.registerModifier(new modifierBoolExclusive(new ItemStack[] {new ItemStack(item_RainbowGem, 1, 0)}, TinkersDefense.config.RainbowID, "Rainbow", EnumChatFormatting.WHITE.toString(), "Rainbow", new String[] {"shears"}, 1, null)); - - TConstructRegistry.registerActiveToolMod(new TDefenseActiveToolMod()); - - for(ToolCore tool : TConstructRegistry.getToolMapping()) - { - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.DazeID, "tinker", "daze", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestFeathersID, "tinker", "feathers", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestMirrorsID, "tinker", "mirrors", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestLegendsID, "tinker", "legends", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.CrestBladesID, "tinker", "blades", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.SoulBoundID, "tinker", "soulbound", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.RainbowID, "tinker", "rainbow", true); - TConstructClientRegistry.addEffectRenderMapping(tool, TinkersDefense.config.XPBoostID, "tinker", "textbook", true); - - } - } - - public void UpdateAll(ToolCore tool, ItemStack stack, World world, Entity entity, NBTTagCompound tags) - { - if(tags.hasKey("Crest of Mirrors")) - UpdateMirrors(tool, stack, world, entity); - } - - public void UpdateMirrors(ToolCore tool, ItemStack stack, World world, Entity entity) - { - if(((IBattlePlayer) entity).isBlockingWithShield()) - { - AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(((EntityLivingBase) entity).posX - 3, ((EntityLivingBase) entity).posY - 3, ((EntityLivingBase) entity).posZ - 3, ((EntityLivingBase) entity).posX + 3, ((EntityLivingBase) entity).posY + 3, ((EntityLivingBase) entity).posZ + 3); - - ArrayList fireballs = (ArrayList) world.getEntitiesWithinAABB(EntityFireball.class, boundingBox); - for(EntityFireball fireball : fireballs) - { - if(fireball.getDistanceSqToEntity(((EntityLivingBase) entity)) <= 25) - { - Vec3 playerlook = ((EntityLivingBase) entity).getLookVec(); - - fireball.motionX = playerlook.xCoord; - fireball.motionY = playerlook.yCoord; - fireball.motionZ = playerlook.zCoord; - fireball.accelerationX = fireball.motionX * 0.1D; - fireball.accelerationY = fireball.motionY * 0.1D; - fireball.accelerationZ = fireball.motionZ * 0.1D; - - fireball.shootingEntity = ((EntityLivingBase) entity); - - ((EntityLivingBase) entity).worldObj.playSoundAtEntity(((EntityLivingBase) entity), "battlegear2:shield", 1, 1); - } - } - } - } - - public void UpdateTorchArrow(ToolCore tool, ItemStack stack, World world, Entity entity) - { - //entity.worldObj.ent - } - - @SubscribeEvent - public void XPBoost(LivingDeathEvent event) - { - if(!(event.entityLiving instanceof EntityPlayer) && event.source.getSourceOfDamage() instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) event.source.getSourceOfDamage(); - ItemStack itemstack = player.getCurrentEquippedItem(); - if(itemstack != null) - { - NBTTagCompound tags = itemstack.getTagCompound().getCompoundTag("InfiTool"); - - if(tags != null && tags.hasKey("XPBoost")) - { - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, (int)Math.pow(tags.getInteger("XPBoost"),2))); - - } - } - } - } -} diff --git a/src/main/java/lance5057/tDefense/core/tools/modifiers/modLapisShears.java b/src/main/java/lance5057/tDefense/core/tools/modifiers/modLapisShears.java new file mode 100644 index 0000000..a12690d --- /dev/null +++ b/src/main/java/lance5057/tDefense/core/tools/modifiers/modLapisShears.java @@ -0,0 +1,86 @@ +package lance5057.tDefense.core.tools.modifiers; + +import java.util.Arrays; +import java.util.List; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import tconstruct.library.tools.ToolCore; +import tconstruct.modifiers.tools.ModLapis; + +public class modLapisShears extends ModLapis +{ + + public modLapisShears(int effect, ItemStack[] items, int[] values) + { + super(effect, items, values); + } + + @Override + public void modify(ItemStack[] input, ItemStack tool) + { + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if(!tags.hasKey(key)) + { + tags.setBoolean(key, true); + + final String modName = "\u00a79Lapis (0/450)"; + final int tooltipIndex = addToolTip(tool, "\u00a79Luck", modName); + final int[] keyPair = new int[] {0, tooltipIndex}; + tags.setIntArray(key, keyPair); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + } + + final int increase = matchingAmount(input); + final int keyPair[] = tags.getIntArray(key); + keyPair[0] += increase; + tags.setIntArray(key, keyPair); + final ToolCore toolcore = (ToolCore) tool.getItem(); + final String[] types = toolcore.getTraits(); + final boolean weapon = false; + boolean harvest = false; + for(final String s : types) + { + if(s.equals("shears")) + { + harvest = true; + } + } + if(harvest) + { + if(keyPair[0] >= 450) + { + addEnchantment(tool, Enchantment.fortune, 3); + } + else if(keyPair[0] >= 300) + { + addEnchantment(tool, Enchantment.fortune, 2); + } + else if(keyPair[0] >= 100) + { + addEnchantment(tool, Enchantment.fortune, 1); + } + } + + updateModTag2(tool, keyPair); + } + + void updateModTag2(ItemStack tool, int[] keys) + { + final NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + final String tip = "ModifierTip" + keys[1]; + final String modName = "\u00a79Lapis (" + keys[0] + "/" + "450" + ")"; + tags.setString(tip, modName); + } + + @Override + public boolean validType(ToolCore tool) + { + final List list = Arrays.asList(tool.getTraits()); + return list.contains("shears"); + } +} diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Container_FinishingAnvil.java b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Container_FinishingAnvil.java index 3b775f2..f137076 100644 --- a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Container_FinishingAnvil.java +++ b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/Container_FinishingAnvil.java @@ -10,7 +10,7 @@ public class Container_FinishingAnvil extends Container { public Container_FinishingAnvil(InventoryPlayer inventoryPlayer, TileEntity_FinishingAnvil te) { - addSlotToContainer(new Slot(te, 0, 48, 32)); + addSlotToContainer(new Slot(te, 0, 39, 32)); for(int x = 0; x < 9; x++) { 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 b9fc7d2..0395b61 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 @@ -4,22 +4,33 @@ import java.util.ArrayList; import java.util.List; import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.armor.ArmorCore; +import lance5057.tDefense.armor.renderers.ArmorRenderer; import lance5057.tDefense.core.network.Message_FinishingAnvil; import lance5057.tDefense.finishingAnvil.utilities.Injector; import lance5057.tDefense.finishingAnvil.utilities.ToolCoreTip; +import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; +import org.lwjgl.util.glu.Project; -import cpw.mods.fml.client.config.GuiButtonExt; import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.ToolCore; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.config.GuiButtonExt; public class Gui_FinishingAnvil extends GuiContainer { @@ -27,15 +38,16 @@ public class Gui_FinishingAnvil extends GuiContainer private float ySize_lo; private ItemStack bigCopy; - private Boolean isNull = true; + //private Boolean isNull = true; private ItemStack editItem; - private RenderItem bigRender = new RenderItem_FinishingAnvil(this); + private final RenderItem bigRender = new RenderItem_FinishingAnvil( + this); public final TileEntity_FinishingAnvil inventory; private ResourceLocation forGui; private int leftButtonPosX = 0; - private int leftButtonPosY = 0; + private final int leftButtonPosY = 0; private int xLIcon_one, yLIcon_one; private int xLIcon_two, yLIcon_two; private int xLIcon_three, yLIcon_three; @@ -51,58 +63,94 @@ public class Gui_FinishingAnvil extends GuiContainer NBTTagCompound tags; - private static final ResourceLocation iconLocation = new ResourceLocation("tinkersdefense", "textures/gui/finishinganvil.png"); + boolean renderFlat = true; + boolean renderBiped = true; + int rotation = 0; + + InventoryPlayer player; + + private static final ResourceLocation iconLocation = new ResourceLocation( + "tinkersdefense", + "textures/gui/finishinganvil.png"); public Gui_FinishingAnvil(InventoryPlayer invPlayer, TileEntity_FinishingAnvil te) { super(new Container_FinishingAnvil(invPlayer, te)); - this.inventory = te; + inventory = te; renders = new String[4]; renders[0] = "Head"; renders[1] = "Accessory"; renders[2] = "Handle"; renders[3] = "Extra"; + + player = invPlayer; } @Override public void initGui() { super.initGui(); - 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 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 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 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, "")); - + buttonList.add(new GuiButtonExt(1, guiLeft + 25, guiTop + 11, 10, 10, + "⇑")); + buttonList.add(new GuiButtonExt(2, guiLeft + 25, guiTop + 61, 10, 10, + "⇓")); + buttonList.add(new GuiButtonExt(3, guiLeft + 38, guiTop + 53, 18, 18, + "✓")); + + buttonList.add(new GuiButtonExt(4, guiLeft + 5, guiTop + 11, 20, 20, "")); + buttonList.add(new GuiButtonExt(5, guiLeft + 5, guiTop + 31, 20, 20, "")); + buttonList.add(new GuiButtonExt(6, guiLeft + 5, guiTop + 51, 20, 20, "")); + + buttonList.add(new GuiButtonExt(7, guiLeft + 141, guiTop + 11, 10, 10, + "⇑")); + buttonList.add(new GuiButtonExt(8, guiLeft + 141, guiTop + 61, 10, 10, + "⇓")); + + buttonList.add(new GuiButtonExt(9, guiLeft + 151, guiTop + 11, 20, 20, + "")); + buttonList.add(new GuiButtonExt(10, guiLeft + 151, guiTop + 31, 20, 20, + "")); + buttonList.add(new GuiButtonExt(11, guiLeft + 151, guiTop + 51, 20, 20, + "")); + + buttonList.add(new GuiButtonExt(12, guiLeft + 38, guiTop + 11, 18, 18, + "∅")); + buttonList.add(new GuiButtonExt(13, guiLeft + 120, guiTop + 11, 18, 18, + "3D")); + buttonList.add(new GuiButtonExt(14, guiLeft + 120, guiTop + 53, 18, 18, + "")); + + buttonList.add(new GuiButtonExt(15, guiLeft + 59, guiTop + 60, 10, 10, + "<")); + buttonList.add(new GuiButtonExt(16, guiLeft + 107, guiTop + 60, 10, 10, + ">")); } @Override protected void actionPerformed(GuiButton button) { if(tags != null) + { switch(button.id) { case 1: - if(this.leftButtonPosX > 0) - this.leftButtonPosX--; + if(leftButtonPosX > 0) + { + leftButtonPosX--; + } break; case 2: - if(this.leftButtonPosX + 3 < ((ToolCore) bigCopy.getItem()).getPartAmount()) - this.leftButtonPosX++; + if(leftButtonPosX + 3 < ((ToolCore) bigCopy.getItem()).getPartAmount()) + { + leftButtonPosX++; + } break; case 3: - TinkersDefense.INSTANCE.sendToServer(new Message_FinishingAnvil(inventory.xCoord, inventory.yCoord, inventory.zCoord, this.bigCopy)); + TinkersDefense.INSTANCE.sendToServer(new Message_FinishingAnvil( + inventory.xCoord, inventory.yCoord, + inventory.zCoord, bigCopy)); break; case 4: @@ -119,94 +167,205 @@ public class Gui_FinishingAnvil extends GuiContainer break; case 7: - if(this.rightButtonPosX > 0) + if(rightButtonPosX > 0) { - this.rightButtonPosX--; + rightButtonPosX--; } - else if(this.rightButtonPosY > (0 + this.leftSelect * 4)) + else if(rightButtonPosY > (0 + leftSelect * 4)) { - this.rightButtonPosY--; - this.rightButtonPosX = 15; + rightButtonPosY--; + rightButtonPosX = 15; } break; - case 8: - this.rightButtonPosX++; - if(this.rightButtonPosX >= 16) + + case 13: + renderFlat = !renderFlat; + break; + + case 14: + renderBiped = !renderBiped; + break; + + case 15: + if(rotation <= 0) { - this.rightButtonPosY++; - this.rightButtonPosX = 0; + rotation += 360; } + rotation -= 8; break; - case 9: - if(tags.hasKey("Render" + renders[leftSelect])) + case 16: + if(rotation >= 360) { - tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + ((rightButtonPosY % 3) * 16)) * TinkersDefense.config.MaterialIndex)); - if(rightButtonPosX > 0) - tags.setInteger(renders[leftSelect] + "Color", TConstructRegistry.getMaterial(tags.getInteger(renders[leftSelect])).primaryColor()); - else - tags.removeTag(renders[leftSelect] + "Color"); + rotation -= 360; } + rotation += 8; break; - case 10: - if(tags.hasKey("Render" + renders[leftSelect])) + default: + if(bigCopy.getItem() instanceof ArmorCore) { - 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()); + doArmorEdit(button.id); } - break; + else + { + doToolEdit(button.id); + } + } + } + } - case 11: - if(tags.hasKey("Render" + renders[leftSelect])) + public void doToolEdit(int id) + { + switch(id) + { + case 9: + if(tags.hasKey("Render" + renders[leftSelect])) + { + tags.setInteger("Render" + renders[leftSelect], bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[leftSelect]) + ((rightButtonPosX + ((rightButtonPosY % 3) * 16)) * TinkersDefense.config.MaterialIndex)); + if(rightButtonPosX > 0) { - 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; - } + else + { + tags.removeTag(renders[leftSelect] + "Color"); + } + } + break; + + case 10: + if(tags.hasKey("Render" + renders[leftSelect])) + { + 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; + + case 11: + if(tags.hasKey("Render" + renders[leftSelect])) + { + 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; + + case 12: + tags.setInteger("RenderHead", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[0])); + tags.setInteger("RenderAccessory", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[1])); + tags.setInteger("RenderHandle", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[2])); + tags.setInteger("RenderExtra", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[3])); + + tags.removeTag(renders[0] + "Color"); + tags.removeTag(renders[1] + "Color"); + tags.removeTag(renders[2] + "Color"); + tags.removeTag(renders[3] + "Color"); + break; + + case 8: + rightButtonPosX++; + if(rightButtonPosX >= 16) + { + rightButtonPosY++; + rightButtonPosX = 0; + } + break; + + } } + public void doArmorEdit(int id) + { + final NBTTagCompound aTags = bigCopy.getTagCompound().getCompoundTag("ArmorRenderer"); + final ArmorCore armor = (ArmorCore) bigCopy.getItem(); + final List boxes = armor.getRenderer().boxList; + + switch(id) + { + case 9: + aTags.setBoolean(boxes.get(rightButtonPosX + 9).boxName, !aTags.getBoolean(boxes.get(rightButtonPosX + (rightButtonPosY % 3) + 9).boxName)); + break; + + case 10: + aTags.setBoolean(boxes.get(rightButtonPosX + 1 + 9).boxName, !aTags.getBoolean(boxes.get(rightButtonPosX + 1 + (rightButtonPosY % 3) + 9).boxName)); + break; + + case 11: + aTags.setBoolean(boxes.get(rightButtonPosX + 2 + 9).boxName, !aTags.getBoolean(boxes.get(rightButtonPosX + 2 + (rightButtonPosY % 3) + 9).boxName)); + break; + + case 12: + tags.setInteger("RenderHead", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[0])); + tags.setInteger("RenderAccessory", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[1])); + tags.setInteger("RenderHandle", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[2])); + tags.setInteger("RenderExtra", bigCopy.getTagCompound().getCompoundTag("InfiTool").getInteger(renders[3])); + + tags.removeTag(renders[0] + "Color"); + tags.removeTag(renders[1] + "Color"); + tags.removeTag(renders[2] + "Color"); + tags.removeTag(renders[3] + "Color"); + break; + + case 8: + if(rightButtonPosX < boxes.size() - 12) + { + rightButtonPosX++; + } + break; + + } + } + + @Override public void drawScreen(int x, int y, float par3) { - if(inventory.getStackInSlot(0) != null && isNull == true - /*inventory.getStackInSlot(0).getItem() != this.bigCopy*/) + if(inventory.getStackInSlot(0) != null) { - this.bigCopy = inventory.getStackInSlot(0).copy(); - if(bigCopy.hasTagCompound() && bigCopy.getTagCompound().hasKey("InfiTool")) - tags = bigCopy.getTagCompound().getCompoundTag("InfiTool"); - isNull = false; + if(bigCopy == null) + { + bigCopy = inventory.getStackInSlot(0).copy(); + if(bigCopy.hasTagCompound() && bigCopy.getTagCompound().hasKey("InfiTool")) + { + tags = bigCopy.getTagCompound().getCompoundTag("InfiTool"); + } + } + else if(inventory.getStackInSlot(0).getItem() != bigCopy.getItem() || inventory.getStackInSlot(0).getItemDamage() != bigCopy.getItemDamage()) + { + bigCopy = null; + } } else if(inventory.getStackInSlot(0) == null) { - this.bigCopy = null; - isNull = true; + bigCopy = null; } super.drawScreen(x, y, par3); drawTooltip(x, y); - this.xSize_lo = (float) x; - this.ySize_lo = (float) y; + xSize_lo = x; + ySize_lo = y; } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.forGui = new ResourceLocation("tinkersdefense", "textures/gui/finishinganvil.png"); - - this.xLIcon_one = 0; - this.yLIcon_one = 176; - this.xLIcon_two = 0; - this.yLIcon_two = 176; - this.xLIcon_three = 0; - this.yLIcon_three = 176; - - this.xRIcon_one = 0; - this.yRIcon_one = 176; - this.xRIcon_two = 0; - this.yRIcon_two = 176; - this.xRIcon_three = 0; - this.yRIcon_three = 176; + mc.getTextureManager().bindTexture(iconLocation); + + drawTexturedModalRect(121, 54, 16, 176, 16, 16); + + xLIcon_one = 0; + yLIcon_one = 176; + xLIcon_two = 0; + yLIcon_two = 176; + xLIcon_three = 0; + yLIcon_three = 176; + + xRIcon_one = 0; + yRIcon_one = 176; + xRIcon_two = 0; + yRIcon_two = 176; + xRIcon_three = 0; + yRIcon_three = 176; if(inventory.getStackInSlot(0) != null) { @@ -217,110 +376,259 @@ public class Gui_FinishingAnvil extends GuiContainer // ((ToolCore)this.inventorySlots.inventorySlots.get(0)).getHeadItem(), 16, 16); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.forGui = new ResourceLocation("tinkersdefense", "textures/gui/" + ((ToolCore) editItem.getItem()).getDefaultFolder() + ".png"); - this.xLIcon_one = 32; - this.yLIcon_one = 0; - this.xLIcon_two = 48; - this.yLIcon_two = 0; - this.xLIcon_three = 64; - this.yLIcon_three = 0; - - this.xRIcon_one = 0; - this.yRIcon_one = 32; - this.xRIcon_two = 16; - this.yRIcon_two = 32; - this.xRIcon_three = 32; - this.yRIcon_three = 32; + forGui = new ResourceLocation( + "tinkersdefense", + "textures/gui/" + ((ToolCore) editItem.getItem()).getDefaultFolder() + ".png"); + xLIcon_one = 32; + yLIcon_one = 0; + xLIcon_two = 48; + yLIcon_two = 0; + xLIcon_three = 64; + yLIcon_three = 0; + + xRIcon_one = 0; + yRIcon_one = 32; + xRIcon_two = 16; + yRIcon_two = 32; + xRIcon_three = 32; + yRIcon_three = 32; } } - this.mc.getTextureManager().bindTexture(this.forGui); - if(inventory.getStackInSlot(0) != null) + if(forGui != null && bigCopy != null) { -// int leftMax = leftSelect; -// if(leftMax > 2) -// leftMax = 2; - this.drawTexturedModalRect(7, 12 + ((leftSelect - leftButtonPosX) * 20), 16, 0, 16, 16); - } + if(!(bigCopy.getItem() instanceof ArmorCore)) + { + mc.getTextureManager().bindTexture(forGui); - this.drawTexturedModalRect(7, 12, this.xLIcon_one + (this.leftButtonPosX * 16), this.yLIcon_one + 0, 16, 16); - this.drawTexturedModalRect(7, 32, this.xLIcon_two + (this.leftButtonPosX * 16), this.yLIcon_two + 0, 16, 16); - this.drawTexturedModalRect(7, 52, this.xLIcon_three + (this.leftButtonPosX * 16), this.yLIcon_three + 0, 16, 16); + if(inventory.getStackInSlot(0) != null) + { + // int leftMax = leftSelect; + // if(leftMax > 2) + // leftMax = 2; + drawTexturedModalRect(7, 13 + ((leftSelect - leftButtonPosX) * 20), 16, 0, 16, 16); + } - this.drawTexturedModalRect(132, 12, this.xRIcon_one + (this.rightButtonPosX * 16), this.yRIcon_one + (this.rightButtonPosY * 16), 16, 16); + drawTexturedModalRect(7, 13, xLIcon_one + (leftButtonPosX * 16), yLIcon_one + 0, 16, 16); + drawTexturedModalRect(7, 33, xLIcon_two + (leftButtonPosX * 16), yLIcon_two + 0, 16, 16); + drawTexturedModalRect(7, 53, xLIcon_three + (leftButtonPosX * 16), yLIcon_three + 0, 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); + drawTexturedModalRect(153, 13, xRIcon_one + (rightButtonPosX * 16), yRIcon_one + (rightButtonPosY * 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); + if(rightButtonPosX + 1 < 16) + { + drawTexturedModalRect(153, 33, xRIcon_two + (rightButtonPosX * 16), yRIcon_two + (rightButtonPosY * 16), 16, 16); + } + else + { + drawTexturedModalRect(153, 33, xRIcon_two + ((rightButtonPosX - 16) * 16), yRIcon_two + ((rightButtonPosY + 1) * 16), 16, 16); + } - bigRender.renderItemAndEffectIntoGUI(fontRendererObj, this.mc.getTextureManager(), bigCopy, 23, 5); + if(rightButtonPosX + 2 < 16) + { + drawTexturedModalRect(153, 53, xRIcon_three + (rightButtonPosX * 16), yRIcon_three + (rightButtonPosY * 16), 16, 16); + } + else + { + drawTexturedModalRect(153, 53, xRIcon_three + ((rightButtonPosX - 16) * 16), yRIcon_three + ((rightButtonPosY + 1) * 16), 16, 16); + } + } + else + { + final NBTTagCompound aTags = bigCopy.getTagCompound().getCompoundTag("ArmorRenderer"); + final ArmorCore armor = (ArmorCore) bigCopy.getItem(); + final List boxes = armor.getRenderer().boxList; - } + drawTexturedModalRect(7, 13, 0, 176, 16, 16); + drawTexturedModalRect(7, 33, 0, 176, 16, 16); + drawTexturedModalRect(7, 53, 0, 176, 16, 16); - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) - { + //drawTexturedModalRect(153, 13, xRIcon_one + (rightButtonPosX * 16), yRIcon_one + (rightButtonPosY * 16), 16, 16); + + drawTexturedModalRect(153, 13, 64 + ((aTags.getBoolean(boxes.get(rightButtonPosX + 9).boxName) ? 0 : 1) * 16), 176, 16, 16); + drawTexturedModalRect(153, 33, 64 + ((aTags.getBoolean(boxes.get(rightButtonPosX + 1 + 9).boxName) ? 0 : 1) * 16), 176, 16, 16); + drawTexturedModalRect(153, 53, 64 + ((aTags.getBoolean(boxes.get(rightButtonPosX + 2 + 9).boxName) ? 0 : 1) * 16), 176, 16, 16); + + } + } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(iconLocation); - int k = ((this.width - this.xSize) / 2); - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize + 80, this.ySize); } - protected void injectIcons() + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + mc.getTextureManager().bindTexture(iconLocation); + final int k = ((width - xSize) / 2); + final int l = (height - ySize) / 2; + drawTexturedModalRect(k, l, 0, 0, xSize + 80, ySize); + + if(renderFlat) + { + ((GuiButtonExt) buttonList.get(14)).enabled = false; + ((GuiButtonExt) buttonList.get(15)).enabled = false; + ((GuiButtonExt) buttonList.get(12)).displayString = "3D"; + + final ScaledResolution scaledresolution = new ScaledResolution(mc, + mc.displayWidth, mc.displayHeight); + bigRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), bigCopy, (int) (((scaledresolution.getScaledWidth() - 58) / 2) / 3.4), (int) (((scaledresolution.getScaledHeight() - 136) / 2) / 3.4)); + } + else + { + if(bigCopy != null && bigCopy.getItem() instanceof ArmorCore) + { + ((GuiButtonExt) buttonList.get(14)).enabled = true; + ((GuiButtonExt) buttonList.get(15)).enabled = true; + + ((GuiButtonExt) buttonList.get(12)).displayString = "2D"; + + final ArmorCore armor = (ArmorCore) bigCopy.getItem(); + + final ArmorRenderer renderer = (ArmorRenderer) armor.getArmorModel(null, bigCopy, 0); + renderer.isChild = false; + + final float yaw = player.player.prevRotationYawHead + (player.player.rotationYawHead - player.player.prevRotationYawHead); + final float yawOffset = player.player.prevRenderYawOffset + (player.player.renderYawOffset - player.player.prevRenderYawOffset); + final float limbs = player.player.prevLimbSwingAmount + (player.player.limbSwingAmount - player.player.prevLimbSwingAmount); + final float limbSwing = player.player.limbSwing - player.player.limbSwingAmount * (1.0F); + + GL11.glPushMatrix(); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + + final ScaledResolution scaledresolution = new ScaledResolution( + mc, mc.displayWidth, mc.displayHeight); + //GL11.glViewport(this.guiLeft, this.guiTop, this.width, this.height); + GL11.glViewport((scaledresolution.getScaledWidth() - 213) / 2 * scaledresolution.getScaleFactor(), (scaledresolution.getScaledHeight() - 240) / 2 * scaledresolution.getScaleFactor(), 320 * scaledresolution.getScaleFactor(), 240 * scaledresolution.getScaleFactor()); + GL11.glTranslatef(-0.34F, 0.23F, -0.1F); + Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + final float f1 = 1.0F; + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glColor3d(1f, 1f, 1f); + RenderHelper.enableStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef(0.0F, 3.3F, -16.0F); + GL11.glScalef(f1, f1, f1); + final float f2 = 3.0F; + GL11.glScalef(f2, f2, f2); + GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + //renderer.setRotationAngles(limbSwing, limbs, player.player.ticksExisted, 0, player.player.rotationPitch, 0.0625f, player.player); + renderer.render(player.player, limbSwing, limbs, player.player.ticksExisted, 0, 0, 0.1f); + + if(renderBiped) + { + final ModelBiped biped = new ModelBiped(0f); + //biped.bipedHeadwear.isHidden = true; + //biped.bipedHead.isHidden = true; + ResourceLocation rc = AbstractClientPlayer.getLocationSkin(player.player.getDisplayName()); + ; + FMLClientHandler.instance().getClient().renderEngine.bindTexture(rc); + final ITextureObject tex = FMLClientHandler.instance().getClient().getTextureManager().getTexture(rc); + if(tex.getGlTextureId() == 1) + { + rc = new ResourceLocation( + "minecraft:textures/entity/steve.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(rc); + } + + biped.isChild = false; + biped.render(player.player, limbSwing, limbs, player.player.ticksExisted, 0, 0, 0.0625f); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glPopMatrix(); + //RenderHelper.disableStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + else + { + renderFlat = true; + } + } } protected void drawTooltip(int x, int y) { - int buttons[] = {4, 5, 6, 9, 10, 11}; + final 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); + final GuiButtonExt button = ((GuiButtonExt) buttonList.get(buttons[i] - 1)); + final boolean mousehover = x >= button.xPosition && y >= button.yPosition && x < button.xPosition + button.width && y < button.yPosition + button.height; + final int test = button.getHoverState(mousehover); if(test == 2) { - if(bigCopy != null) + if(bigCopy != null && bigCopy.getItem() instanceof ToolCore) { - ToolCore tool = (ToolCore) bigCopy.getItem(); - ToolCoreTip tt = ((Injector) TinkersDefense.tcInject).tools.get(tool.getToolName()); - List list = new ArrayList(); + final ToolCore tool = (ToolCore) bigCopy.getItem(); + final ToolCoreTip tt = ((Injector) TinkersDefense.tcInject).tools.get(tool.getToolName()); + final List list = new ArrayList(); if(tt != null) { switch(i) { case 0: - list.add(tt.getPart(1 + this.leftButtonPosX)); + list.add(tt.getPart(1 + leftButtonPosX)); break; case 1: - list.add(tt.getPart(3 + this.leftButtonPosX)); + list.add(tt.getPart(3 + leftButtonPosX)); break; case 2: - list.add(tt.getPart(2 + this.leftButtonPosX)); + list.add(tt.getPart(2 + leftButtonPosX)); break; case 3: - list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + ((rightButtonPosY % 3) * 16)))); + list.add(tt.getPartName(leftSelect + 1, (rightButtonPosX + ((rightButtonPosY % 3) * 16)))); break; case 4: - list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + 1 + ((rightButtonPosY % 3) * 16)))); + list.add(tt.getPartName(leftSelect + 1, (rightButtonPosX + 1 + ((rightButtonPosY % 3) * 16)))); break; case 5: - list.add(tt.getPartName(this.leftSelect + 1, (rightButtonPosX + 2 + ((rightButtonPosY % 3) * 16)))); + list.add(tt.getPartName(leftSelect + 1, (rightButtonPosX + 2 + ((rightButtonPosY % 3) * 16)))); break; } if(list.get(0).contains("Metallurgy")) + { list.add(" -by Shadowclaimer"); + } + func_146283_a(list, x, y); + } + else if(bigCopy.getItem() instanceof ArmorCore) + { + final NBTTagCompound aTags = bigCopy.getTagCompound().getCompoundTag("ArmorRenderer"); + final ArmorCore armor = (ArmorCore) bigCopy.getItem(); + final List boxes = armor.getRenderer().boxList; + + switch(i) + { + case 0: + case 1: + case 2: + break; + + case 3: + list.add(boxes.get(rightButtonPosX + 9).boxName); + break; + case 4: + list.add(boxes.get(rightButtonPosX + 1 + 9).boxName); + break; + case 5: + list.add(boxes.get(rightButtonPosX + 2 + 9).boxName); + break; + } func_146283_a(list, x, y); } else diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/RenderItem_FinishingAnvil.java b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/RenderItem_FinishingAnvil.java index 0515740..edbd414 100644 --- a/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/RenderItem_FinishingAnvil.java +++ b/src/main/java/lance5057/tDefense/finishingAnvil/blocks/finishingAnvil/RenderItem_FinishingAnvil.java @@ -35,7 +35,7 @@ public class RenderItem_FinishingAnvil extends RenderItem { GL11.glPushMatrix(); - GL11.glScalef(3.0f, 3.0f, 1.0f); + GL11.glScalef(3.438f, 3.43f, 1.0f); super.renderItemAndEffectIntoGUI(fontRenderer, textureManager, itemStack, x, y); GL11.glPopMatrix(); diff --git a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java index a0125d9..375b2e5 100644 --- a/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java +++ b/src/main/java/lance5057/tDefense/finishingAnvil/utilities/Injector.java @@ -30,7 +30,8 @@ public class Injector extends ToolCore protected void loadHeads(IIconRegister iconRegister) { - int toolLength = TConstructRegistry.tools.size(); + + final int toolLength = TConstructRegistry.tools.size(); for(int i = 0; i < toolLength; i++) { heads.clear(); @@ -38,42 +39,58 @@ public class Injector extends ToolCore 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(); + headStrings.clear(); + headIcons.clear(); + accessoryStrings.clear(); + accessoryIcons.clear(); + handleStrings.clear(); + handleIcons.clear(); + extraStrings.clear(); + extraIcons.clear(); - ToolCore tool = TConstructRegistry.tools.get(i); + final 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); + final IIcon origHead = tool.headIcons.get(-1); + final IIcon origAccessory = tool.accessoryIcons.get(-1); + final IIcon origHandle = tool.handleIcons.get(-1); + final 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(); + } if(tool.getToolName().equals("HeaterShield")) + { HeaterShield(); - 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); + } + setupIcons(tool, iconRegister, heads, headStrings, headIcons); + setupIcons(tool, iconRegister, accessories, accessoryStrings, accessoryIcons); + setupIcons(tool, iconRegister, handles, handleStrings, handleIcons); + setupIcons(tool, iconRegister, extras, extraStrings, extraIcons); tool.headStrings.putAll(headStrings); tool.headIcons.putAll(headIcons); @@ -152,8 +169,8 @@ public class Injector extends ToolCore { for(int i = 0; i < newList.size(); i++) { - PatternBuilder pb = PatternBuilder.instance; - for(Map.Entry entry : pb.materialSets.entrySet()) + final PatternBuilder pb = PatternBuilder.instance; + for(final Map.Entry entry : pb.materialSets.entrySet()) { String icon = "tinkersdefense:"; icon += tool.getDefaultFolder() + "/" + newList.get(i); @@ -167,7 +184,7 @@ public class Injector extends ToolCore void BattleAxe() { - ToolCoreTip tt = new ToolCoreTip(); + final ToolCoreTip tt = new ToolCoreTip(); tt.accessory = "Front Head"; tt.head = "Back Head"; @@ -203,7 +220,7 @@ public class Injector extends ToolCore void Axe() { - ToolCoreTip tt = new ToolCoreTip(); + final ToolCoreTip tt = new ToolCoreTip(); tt.head = "Head"; tt.handle = "Handle"; @@ -325,7 +342,7 @@ public class Injector extends ToolCore void Broadsword() { - ToolCoreTip tt = new ToolCoreTip(); + final ToolCoreTip tt = new ToolCoreTip(); tt.head = "Blade"; tt.accessory = "Guard"; @@ -469,7 +486,7 @@ public class Injector extends ToolCore void HeaterShield() { - ToolCoreTip tt = new ToolCoreTip(); + final ToolCoreTip tt = new ToolCoreTip(); tt.head = "Plate"; tt.accessory = "Emblem"; @@ -479,7 +496,7 @@ public class Injector extends ToolCore tt.headTT.add("Standard Plate"); heads.add("_glass_plate"); tt.headTT.add("Glass Plate"); - + tt.accessoryTT.add("Standard Emblem"); accessories.add("_test_face"); tt.accessoryTT.add("Villager Emblem"); @@ -519,7 +536,7 @@ public class Injector extends ToolCore tt.handleTT.add("Squared Edge"); handles.add("_heart_edge"); tt.handleTT.add("Heart Edge"); - + tt.extraTT.add("Standard Binding"); extras.add("_spider_binding"); tt.extraTT.add("Spider Binding"); @@ -544,7 +561,7 @@ public class Injector extends ToolCore extras.add("_skull_binding"); tt.extraTT.add("Skull Binding"); extras.add("_hell_binding"); - tt.extraTT.add("Hell Binding"); + tt.extraTT.add("Hell Binding"); extras.add("_queen_binding"); tt.extraTT.add("Queen's Binding"); extras.add("_tri_binding"); diff --git a/src/main/java/lance5057/tDefense/models/ModelJewelersBench.java b/src/main/java/lance5057/tDefense/models/ModelJewelersBench.java deleted file mode 100644 index 342b747..0000000 --- a/src/main/java/lance5057/tDefense/models/ModelJewelersBench.java +++ /dev/null @@ -1,104 +0,0 @@ -package lance5057.tDefense.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -/** - * JewelersBench - lance5057 - * Created using Tabula 4.1.1 - */ -public class ModelJewelersBench extends ModelBase -{ - public ModelRenderer TableSide2; - public ModelRenderer SawBlock1; - public ModelRenderer SawBlock2; - public ModelRenderer SawBlock3; - public ModelRenderer SawBlockClamp; - public ModelRenderer Leg1; - public ModelRenderer Leg2; - public ModelRenderer Leg3; - public ModelRenderer Leg4; - public ModelRenderer TableTop; - public ModelRenderer TableBack; - public ModelRenderer TableSide1; - public ModelRenderer Drawer; - public ModelRenderer Handle; - - public ModelJewelersBench() - { - this.textureWidth = 64; - this.textureHeight = 64; - this.SawBlock1 = new ModelRenderer(this, 0, 0); - this.SawBlock1.setRotationPoint(2.0F, 8.2F, -12.0F); - this.SawBlock1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 4, 0.0F); - this.Leg4 = new ModelRenderer(this, 0, 0); - this.Leg4.setRotationPoint(6.0F, 10.0F, 6.0F); - this.Leg4.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); - this.Drawer = new ModelRenderer(this, 0, 46); - this.Drawer.setRotationPoint(-6.0F, 11.5F, -8.0F); - this.Drawer.addBox(0.0F, 0.0F, 0.0F, 12, 2, 16, 0.0F); - this.TableSide2 = new ModelRenderer(this, 0, 0); - this.TableSide2.setRotationPoint(-8.0F, 7.0F, -7.0F); - this.TableSide2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 14, 0.0F); - this.Leg2 = new ModelRenderer(this, 0, 0); - this.Leg2.setRotationPoint(6.0F, 10.0F, -8.0F); - this.Leg2.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); - this.TableSide1 = new ModelRenderer(this, 0, 0); - this.TableSide1.setRotationPoint(7.0F, 7.0F, -7.0F); - this.TableSide1.addBox(0.0F, 0.0F, 0.0F, 1, 1, 14, 0.0F); - this.SawBlock3 = new ModelRenderer(this, 0, 0); - this.SawBlock3.setRotationPoint(3.0F, 8.2F, -11.0F); - this.SawBlock3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3, 0.0F); - this.Handle = new ModelRenderer(this, 55, 0); - this.Handle.setRotationPoint(-2.0F, 12.0F, -9.0F); - this.Handle.addBox(0.0F, 0.0F, 0.0F, 4, 1, 1, 0.0F); - this.Leg1 = new ModelRenderer(this, 0, 0); - this.Leg1.setRotationPoint(-8.0F, 10.0F, -8.0F); - this.Leg1.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); - this.TableTop = new ModelRenderer(this, 0, 28); - this.TableTop.setRotationPoint(-8.0F, 8.0F, -8.0F); - this.TableTop.addBox(0.0F, 0.0F, 0.0F, 16, 2, 16, 0.0F); - this.TableBack = new ModelRenderer(this, 0, 0); - this.TableBack.setRotationPoint(-8.0F, 7.0F, 7.0F); - this.TableBack.addBox(0.0F, 0.0F, 0.0F, 16, 1, 1, 0.0F); - this.SawBlockClamp = new ModelRenderer(this, 54, 0); - this.SawBlockClamp.setRotationPoint(1.5F, 8.0F, -9.0F); - this.SawBlockClamp.addBox(0.0F, 0.0F, 0.0F, 4, 2, 1, 0.0F); - this.Leg3 = new ModelRenderer(this, 0, 0); - this.Leg3.setRotationPoint(-8.0F, 10.0F, 6.0F); - this.Leg3.addBox(0.0F, 0.0F, 0.0F, 2, 14, 2, 0.0F); - this.SawBlock2 = new ModelRenderer(this, 0, 0); - this.SawBlock2.setRotationPoint(4.0F, 8.2F, -12.0F); - this.SawBlock2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 4, 0.0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - this.SawBlock1.render(f5); - this.Leg4.render(f5); - this.Drawer.render(f5); - this.TableSide2.render(f5); - this.Leg2.render(f5); - this.TableSide1.render(f5); - this.SawBlock3.render(f5); - this.Handle.render(f5); - this.Leg1.render(f5); - this.TableTop.render(f5); - this.TableBack.render(f5); - this.SawBlockClamp.render(f5); - this.Leg3.render(f5); - this.SawBlock2.render(f5); - } - - /** - * This is a helper function from Tabula to set the rotation of model parts - */ - public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) - { - modelRenderer.rotateAngleX = x; - modelRenderer.rotateAngleY = y; - modelRenderer.rotateAngleZ = z; - } -} diff --git a/src/main/java/lance5057/tDefense/models/Renderer_JewelersBench.java b/src/main/java/lance5057/tDefense/models/Renderer_JewelersBench.java deleted file mode 100644 index bebba3e..0000000 --- a/src/main/java/lance5057/tDefense/models/Renderer_JewelersBench.java +++ /dev/null @@ -1,42 +0,0 @@ -package lance5057.tDefense.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -public class Renderer_JewelersBench extends TileEntitySpecialRenderer -{ - private final ModelJewelersBench model; - - public Renderer_JewelersBench() - { - this.model = new ModelJewelersBench(); - } - - @Override - public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); - - ResourceLocation textures = (new ResourceLocation("tinkersdefense:textures/blocks/JewelersBench.png")); - - Minecraft.getMinecraft().renderEngine.bindTexture(textures); - - GL11.glPushMatrix(); - - int meta = te.getBlockMetadata(); - - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - - this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - - } - -} diff --git a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java index dbd2492..2fd44ac 100644 --- a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java @@ -1,13 +1,14 @@ package lance5057.tDefense.proxy; import lance5057.tDefense.TinkersDefense; -import lance5057.tDefense.armor.renderers.ModelMask; -import lance5057.tDefense.armor.renderers.ModelSheath; +import lance5057.tDefense.armor.TDArmorAddon; +import lance5057.tDefense.armor.renderers.ModelTinkersGauntlets; +import lance5057.tDefense.armor.renderers.ModelTinkersTabard; import lance5057.tDefense.armor.renderers.cloth.ModelTinkersHood; import lance5057.tDefense.armor.renderers.cloth.ModelTinkersRobe; import lance5057.tDefense.armor.renderers.cloth.ModelTinkersShawl; +import lance5057.tDefense.armor.renderers.cloth.ModelTinkersShoes; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersBreastplate; -import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGauntlets; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersGrieves; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersHelm; import lance5057.tDefense.armor.renderers.heavy.ModelTinkersSabatons; @@ -15,13 +16,15 @@ import lance5057.tDefense.armor.renderers.light.ModelTinkersBoots; import lance5057.tDefense.armor.renderers.light.ModelTinkersChausses; import lance5057.tDefense.armor.renderers.light.ModelTinkersCoif; import lance5057.tDefense.armor.renderers.light.ModelTinkersHauberk; +import lance5057.tDefense.baubles.models.Renderer_JewelersBench; +import lance5057.tDefense.baubles.tileentities.TileEntity_JewelersBench; import lance5057.tDefense.core.blocks.crestMount.Renderer_CrestMount; import lance5057.tDefense.core.blocks.crestMount.TileEntity_CrestMount; -import lance5057.tDefense.core.renderer.BigFlexibleToolRenderer; +import lance5057.tDefense.core.renderer.MoreFlexibleToolRenderer; +import lance5057.tDefense.core.tools.modifiers.ModifierSoulHandler; +//import lance5057.tDefense.core.renderer.TestSkinChanger; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.Renderer_FinishingAnvil; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.TileEntity_FinishingAnvil; -import lance5057.tDefense.models.Renderer_JewelersBench; -import lance5057.tDefense.tileentities.TileEntity_JewelersBench; import net.minecraftforge.client.MinecraftForgeClient; import tconstruct.client.FlexibleToolRenderer; import cpw.mods.fml.client.registry.ClientRegistry; @@ -29,53 +32,69 @@ import cpw.mods.fml.client.registry.ClientRegistry; public class ClientProxy extends CommonProxy { //public static final ModelSheath sheath = new ModelSheath(); + //ModifierSoulHandler SoulHandler; - public static ModelMask mask = new ModelMask(null); - public static ModelSheath sheath = new ModelSheath(); + public static ModelTinkersTabard sheath; - public static ModelTinkersHelm helm = new ModelTinkersHelm(); - public static ModelTinkersBreastplate breastplate = new ModelTinkersBreastplate(); - public static ModelTinkersGrieves grieves = new ModelTinkersGrieves(); - public static ModelTinkersSabatons sabatons = new ModelTinkersSabatons(); - public static ModelTinkersGauntlets gauntlets = new ModelTinkersGauntlets(); + public static ModelTinkersHelm helm; + public static ModelTinkersBreastplate breastplate; + public static ModelTinkersGrieves grieves; + public static ModelTinkersSabatons sabatons; + public static ModelTinkersGauntlets gauntlets; - public static ModelTinkersHood hood = new ModelTinkersHood(); - public static ModelTinkersShawl shawl = new ModelTinkersShawl(); - public static ModelTinkersRobe robe = new ModelTinkersRobe(); - public static ModelTinkersBoots shoes = new ModelTinkersBoots(); + public static ModelTinkersHood hood; + public static ModelTinkersShawl shawl; + public static ModelTinkersRobe robe; + public static ModelTinkersShoes shoes; - public static ModelTinkersCoif coif = new ModelTinkersCoif(); - public static ModelTinkersHauberk hauberk = new ModelTinkersHauberk(); - public static ModelTinkersChausses chausses = new ModelTinkersChausses(); - public static ModelTinkersBoots boots = new ModelTinkersBoots(); + public static ModelTinkersCoif coif; + public static ModelTinkersHauberk hauberk; + public static ModelTinkersChausses chausses; + public static ModelTinkersBoots boots; @Override public void registerRenderers() { - FlexibleToolRenderer renderer = new FlexibleToolRenderer(); - FlexibleToolRenderer bigrenderer = new BigFlexibleToolRenderer(); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_roundShield, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_heaterShield, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_wrench, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_shears, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_zweihander, bigrenderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_sheath, renderer); + SoulHandler = new ModifierSoulHandler(2, "Steve"); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerHelm, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerBreastplate, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerGrieves, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerSabatons, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerGauntlets, renderer); + sheath = new ModelTinkersTabard(); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerRobe, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerShawl, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerHood, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerShoes, renderer); + helm = new ModelTinkersHelm(); + breastplate = new ModelTinkersBreastplate(); + grieves = new ModelTinkersGrieves(); + sabatons = new ModelTinkersSabatons(); + gauntlets = new ModelTinkersGauntlets(); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerCoif, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerHalberd, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerChausses, renderer); - MinecraftForgeClient.registerItemRenderer(TinkersDefense.armor_TinkerBoots, renderer); + hood = new ModelTinkersHood(); + shawl = new ModelTinkersShawl(); + robe = new ModelTinkersRobe(); + shoes = new ModelTinkersShoes(); + + coif = new ModelTinkersCoif(); + hauberk = new ModelTinkersHauberk(); + chausses = new ModelTinkersChausses(); + boots = new ModelTinkersBoots(); + + // final FlexibleToolRenderer renderer = new FlexibleToolRenderer(); + // final FlexibleToolRenderer bigrenderer = new MoreFlexibleToolRenderer(2); + // final FlexibleToolRenderer smallrenderer = new MoreFlexibleToolRenderer( + // 1.0f); + MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_roundShield, new MoreFlexibleToolRenderer( + 0.75f, 0.0f, 0.2f, 0f)); + MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_heaterShield, new FlexibleToolRenderer()); + MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_wrench, new FlexibleToolRenderer()); + MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_shears, new FlexibleToolRenderer()); + //MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_hookshot, renderer); + MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_zweihander, new MoreFlexibleToolRenderer( + 1.5f, -0.325f, -0.025f, 0f)); + //MinecraftForgeClient.registerItemRenderer(TinkersDefense.tool_hookshot, renderer); + + //RenderingRegistry.registerEntityRenderingHandler(EntityHookshotHook.class, new HookRenderer()); + + if(TinkersDefense.config.ArmorAddon) + { + TDArmorAddon.clientProxy(new FlexibleToolRenderer()); + } ClientRegistry.bindTileEntitySpecialRenderer(TileEntity_CrestMount.class, new Renderer_CrestMount()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntity_FinishingAnvil.class, new Renderer_FinishingAnvil()); diff --git a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java index 7b39954..0caa0e0 100644 --- a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java @@ -4,6 +4,8 @@ import lance5057.tDefense.TinkersDefense; import lance5057.tDefense.core.blocks.crestMount.Container_CrestMount; import lance5057.tDefense.core.blocks.crestMount.Gui_CrestMount; import lance5057.tDefense.core.blocks.crestMount.TileEntity_CrestMount; +import lance5057.tDefense.core.gui.GuiTDGuideBook; +import lance5057.tDefense.core.tools.modifiers.ModifierSoulHandler; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.Container_FinishingAnvil; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.Gui_FinishingAnvil; import lance5057.tDefense.finishingAnvil.blocks.finishingAnvil.TileEntity_FinishingAnvil; @@ -15,6 +17,8 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class CommonProxy implements IGuiHandler { + public static ModifierSoulHandler SoulHandler = null; + public void registerRenderers() { } @@ -43,13 +47,11 @@ public class CommonProxy implements IGuiHandler public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == TinkersDefense.GUI_CREST_INV) - { - return new Container_CrestMount(player.inventory, (TileEntity_CrestMount) world.getTileEntity(x, y, z)); - } + return new Container_CrestMount(player.inventory, + (TileEntity_CrestMount) world.getTileEntity(x, y, z)); if(ID == TinkersDefense.GUI_ANVIL_INV) - { - return new Container_FinishingAnvil(player.inventory, (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); - } + return new Container_FinishingAnvil(player.inventory, + (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); return null; } @@ -58,13 +60,13 @@ public class CommonProxy implements IGuiHandler public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == TinkersDefense.GUI_CREST_INV) - { - return new Gui_CrestMount(player.inventory, (TileEntity_CrestMount) world.getTileEntity(x, y, z)); - } + return new Gui_CrestMount(player.inventory, + (TileEntity_CrestMount) world.getTileEntity(x, y, z)); if(ID == TinkersDefense.GUI_ANVIL_INV) - { - return new Gui_FinishingAnvil(player.inventory, (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); - } + return new Gui_FinishingAnvil(player.inventory, + (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); + if(ID == TinkersDefense.GUI_GUIDEBOOK) + return new GuiTDGuideBook(); return null; } } diff --git a/src/main/java/lance5057/tDefense/tileentities/TileEntity_JewelersBench.java b/src/main/java/lance5057/tDefense/tileentities/TileEntity_JewelersBench.java deleted file mode 100644 index b4c0c68..0000000 --- a/src/main/java/lance5057/tDefense/tileentities/TileEntity_JewelersBench.java +++ /dev/null @@ -1,8 +0,0 @@ -package lance5057.tDefense.tileentities; - -import net.minecraft.tileentity.TileEntity; - -public class TileEntity_JewelersBench extends TileEntity -{ - -} -- cgit v1.2.3