diff --git a/mods/tinker/resources/manuals/materials.xml b/mods/tinker/resources/manuals/materials.xml index ad1ff667..49f1806a 100644 --- a/mods/tinker/resources/manuals/materials.xml +++ b/mods/tinker/resources/manuals/materials.xml @@ -29,11 +29,215 @@ By Skyla -Welcome to the second edition of Materials and You: A Guide to Tools and Abilities. Within these pages you will details on every known tool, modifier, and material. A detailed breakdown of each +Welcome to the second edition of Materials and You: A Guide to Tools and Abilities. Within these pages you will details on every known tool, modifier, and material. A detailed breakdown of everything known, and a few unknowns, lie here. This book is a magic copy; it updates whenever the original has been modified. Check back occasionally for information on new things. + +Pickaxe +The Pickaxe is a basic mining tool. It is the simplest method of chewing through rock and harvesting ores. +Class: Precision Tool +Effective on: Stone or rock, ores, and metal. +pickicon + + Pickaxe Head + pickhead + + + Tool Rod + toolrod + + + Tool Binding + binding + + + + +Shovel +The Shovel is a basic digging tool. It is the most common way of moving earth around. +Class: Precision Tool +Effective on: Dirt, sand, and snow. +shovelicon + + Shovel Head + shovelhead + + + Tool Rod + toolrod + + + + +Axe +The Axe is a basic chopping tool. It is the simplest way to shape lumber. +Class: Precision Tool +Effective on: Trees. +axeicon + + Axe Head + axehead + + + Tool Rod + toolrod + + + + +Mattock +The Cutter Mattock is a versatile farming tool. Its primary purpose is to till soil. It also works somewhat like an axe and a shovel, but is not a replacement for either. +Class: Multitool +Effective on: Wood, dirt, and plants. +mattockicon + + Axe Head + axehead + + + Tool Rod + toolrod + + + Shovel Head + shovelhead + + + + +Broadsword +The Broadsword is a defensive weapon. It is a favorite of many Tinkers and is useful in a wide variety of situations. +Right-click: Block +- Blocking cuts a wide variety of damage types in half. + +Class: Melee Weapon +Effective on webs. +swordicon + + Sword Blade + swordblade + + + Tool Rod + toolrod + + + Wide Guard + wideguard + + + + +Longsword +The Longsword is an offensive weapon. It is used for full-speed charges and plowing through enemy lines +Right-click: Lunge +- When released, it sends you careening forward at breakneck speed. + +Natural Abilities: +- Charge Boost, does 1.5x damage and knockback while sprinting + +Class: Melee Weapon +Effective on webs. +longswordicon + + Sword Blade + swordblade + + + Tool Rod + toolrod + + + Hand Guard + handguard + + + + +Rapier +The Rapier is a special weapon. The dancing swordplay lets you get in and out of battle quickly. While the Rapier's damage is low, it makes up for this with its other abilities. +Right-click: Backpedal +- Take a small hop backwards + +Natural Abilities: +- Charge Boost, does 2x damage and knockback while sprinting. +- Armor Pierce, ignores armor and blocking. +- Quick Strike, the enemy is stunned for less time. + +Class: Melee Weapon +rapiericon + + Sword Blade + swordblade + + + Tool Rod + toolrod + + + Crossbar + crossbar + + + + +Frying Pan +The Frying is a heavy weapon that uses sheer weight to stun foes or a place to cook your food. It is common to hunt pigs and cook them with the same pan. +Right-click: Block +- Blocking cuts a wide variety of damage types in half. + +Shift+Right-click: Place Item +- The frying pan cooks a large amount of food at a time. + +Natural Abilities: +- Heavy, does extra knockback and stuns the foe. +frypanicon + + Pan + pan + + + Tool Rod + toolrod + + + Crossbar + crossbar + + + + +Battlesign +The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere. +Right-click: Block +- Blocking cuts a wide variety of damage types in half. + +Class: Lethal Joke Weapon +battlesignicon + + Board + board + + + Tool Rod + toolrod + + + + +Material Abilities + +Some materials have abilities that augment their natural uses. + +Reinforced: 10% chance per level of not using durability +Shoddy: Mines faster and does less damage as the tool breaks +Spiny: Opposite of Shoddy +Writable: One extra modifier per piece +Awareness: Unknown + + Wood woodaxe @@ -146,15 +350,6 @@ This book is a magic copy; it updates whenever the original has been modified. C - -Paper -paperpick -It's very weak, but can take a lot of modification. - -
paperstack
-
-
- Cobalt cobaltlongsword diff --git a/mods/tinker/tconstruct/OverworldProvider.java b/mods/tinker/tconstruct/OverworldProvider.java new file mode 100644 index 00000000..3870992b --- /dev/null +++ b/mods/tinker/tconstruct/OverworldProvider.java @@ -0,0 +1,39 @@ +package mods.tinker.tconstruct; + +import net.minecraft.world.WorldProvider; + +public class OverworldProvider extends WorldProvider +{ + + @Override + public String getDimensionName () + { + return "Overworld"; + } + + public float calculateCelestialAngle(long worldtime, float par3) + { + int timeOfDay = (int)(worldtime % 43200L); + float f1 = ((float)timeOfDay + par3) / 43200.0F - 0.25F; + + if (f1 < 0.0F) + { + ++f1; + } + + if (f1 > 1.0F) + { + --f1; + } + + float f2 = f1; + f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D); + f1 = f2 + (f1 - f2) / 3.0F; + return f1; + } + + public int getMoonPhase(long par1) + { + return (int)(par1 / 43200L) % 8; + } +} diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 0158bf29..5f1750ea 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -1,19 +1,16 @@ package mods.tinker.tconstruct; -import java.util.Random; - import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TabTools; import mods.tinker.tconstruct.player.TPlayerHandler; import mods.tinker.tconstruct.worldgen.TBaseWorldGenerator; +import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; -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.network.NetworkMod; @@ -25,10 +22,11 @@ import cpw.mods.fml.common.registry.GameRegistry; * @author: mDiyo */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.23") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.29.1_weapontest") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class) public class TConstruct { + /** The value of one ingot in millibuckets */ public static final int ingotLiquidValue = 144; public static final int liquidUpdateAmount = 6; @@ -38,11 +36,6 @@ public class TConstruct /* Proxies for sides, used for graphics processing */ @SidedProxy(clientSide = "mods.tinker.tconstruct.client.TProxyClient", serverSide = "mods.tinker.tconstruct.TProxyCommon") public static TProxyCommon proxy; - - public TConstruct() - { - //Take that, any mod that does ore dictionary registration in preinit! - } @PreInit public void preInit (FMLPreInitializationEvent evt) @@ -54,38 +47,35 @@ public class TConstruct content = new TContent(); events = new TEventHandler(); + events.unfuxOreDictionary(); MinecraftForge.EVENT_BUS.register(events); - events.unfuxOreDictionary(); + content.oreRegistry(); proxy.registerRenderer(); proxy.addNames(); proxy.readManuals(); //proxy.registerKeys(); - } - @Init - public void init (FMLInitializationEvent evt) - { - GameRegistry.registerWorldGenerator(new TBaseWorldGenerator()); - GameRegistry.registerFuelHandler(content); - GameRegistry.registerCraftingHandler(new TCraftingHandler()); - NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler()); + GameRegistry.registerWorldGenerator(new TBaseWorldGenerator()); + GameRegistry.registerFuelHandler(content); + GameRegistry.registerCraftingHandler(new TCraftingHandler()); + NetworkRegistry.instance().registerGuiHandler(instance, new TGuiHandler()); + + DimensionManager.unregisterProviderType(0); + DimensionManager.registerProviderType(0, OverworldProvider.class, true); } @PostInit public void postInit (FMLPostInitializationEvent evt) - { - content.modIntegration(); - content.oreRegistry(); - + { playerTracker = new TPlayerHandler(); GameRegistry.registerPlayerTracker(playerTracker); MinecraftForge.EVENT_BUS.register(playerTracker); + + content.modIntegration(); } public static TEventHandler events; public static TPlayerHandler playerTracker; public static TContent content; - - public static Random tRand = new Random(); } diff --git a/mods/tinker/tconstruct/TContent.java b/mods/tinker/tconstruct/TContent.java index 58f194b4..9bc47e02 100644 --- a/mods/tinker/tconstruct/TContent.java +++ b/mods/tinker/tconstruct/TContent.java @@ -76,8 +76,8 @@ public class TContent implements IFuelHandler public static Item shovelHead; public static Item axeHead; public static Item swordBlade; - public static Item largeGuard; - public static Item medGuard; + public static Item wideGuard; + public static Item handGuard; public static Item crossbar; public static Item binding; @@ -285,8 +285,8 @@ public class TContent implements IFuelHandler shovelHead = new ToolPart(PHConstruct.shovelHead, "ShovelHead", "_shovel_head").setUnlocalizedName("tconstruct.ShovelHead"); axeHead = new ToolPart(PHConstruct.axeHead, "AxeHead", "_axe_head").setUnlocalizedName("tconstruct.AxeHead"); swordBlade = new ToolPart(PHConstruct.swordBlade, "SwordBlade", "_sword_blade").setUnlocalizedName("tconstruct.SwordBlade"); - largeGuard = new ToolPart(PHConstruct.largeGuard, "LargeGuard", "_large_guard").setUnlocalizedName("tconstruct.LargeGuard"); - medGuard = new ToolPart(PHConstruct.medGuard, "MediumGuard", "_medium_guard").setUnlocalizedName("tconstruct.MediumGuard"); + wideGuard = new ToolPart(PHConstruct.largeGuard, "LargeGuard", "_large_guard").setUnlocalizedName("tconstruct.LargeGuard"); + handGuard = new ToolPart(PHConstruct.medGuard, "MediumGuard", "_medium_guard").setUnlocalizedName("tconstruct.MediumGuard"); crossbar = new ToolPart(PHConstruct.crossbar, "Crossbar", "_crossbar").setUnlocalizedName("tconstruct.Crossbar"); binding = new ToolPart(PHConstruct.binding, "Binding", "_binding").setUnlocalizedName("tconstruct.Binding"); @@ -439,14 +439,14 @@ public class TContent implements IFuelHandler RecipeRemover.removeShapedRecipes(removeTools); - patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, axeHead, swordBlade, largeGuard, medGuard, crossbar, binding, frypanHead, signHead }; + patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, axeHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead }; ToolBuilder tb = ToolBuilder.instance; tb.addToolRecipe(pickaxe, pickaxeHead, binding); - tb.addToolRecipe(broadsword, swordBlade, largeGuard); + tb.addToolRecipe(broadsword, swordBlade, wideGuard); tb.addToolRecipe(axe, axeHead); tb.addToolRecipe(shovel, shovelHead); - tb.addToolRecipe(longsword, swordBlade, medGuard); + tb.addToolRecipe(longsword, swordBlade, handGuard); tb.addToolRecipe(rapier, swordBlade, crossbar); tb.addToolRecipe(frypan, frypanHead); tb.addToolRecipe(battlesign, signHead); @@ -454,8 +454,9 @@ public class TContent implements IFuelHandler //tb.addToolRecipe(longbow, toolRod, toolRod); //tb.addToolRecipe(lumberaxe, lumberHead); + ItemStack diamond = new ItemStack(Item.diamond); tb.registerToolMod(new ModRepair()); - tb.registerToolMod(new ModDurability(new ItemStack[] { new ItemStack(Item.diamond) }, 0, 500, 0f, 3, "Diamond", "\u00a7bDurability +500", "\u00a7b")); + tb.registerToolMod(new ModDurability(new ItemStack[] { diamond }, 0, 500, 0f, 3, "Diamond", "\u00a7bDurability +500", "\u00a7b")); tb.registerToolMod(new ModDurability(new ItemStack[] { new ItemStack(Item.emerald) }, 1, 0, 0.5f, 2, "Emerald", "\u00a72Durability +50%", "\u00a72")); modE = new ModElectric(); @@ -491,6 +492,9 @@ public class TContent implements IFuelHandler tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzBlock }, 11, 4)); tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzItem, quartzBlock }, 11, 5)); tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzBlock, quartzBlock }, 11, 8)); + + tb.registerToolMod(new ModExtraModifier(new ItemStack[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free")); + tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free")); ItemStack ingotcast = new ItemStack(metalPattern, 1, 0); @@ -515,19 +519,19 @@ public class TContent implements IFuelHandler //Buckets ItemStack bucket = new ItemStack(Item.bucketEmpty); - lc.addCastingRecipe(new ItemStack(buckets, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), bucket, 10); //Iron - lc.addCastingRecipe(new ItemStack(buckets, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), bucket, 10); //gold - lc.addCastingRecipe(new ItemStack(buckets, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), bucket, 10); //copper - lc.addCastingRecipe(new ItemStack(buckets, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), bucket, 10); //tin - lc.addCastingRecipe(new ItemStack(buckets, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), bucket, 10); //aluminum - lc.addCastingRecipe(new ItemStack(buckets, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), bucket, 10); //cobalt - lc.addCastingRecipe(new ItemStack(buckets, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), bucket, 10); //ardite - lc.addCastingRecipe(new ItemStack(buckets, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), bucket, 10); //bronze - lc.addCastingRecipe(new ItemStack(buckets, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), bucket, 10); //albrass - lc.addCastingRecipe(new ItemStack(buckets, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), bucket, 10); //manyullyn - lc.addCastingRecipe(new ItemStack(buckets, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), bucket, 10); //alumite - lc.addCastingRecipe(new ItemStack(buckets, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 11), bucket, 10);// obsidian - lc.addCastingRecipe(new ItemStack(buckets, 1, 12), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), bucket, 10); //steel + lc.addCastingRecipe(new ItemStack(buckets, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), bucket, true, 10); //Iron + lc.addCastingRecipe(new ItemStack(buckets, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), bucket, true, 10); //gold + lc.addCastingRecipe(new ItemStack(buckets, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), bucket, true, 10); //copper + lc.addCastingRecipe(new ItemStack(buckets, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), bucket, true, 10); //tin + lc.addCastingRecipe(new ItemStack(buckets, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), bucket, true, 10); //aluminum + lc.addCastingRecipe(new ItemStack(buckets, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), bucket, true, 10); //cobalt + lc.addCastingRecipe(new ItemStack(buckets, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), bucket, true, 10); //ardite + lc.addCastingRecipe(new ItemStack(buckets, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), bucket, true, 10); //bronze + lc.addCastingRecipe(new ItemStack(buckets, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), bucket, true, 10); //albrass + lc.addCastingRecipe(new ItemStack(buckets, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), bucket, true, 10); //manyullyn + lc.addCastingRecipe(new ItemStack(buckets, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), bucket, true, 10); //alumite + lc.addCastingRecipe(new ItemStack(buckets, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 11), bucket, true, 10);// obsidian + lc.addCastingRecipe(new ItemStack(buckets, 1, 12), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), bucket, true, 10); //steel liquids = new LiquidStack[] { new LiquidStack(liquidMetalStill.blockID, 1, 0), new LiquidStack(liquidMetalStill.blockID, 1, 2), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6), new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 7), diff --git a/mods/tinker/tconstruct/TEventHandler.java b/mods/tinker/tconstruct/TEventHandler.java index be582700..91442dd0 100644 --- a/mods/tinker/tconstruct/TEventHandler.java +++ b/mods/tinker/tconstruct/TEventHandler.java @@ -278,7 +278,7 @@ public class TEventHandler } } - public void unfuxOreDictionary () + public void unfuxOreDictionary () //TODO: This isn't the best { ArrayList ores = OreDictionary.getOres("ingotCopper"); for (ItemStack ore : ores) diff --git a/mods/tinker/tconstruct/blocks/EquipBlock.java b/mods/tinker/tconstruct/blocks/EquipBlock.java index 83eccdbd..5b3fac15 100644 --- a/mods/tinker/tconstruct/blocks/EquipBlock.java +++ b/mods/tinker/tconstruct/blocks/EquipBlock.java @@ -5,7 +5,7 @@ import java.util.Random; import mods.tinker.common.InventoryBlock; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TGuiHandler; -import mods.tinker.tconstruct.client.FrypanRender; +import mods.tinker.tconstruct.client.blockrender.FrypanRender; import mods.tinker.tconstruct.logic.FrypanLogic; import net.minecraft.block.Block; import net.minecraft.block.material.Material; diff --git a/mods/tinker/tconstruct/blocks/GolemCoreBlock.java b/mods/tinker/tconstruct/blocks/GolemCoreBlock.java index e8b95d83..242f45a5 100644 --- a/mods/tinker/tconstruct/blocks/GolemCoreBlock.java +++ b/mods/tinker/tconstruct/blocks/GolemCoreBlock.java @@ -2,7 +2,7 @@ package mods.tinker.tconstruct.blocks; import mods.tinker.common.InventoryBlock; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.client.GolemCoreRender; +import mods.tinker.tconstruct.client.blockrender.GolemCoreRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.logic.GolemCoreLogic; import net.minecraft.block.material.Material; diff --git a/mods/tinker/tconstruct/blocks/LavaTankBlock.java b/mods/tinker/tconstruct/blocks/LavaTankBlock.java index d5bebca0..d78e5526 100644 --- a/mods/tinker/tconstruct/blocks/LavaTankBlock.java +++ b/mods/tinker/tconstruct/blocks/LavaTankBlock.java @@ -3,7 +3,7 @@ package mods.tinker.tconstruct.blocks; import java.util.List; import mods.tinker.common.IServantLogic; -import mods.tinker.tconstruct.client.TankRender; +import mods.tinker.tconstruct.client.blockrender.TankRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.logic.LavaTankLogic; import net.minecraft.block.Block; diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java index ee87b788..97363381 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java @@ -3,7 +3,7 @@ package mods.tinker.tconstruct.blocks; import java.util.Random; import mods.tinker.tconstruct.TContent; -import mods.tinker.tconstruct.client.FluidRender; +import mods.tinker.tconstruct.client.blockrender.FluidRender; import mods.tinker.tconstruct.logic.LiquidTextureLogic; import net.minecraft.block.Block; import net.minecraft.block.material.Material; diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java index 4c8c50a6..693a2632 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java @@ -175,17 +175,9 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid int meta = world.getBlockMetadata(x, y, z); int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); - world.setBlock(x, y, z, this.blockID - 1, meta, 2); - world.scheduleBlockUpdate(x, y, z, this.blockID - 1, this.tickRate(world)); + world.setBlock(x, y, z, flowingLiquidID(), meta, 2); + world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate(world)); ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); - /*int meta = world.getBlockMetadata(x, y, z); - int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); - world.editingBlocks = true; - world.setBlockAndMetadata(x, y, z, flowingLiquidID(), meta); - world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); - world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate()); - ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setTexturePos(tex); - world.editingBlocks = false;*/ } public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) diff --git a/mods/tinker/tconstruct/blocks/SearedBlock.java b/mods/tinker/tconstruct/blocks/SearedBlock.java index 5a409b9a..04e6b74f 100644 --- a/mods/tinker/tconstruct/blocks/SearedBlock.java +++ b/mods/tinker/tconstruct/blocks/SearedBlock.java @@ -4,7 +4,7 @@ import java.util.List; import mods.tinker.common.InventoryBlock; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.client.SearedRender; +import mods.tinker.tconstruct.client.blockrender.SearedRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.logic.CastingTableLogic; import mods.tinker.tconstruct.logic.FaucetLogic; diff --git a/mods/tinker/tconstruct/blocks/SmelteryBlock.java b/mods/tinker/tconstruct/blocks/SmelteryBlock.java index e639b843..9d92d1d3 100644 --- a/mods/tinker/tconstruct/blocks/SmelteryBlock.java +++ b/mods/tinker/tconstruct/blocks/SmelteryBlock.java @@ -9,7 +9,7 @@ import mods.tinker.common.IServantLogic; import mods.tinker.common.InventoryBlock; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TGuiHandler; -import mods.tinker.tconstruct.client.SmelteryRender; +import mods.tinker.tconstruct.client.blockrender.SmelteryRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.logic.MultiServantLogic; import mods.tinker.tconstruct.logic.SmelteryDrainLogic; diff --git a/mods/tinker/tconstruct/blocks/ToolStationBlock.java b/mods/tinker/tconstruct/blocks/ToolStationBlock.java index 5ad15e56..b72ff767 100644 --- a/mods/tinker/tconstruct/blocks/ToolStationBlock.java +++ b/mods/tinker/tconstruct/blocks/ToolStationBlock.java @@ -4,7 +4,7 @@ import java.util.List; import mods.tinker.common.InventoryBlock; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.client.TableRender; +import mods.tinker.tconstruct.client.blockrender.TableRender; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.logic.PartCrafterLogic; import mods.tinker.tconstruct.logic.PatternChestLogic; diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index c971b633..e4929e73 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -12,11 +12,22 @@ import mods.tinker.common.fancyitem.FancyItemRender; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TContent; import mods.tinker.tconstruct.TProxyCommon; +import mods.tinker.tconstruct.client.blockrender.CastingTableSpecialRenderer; +import mods.tinker.tconstruct.client.blockrender.FluidRender; +import mods.tinker.tconstruct.client.blockrender.FrypanRender; +import mods.tinker.tconstruct.client.blockrender.GolemCoreRender; +import mods.tinker.tconstruct.client.blockrender.GolemCoreSpecialRender; +import mods.tinker.tconstruct.client.blockrender.SearedRender; +import mods.tinker.tconstruct.client.blockrender.SmallFontRenderer; +import mods.tinker.tconstruct.client.blockrender.SmelteryRender; +import mods.tinker.tconstruct.client.blockrender.TableRender; +import mods.tinker.tconstruct.client.blockrender.TankRender; import mods.tinker.tconstruct.client.entityrender.CartRender; import mods.tinker.tconstruct.client.entityrender.CrystalRender; import mods.tinker.tconstruct.client.entityrender.ThrownItemRender; import mods.tinker.tconstruct.client.entityrender.SkylaRender; import mods.tinker.tconstruct.client.entityrender.SlimeRender; +import mods.tinker.tconstruct.crafting.ToolBuilder; import mods.tinker.tconstruct.entity.BlueSlime; import mods.tinker.tconstruct.entity.CartEntity; import mods.tinker.tconstruct.entity.Crystal; @@ -75,196 +86,196 @@ import cpw.mods.fml.relauncher.Side; public class TProxyClient extends TProxyCommon { - public static SmallFontRenderer smallFontRenderer; - public static Icon metalBall; - public static Minecraft mc; + public static SmallFontRenderer smallFontRenderer; + public static Icon metalBall; + public static Minecraft mc; - /* Registers any rendering code. */ - public void registerRenderer () - { - Minecraft mc = Minecraft.getMinecraft(); - smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false); - RenderingRegistry.registerBlockHandler(new TableRender()); - RenderingRegistry.registerBlockHandler(new FrypanRender()); - RenderingRegistry.registerBlockHandler(new SmelteryRender()); - RenderingRegistry.registerBlockHandler(new TankRender()); - RenderingRegistry.registerBlockHandler(new SearedRender()); - RenderingRegistry.registerBlockHandler(new FluidRender()); - RenderingRegistry.registerBlockHandler(new GolemCoreRender()); + /* Registers any rendering code. */ + public void registerRenderer () + { + Minecraft mc = Minecraft.getMinecraft(); + smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false); + RenderingRegistry.registerBlockHandler(new TableRender()); + RenderingRegistry.registerBlockHandler(new FrypanRender()); + RenderingRegistry.registerBlockHandler(new SmelteryRender()); + RenderingRegistry.registerBlockHandler(new TankRender()); + RenderingRegistry.registerBlockHandler(new SearedRender()); + RenderingRegistry.registerBlockHandler(new FluidRender()); + RenderingRegistry.registerBlockHandler(new GolemCoreRender()); - //Tools - //MinecraftForgeClient.preloadTexture(TContent.blockTexture); - /*IItemRenderer render = new SuperCustomToolRenderer(); - for (ToolCore tool : TConstructRegistry.tools) - { - MinecraftForgeClient.registerItemRenderer(tool.itemID, render); - }*/ + //Tools + //MinecraftForgeClient.preloadTexture(TContent.blockTexture); + /*IItemRenderer render = new SuperCustomToolRenderer(); + for (ToolCore tool : TConstructRegistry.tools) + { + MinecraftForgeClient.registerItemRenderer(tool.itemID, render); + }*/ - //Special Renderers - ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); - ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, new GolemCoreSpecialRender()); + //Special Renderers + ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); + ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, new GolemCoreSpecialRender()); - //Entities - RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender()); - RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new SkylaRender()); - RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); - RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender()); - RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper()); - RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); - RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new ThrownItemRender(Item.potion, 16384)); - //RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo! + //Entities + RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender()); + RenderingRegistry.registerEntityRenderingHandler(Skyla.class, new SkylaRender()); + RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); + RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender()); + RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper()); + RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new ThrownItemRender(Item.potion, 16384)); + //RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo! - addRenderMappings(); - } + addRenderMappings(); + } - /* Ties an internal name to a visible one. */ - public void addNames () - { + /* Ties an internal name to a visible one. */ + public void addNames () + { - String langDir = "/mods/tinker/resources/lang/"; - String[] langFiles = { "en_US.xml" }; + String langDir = "/mods/tinker/resources/lang/"; + String[] langFiles = { "en_US.xml" }; - for (String langFile : langFiles) - { - try - { - LanguageRegistry.instance().loadLocalization(langDir + langFile, langFile.substring(langFile.lastIndexOf('/') + 1, langFile.lastIndexOf('.')), true); - } - catch (Exception e) - { - e.printStackTrace(); - } - } + for (String langFile : langFiles) + { + try + { + LanguageRegistry.instance().loadLocalization(langDir + langFile, langFile.substring(langFile.lastIndexOf('/') + 1, langFile.lastIndexOf('.')), true); + } + catch (Exception e) + { + e.printStackTrace(); + } + } - for (int mat = 0; mat < materialTypes.length; mat++) - { - for (int type = 0; type < toolMaterialNames.length; type++) - { - String internalName = new StringBuilder().append("item.tconstruct.").append(materialTypes[mat]).append(".").append(toolMaterialNames[type]).append(".name").toString(); - String visibleName = new StringBuilder().append(toolMaterialNames[type]).append(materialNames[mat]).toString(); - LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - } - } + for (int mat = 0; mat < materialTypes.length; mat++) + { + for (int type = 0; type < toolMaterialNames.length; type++) + { + String internalName = new StringBuilder().append("item.tconstruct.").append(materialTypes[mat]).append(".").append(toolMaterialNames[type]).append(".name").toString(); + String visibleName = new StringBuilder().append(toolMaterialNames[type]).append(materialNames[mat]).toString(); + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + } + } - for (int i = 0; i < shardNames.length; i++) - { - String internalName = "item.tconstruct.ToolShard." + toolMaterialNames[i] + ".name"; - String visibleName = shardNames[i]; - LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - } + for (int i = 0; i < shardNames.length; i++) + { + String internalName = "item.tconstruct.ToolShard." + toolMaterialNames[i] + ".name"; + String visibleName = shardNames[i]; + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + } - for (int i = 0; i < materialItemNames.length; i++) - { - String internalName = "item.tconstruct.Materials." + materialItemInternalNames[i] + ".name"; - String visibleName = materialItemNames[i]; - LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - } + for (int i = 0; i < materialItemNames.length; i++) + { + String internalName = "item.tconstruct.Materials." + materialItemInternalNames[i] + ".name"; + String visibleName = materialItemNames[i]; + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + } - for (int i = 0; i < patterns.length; i++) - { - String internalName = "item.tconstruct.Pattern." + patterns[i] + ".name"; - String visibleName = patternNames[i] + " Pattern"; - LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - internalName = "item.tconstruct.MetalPattern." + patterns[i] + ".name"; - visibleName = patternNames[i] + " Cast"; - LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); - } + for (int i = 0; i < patterns.length; i++) + { + String internalName = "item.tconstruct.Pattern." + patterns[i] + ".name"; + String visibleName = patternNames[i] + " Pattern"; + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + internalName = "item.tconstruct.MetalPattern." + patterns[i] + ".name"; + visibleName = patternNames[i] + " Cast"; + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + } - //LanguageRegistry.addName(TContent.manualBook, "Tinker's Log"); + //LanguageRegistry.addName(TContent.manualBook, "Tinker's Log"); - //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Nitro Creeper"); - //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.EdibleSlime.name", "en_US", "Blue Slime"); - //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.MetalSlime.name", "en_US", "Metal Slime"); - //LanguageRegistry.instance().addStringLocalization("item.tconstruct.diary.diary.name", "en_US", "Tinker's Log"); - LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_pattern.name", "en_US", "Blank Pattern"); - LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_cast.name", "en_US", "Blank Cast"); - //LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern"); - LanguageRegistry.addName(TContent.pickaxe, "Pickaxe"); - LanguageRegistry.addName(TContent.shovel, "Shovel"); - LanguageRegistry.addName(TContent.axe, "Axe"); - LanguageRegistry.addName(TContent.broadsword, "Broadsword"); - LanguageRegistry.addName(TContent.longsword, "Longsword"); - LanguageRegistry.addName(TContent.rapier, "Rapier"); - LanguageRegistry.addName(TContent.frypan, "Frying Pan"); - LanguageRegistry.addName(TContent.battlesign, "Battlesign"); - LanguageRegistry.addName(TContent.mattock, "Mattock"); - LanguageRegistry.addName(TContent.potionLauncher, "Potion Launcher"); - //LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe"); + //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Nitro Creeper"); + //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.EdibleSlime.name", "en_US", "Blue Slime"); + //LanguageRegistry.instance().addStringLocalization("entity.TConstruct.MetalSlime.name", "en_US", "Metal Slime"); + //LanguageRegistry.instance().addStringLocalization("item.tconstruct.diary.diary.name", "en_US", "Tinker's Log"); + LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_pattern.name", "en_US", "Blank Pattern"); + LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_cast.name", "en_US", "Blank Cast"); + //LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern"); + LanguageRegistry.addName(TContent.pickaxe, "Pickaxe"); + LanguageRegistry.addName(TContent.shovel, "Shovel"); + LanguageRegistry.addName(TContent.axe, "Axe"); + LanguageRegistry.addName(TContent.broadsword, "Broadsword"); + LanguageRegistry.addName(TContent.longsword, "Longsword"); + LanguageRegistry.addName(TContent.rapier, "Rapier"); + LanguageRegistry.addName(TContent.frypan, "Frying Pan"); + LanguageRegistry.addName(TContent.battlesign, "Battlesign"); + LanguageRegistry.addName(TContent.mattock, "Mattock"); + LanguageRegistry.addName(TContent.potionLauncher, "Potion Launcher"); + //LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe"); - addToolButtons(); - } + addToolButtons(); + } - public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", - "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk", "Slime Crystal Fragment" }; + public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", + "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk", "Slime Crystal Fragment" }; - public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", - "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot" }; + public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", + "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot" }; - public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", - "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot", "Slime Crystal", "Obsidian Ingot" }; + public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", + "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot", "Slime Crystal", "Obsidian Ingot" }; - public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", - "Copper", "Bronze", "Alumite", "Steel", "Blue Slime" }; + public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", + "Copper", "Bronze", "Alumite", "Steel", "Blue Slime" }; - public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", - "SignHead", "LumberHead" }; + public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", + "SignHead", "LumberHead" }; - public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", - " Board", " Broad Axe Head" }; + public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", + " Board", " Broad Axe Head" }; - public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" }; + public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" }; - public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding", - "Pan", "Board", "Broad Axe Head" }; + public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding", + "Pan", "Board", "Broad Axe Head" }; - public static Document diary; - public static Document volume1; + public static Document diary; + public static Document volume1; public static Document volume2; - public static Document smelter; + public static Document smelter; - public void readManuals () - { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - diary = readManual("/mods/tinker/resources/manuals/diary.xml", dbFactory); - volume1 = readManual("/mods/tinker/resources/manuals/firstday.xml", dbFactory); + public void readManuals () + { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + diary = readManual("/mods/tinker/resources/manuals/diary.xml", dbFactory); + volume1 = readManual("/mods/tinker/resources/manuals/firstday.xml", dbFactory); volume2 = readManual("/mods/tinker/resources/manuals/materials.xml", dbFactory); - smelter = readManual("/mods/tinker/resources/manuals/smeltery.xml", dbFactory); - initManualIcons(); - initManualRecipes(); - } + smelter = readManual("/mods/tinker/resources/manuals/smeltery.xml", dbFactory); + initManualIcons(); + initManualRecipes(); + } - Document readManual (String location, DocumentBuilderFactory dbFactory) - { - try - { - InputStream stream = TConstruct.class.getResourceAsStream(location); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(stream); - doc.getDocumentElement().normalize(); - return doc; - } - catch (Exception e) - { - e.printStackTrace(); - return null; - } - } - - public void initManualIcons() - { - TConstructClientRegistry.registerManualIcon("smelterybook", new ItemStack(TContent.manualBook, 1, 2)); - TConstructClientRegistry.registerManualIcon("smeltery", new ItemStack(TContent.smeltery)); - TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1)); - TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock)); - TConstructClientRegistry.registerManualIcon("liquidiron", new ItemStack(TContent.liquidMetalStill)); - TConstructClientRegistry.registerManualIcon("lavatank", new ItemStack(TContent.lavaTank)); - TConstructClientRegistry.registerManualIcon("searedbrick", new ItemStack(TContent.smeltery, 1, 2)); - TConstructClientRegistry.registerManualIcon("drain", new ItemStack(TContent.smeltery, 1, 1)); - TConstructClientRegistry.registerManualIcon("faucet", new ItemStack(TContent.searedBlock, 1, 1)); - TConstructClientRegistry.registerManualIcon("bronzeingot", new ItemStack(TContent.materials, 1, 13)); - TConstructClientRegistry.registerManualIcon("alubrassingot", new ItemStack(TContent.materials, 1, 14)); - TConstructClientRegistry.registerManualIcon("manyullyningot", new ItemStack(TContent.materials, 1, 5)); - TConstructClientRegistry.registerManualIcon("alumiteingot", new ItemStack(TContent.materials, 1, 15)); + Document readManual (String location, DocumentBuilderFactory dbFactory) + { + try + { + InputStream stream = TConstruct.class.getResourceAsStream(location); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(stream); + doc.getDocumentElement().normalize(); + return doc; + } + catch (Exception e) + { + e.printStackTrace(); + return null; + } + } + + public void initManualIcons () + { + TConstructClientRegistry.registerManualIcon("smelterybook", new ItemStack(TContent.manualBook, 1, 2)); + TConstructClientRegistry.registerManualIcon("smeltery", new ItemStack(TContent.smeltery)); + TConstructClientRegistry.registerManualIcon("blankcast", new ItemStack(TContent.blankPattern, 1, 1)); + TConstructClientRegistry.registerManualIcon("castingtable", new ItemStack(TContent.searedBlock)); + TConstructClientRegistry.registerManualIcon("liquidiron", new ItemStack(TContent.liquidMetalStill)); + TConstructClientRegistry.registerManualIcon("lavatank", new ItemStack(TContent.lavaTank)); + TConstructClientRegistry.registerManualIcon("searedbrick", new ItemStack(TContent.smeltery, 1, 2)); + TConstructClientRegistry.registerManualIcon("drain", new ItemStack(TContent.smeltery, 1, 1)); + TConstructClientRegistry.registerManualIcon("faucet", new ItemStack(TContent.searedBlock, 1, 1)); + TConstructClientRegistry.registerManualIcon("bronzeingot", new ItemStack(TContent.materials, 1, 13)); + TConstructClientRegistry.registerManualIcon("alubrassingot", new ItemStack(TContent.materials, 1, 14)); + TConstructClientRegistry.registerManualIcon("manyullyningot", new ItemStack(TContent.materials, 1, 5)); + TConstructClientRegistry.registerManualIcon("alumiteingot", new ItemStack(TContent.materials, 1, 15)); TConstructClientRegistry.registerManualIcon("blankpattern", new ItemStack(TContent.blankPattern, 1, 0)); TConstructClientRegistry.registerManualIcon("toolstation", new ItemStack(TContent.toolStationWood, 1, 0)); TConstructClientRegistry.registerManualIcon("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1)); @@ -274,10 +285,11 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualIcon("sapling", new ItemStack(Block.sapling)); TConstructClientRegistry.registerManualIcon("workbench", new ItemStack(Block.workbench)); TConstructClientRegistry.registerManualIcon("coal", new ItemStack(Item.coal)); - + TConstructClientRegistry.registerManualIcon("obsidianingot", new ItemStack(TContent.materials, 1, 18)); TConstructClientRegistry.registerManualIcon("lavacrystal", new ItemStack(TContent.materials, 1, 7)); - + + //Tool Materials TConstructClientRegistry.registerManualIcon("woodplanks", new ItemStack(Block.planks)); TConstructClientRegistry.registerManualIcon("stoneblock", new ItemStack(Block.stone)); TConstructClientRegistry.registerManualIcon("ironingot", new ItemStack(Item.ingotIron)); @@ -293,26 +305,62 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4)); TConstructClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9)); TConstructClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16)); - } - - public void initManualRecipes() - { + + //Tool parts + TConstructClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("shovelhead", new ItemStack(TContent.shovelHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.axeHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("swordblade", new ItemStack(TContent.swordBlade, 1, 2)); + TConstructClientRegistry.registerManualIcon("pan", new ItemStack(TContent.frypanHead, 1, 2)); + TConstructClientRegistry.registerManualIcon("board", new ItemStack(TContent.signHead, 1, 2)); + + TConstructClientRegistry.registerManualIcon("toolrod", new ItemStack(Item.stick)); + + TConstructClientRegistry.registerManualIcon("binding", new ItemStack(TContent.binding, 1, 4)); + TConstructClientRegistry.registerManualIcon("wideguard", new ItemStack(TContent.wideGuard, 1, 4)); + TConstructClientRegistry.registerManualIcon("handguard", new ItemStack(TContent.handGuard, 1, 4)); + TConstructClientRegistry.registerManualIcon("crossbar", new ItemStack(TContent.crossbar, 1, 4)); + + //ToolIcons + TConstructClientRegistry.registerManualIcon("pickicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("shovelicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.shovelHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("axeicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.axeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("mattockicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.axeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("swordicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.wideGuard, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("longswordicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.handGuard, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("rapiericon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), "")); + TConstructClientRegistry.registerManualIcon("frypanicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.frypanHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + TConstructClientRegistry.registerManualIcon("battlesignicon", + ToolBuilder.instance.buildTool(new ItemStack(TContent.signHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, "")); + } + + public void initManualRecipes () + { ItemStack pattern = new ItemStack(TContent.blankPattern, 1, 0); - - ItemStack stick = new ItemStack(Item.stick, 1, 0); + + ItemStack stick = new ItemStack(Item.stick, 1, 0); ItemStack plank = new ItemStack(Block.planks, 1, 0); ItemStack workbench = new ItemStack(Block.workbench, 1, 0); ItemStack chest = new ItemStack(Block.chest, 1, 0); ItemStack log = new ItemStack(Block.wood, 1, 0); - + ItemStack sand = new ItemStack(Block.sand, 1, 0); ItemStack gravel = new ItemStack(Block.gravel, 1, 0); ItemStack clay = new ItemStack(Item.clay, 1, 0); ItemStack glass = new ItemStack(Block.glass, 1, 0); - + ItemStack grout = new ItemStack(TContent.craftedSoil, 2, 1); ItemStack searedbrick = new ItemStack(TContent.materials, 1, 2); - + + //TConstruct recipes TConstructClientRegistry.registerManualSmallRecipe("blankpattern", pattern, plank, stick, stick, plank); TConstructClientRegistry.registerManualSmallRecipe("toolstation", new ItemStack(TContent.toolStationWood, 1, 0), null, pattern, null, workbench); TConstructClientRegistry.registerManualSmallRecipe("partcrafter", new ItemStack(TContent.toolStationWood, 1, 1), null, pattern, null, plank); @@ -322,168 +370,175 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay); TConstructClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout); TConstructClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, + searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, + searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick, searedbrick, searedbrick, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass, searedbrick); - TConstructClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick, glass, searedbrick); - - TConstructClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, searedbrick, null, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick, + searedbrick, searedbrick, searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass, + searedbrick); + TConstructClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick, + glass, searedbrick); + + TConstructClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick, + searedbrick, null, searedbrick); TConstructClientRegistry.registerManualLargeRecipe("smelteryfaucet", new ItemStack(TContent.searedBlock, 1, 1), searedbrick, null, searedbrick, null, searedbrick, null, null, null, null); - } + } - public static Document getManualFromStack (ItemStack stack) - { - switch (stack.getItemDamage()) - { - case 0: - return volume1; - case 1: - return volume2; - case 2: - return smelter; + public static Document getManualFromStack (ItemStack stack) + { + switch (stack.getItemDamage()) + { + case 0: + return volume1; + case 1: + return volume2; + case 2: + return smelter; case 3: return diary; - } + } - return null; - } + return null; + } - @Override - public File getLocation () - { - return Minecraft.getMinecraftDir(); - } + @Override + public File getLocation () + { + return Minecraft.getMinecraftDir(); + } - static int[][] slotTypes = { new int[] { 0, 3, 0 }, //Repair - new int[] { 1, 4, 0 }, //Pickaxe - new int[] { 2, 5, 0 }, //Shovel - new int[] { 2, 6, 0 }, //Axe - //new int[] {2, 9, 0}, //Lumber Axe - //new int[] {1, 7, 0}, //Ice Axe - new int[] { 3, 8, 0 }, //Mattock - new int[] { 1, 0, 1 }, //Broadsword - new int[] { 1, 1, 1 }, //Longsword - new int[] { 1, 2, 1 }, //Rapier - new int[] { 2, 3, 1 }, //Frying pan - new int[] { 2, 4, 1 } //Battlesign - }; + static int[][] slotTypes = { new int[] { 0, 3, 0 }, //Repair + new int[] { 1, 4, 0 }, //Pickaxe + new int[] { 2, 5, 0 }, //Shovel + new int[] { 2, 6, 0 }, //Axe + //new int[] {2, 9, 0}, //Lumber Axe + //new int[] {1, 7, 0}, //Ice Axe + new int[] { 3, 8, 0 }, //Mattock + new int[] { 1, 0, 1 }, //Broadsword + new int[] { 1, 1, 1 }, //Longsword + new int[] { 1, 2, 1 }, //Rapier + new int[] { 2, 3, 1 }, //Frying pan + new int[] { 2, 4, 1 } //Battlesign + }; - static int[][] iconCoords = { new int[] { 0, 1, 2 }, new int[] { 13, 13, 13 }, //Repair - new int[] { 0, 0, 1 }, new int[] { 2, 3, 3 }, //Pickaxe - new int[] { 3, 0, 13 }, new int[] { 2, 3, 13 }, //Shovel - new int[] { 2, 0, 13 }, new int[] { 2, 3, 13 }, //Axe - //new int[] { 6, 0, 13 }, new int[] { 2, 3, 13 }, //Lumber Axe - //new int[] { 0, 0, 5 }, new int[] { 2, 3, 3 }, //Ice Axe - new int[] { 2, 0, 3 }, new int[] { 2, 3, 2 }, //Mattock - new int[] { 1, 0, 2 }, new int[] { 2, 3, 3 }, //Broadsword - new int[] { 1, 0, 3 }, new int[] { 2, 3, 3 }, //Longsword - new int[] { 1, 0, 4 }, new int[] { 2, 3, 3 }, //Rapier - new int[] { 4, 0, 13 }, new int[] { 2, 3, 13 }, //Frying Pan - new int[] { 5, 0, 13 }, new int[] { 2, 3, 13 } //Battlesign - }; + static int[][] iconCoords = { new int[] { 0, 1, 2 }, new int[] { 13, 13, 13 }, //Repair + new int[] { 0, 0, 1 }, new int[] { 2, 3, 3 }, //Pickaxe + new int[] { 3, 0, 13 }, new int[] { 2, 3, 13 }, //Shovel + new int[] { 2, 0, 13 }, new int[] { 2, 3, 13 }, //Axe + //new int[] { 6, 0, 13 }, new int[] { 2, 3, 13 }, //Lumber Axe + //new int[] { 0, 0, 5 }, new int[] { 2, 3, 3 }, //Ice Axe + new int[] { 2, 0, 3 }, new int[] { 2, 3, 2 }, //Mattock + new int[] { 1, 0, 2 }, new int[] { 2, 3, 3 }, //Broadsword + new int[] { 1, 0, 3 }, new int[] { 2, 3, 3 }, //Longsword + new int[] { 1, 0, 4 }, new int[] { 2, 3, 3 }, //Rapier + new int[] { 4, 0, 13 }, new int[] { 2, 3, 13 }, //Frying Pan + new int[] { 5, 0, 13 }, new int[] { 2, 3, 13 } //Battlesign + }; - static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Axe", - //"Lumber Axe", - //"Ice Axe", - "Mattock", "Broadsword", "Longsword", "Rapier", "Frying Pan", "Battlesign" }; + static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Axe", + //"Lumber Axe", + //"Ice Axe", + "Mattock", "Broadsword", "Longsword", "Rapier", "Frying Pan", "Battlesign" }; - static String[] toolDescriptions = { - "The main way to repair or change your tools. Place a tool and a material on the left to get started.", - "The Pickaxe is a basic mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", - "The Shovel is a basic digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", - "The Axe is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", - //"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", - //"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", - "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", - "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", - "The Longsword is a balanced weapon. It is useful for knocking enemies away or getting in and out of battle quickly.\n\nNatural Ability:\n- Charge Boost\nDamage: Moderate\nDurability: Moderate\n\nRequired parts:\n- Sword Blade\n- Hand Guard\n- Handle", - "The Rapier is an offensive weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nDamage: High\nDurability: Low\n\nRequired parts:\n- Sword Blade\n- Crossbar\n- Handle", - "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Bash\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", - //"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle" - "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle" }; + static String[] toolDescriptions = { + "The main way to repair or change your tools. Place a tool and a material on the left to get started.", + "The Pickaxe is a basic mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", + "The Shovel is a basic digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", + "The Axe is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", + //"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", + //"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", + "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", + "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", + "The Longsword is an offensive weapon. It is often used for charging into battle at full speed.\n\nNatural Ability:\n- Charge Boost\nSpecial Ability: Lunge\n\nDamage: Moderate\nDurability: Moderate", + "The Rapier is a special weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nSpecial Ability:\n- Backpedal\n\nDamage: High\nDurability: Low", + "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Heavy\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", + //"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle" + "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle" }; - void addToolButtons () - { - for (int i = 0; i < toolNames.length; i++) - { - addToolButton(slotTypes[i][0], slotTypes[i][1], slotTypes[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]); - } - } + void addToolButtons () + { + for (int i = 0; i < toolNames.length; i++) + { + addToolButton(slotTypes[i][0], slotTypes[i][1], slotTypes[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]); + } + } - void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) - { - TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body)); - } + void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body) + { + TConstructClientRegistry.addToolButton(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body)); + } - void addRenderMappings () - { - String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", "blueslime" }; - String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz" }; - for (int partIter = 0; partIter < partTypes.length; partIter++) - { - TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); - } - for (int effectIter = 0; effectIter < effectTypes.length; effectIter++) - { - TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true); - } - } + void addRenderMappings () + { + String[] partTypes = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel", + "blueslime" }; + String[] effectTypes = { "diamond", "emerald", "redstone", "glowstone", "moss", "ice", "lava", "blaze", "necrotic", "electric", "lapis", "quartz" }; + for (int partIter = 0; partIter < partTypes.length; partIter++) + { + TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); + } + for (int effectIter = 0; effectIter < effectTypes.length; effectIter++) + { + TConstructClientRegistry.addEffectRenderMapping(effectIter, "tinker", effectTypes[effectIter], true); + } + } - /*void materialRenderMap (int materialID, String partialLocation) - { - for (ToolCore tool : TConstructRegistry.getToolMapping()) - { - tool.partTextures.put(materialID, tool.getToolTextureFile() + partialLocation); - } - } + /*void materialRenderMap (int materialID, String partialLocation) + { + for (ToolCore tool : TConstructRegistry.getToolMapping()) + { + tool.partTextures.put(materialID, tool.getToolTextureFile() + partialLocation); + } + } - void effectRenderMap (int materialID, String partialLocation) - { - for (ToolCore tool : TConstructRegistry.getToolMapping()) - { - tool.effectTextures.put(materialID, tool.getToolTextureFile() + partialLocation); - } - }*/ + void effectRenderMap (int materialID, String partialLocation) + { + for (ToolCore tool : TConstructRegistry.getToolMapping()) + { + tool.effectTextures.put(materialID, tool.getToolTextureFile() + partialLocation); + } + }*/ - /* Keybindings */ - public static TControls controlInstance; + /* Keybindings */ + public static TControls controlInstance; - public void registerKeys () - { - controlInstance = new TControls(); - TickRegistry.registerTickHandler(controlInstance, Side.CLIENT); - uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance); - } + public void registerKeys () + { + controlInstance = new TControls(); + TickRegistry.registerTickHandler(controlInstance, Side.CLIENT); + uploadKeyBindingsToGame(Minecraft.getMinecraft().gameSettings, controlInstance); + } - public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler) - { - ArrayList harvestedBindings = Lists.newArrayList(); - for (KeyBinding kb : keyhandler.keyBindings) - { - harvestedBindings.add(kb); - } + public void uploadKeyBindingsToGame (GameSettings settings, TKeyHandler keyhandler) + { + ArrayList harvestedBindings = Lists.newArrayList(); + for (KeyBinding kb : keyhandler.keyBindings) + { + harvestedBindings.add(kb); + } - KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]); - KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length]; - System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length); - System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length); - settings.keyBindings = allKeys; - settings.loadOptions(); - } + KeyBinding[] modKeyBindings = harvestedBindings.toArray(new KeyBinding[harvestedBindings.size()]); + KeyBinding[] allKeys = new KeyBinding[settings.keyBindings.length + modKeyBindings.length]; + System.arraycopy(settings.keyBindings, 0, allKeys, 0, settings.keyBindings.length); + System.arraycopy(modKeyBindings, 0, allKeys, settings.keyBindings.length, modKeyBindings.length); + settings.keyBindings = allKeys; + settings.loadOptions(); + } - public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) - { - this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ); - } + public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) + { + this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ); + } - public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) - { - if (this.mc == null) - this.mc = Minecraft.getMinecraft(); + public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) + { + if (this.mc == null) + this.mc = Minecraft.getMinecraft(); - if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) + if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { int i = this.mc.gameSettings.particleSetting; @@ -512,7 +567,7 @@ public class TProxyClient extends TProxyCommon if (entityfx != null) { - return (EntityFX)entityfx; + return (EntityFX) entityfx; } else { @@ -555,13 +610,13 @@ public class TProxyClient extends TProxyCommon else if (par1Str.equals("mobSpell")) { entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); - ((EntityFX)entityfx).setRBGColorF((float)par8, (float)par10, (float)par12); + ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); } else if (par1Str.equals("mobSpellAmbient")) { entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); - ((EntityFX)entityfx).setAlphaF(0.15F); - ((EntityFX)entityfx).setRBGColorF((float)par8, (float)par10, (float)par12); + ((EntityFX) entityfx).setAlphaF(0.15F); + ((EntityFX) entityfx).setRBGColorF((float) par8, (float) par10, (float) par12); } else if (par1Str.equals("spell")) { @@ -570,14 +625,14 @@ public class TProxyClient extends TProxyCommon else if (par1Str.equals("instantSpell")) { entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); } else if (par1Str.equals("witchMagic")) { entityfx = new EntitySpellParticleFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntitySpellParticleFX)entityfx).setBaseSpellTextureIndex(144); + ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144); float f = mc.theWorld.rand.nextFloat() * 0.5F + 0.35F; - ((EntityFX)entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); + ((EntityFX) entityfx).setRBGColorF(1.0F * f, 0.0F * f, 1.0F * f); } else if (par1Str.equals("note")) { @@ -621,7 +676,7 @@ public class TProxyClient extends TProxyCommon } else if (par1Str.equals("reddust")) { - entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float)par8, (float)par10, (float)par12); + entityfx = new EntityReddustFX(mc.theWorld, par2, par4, par6, (float) par8, (float) par10, (float) par12); } else if (par1Str.equals("snowballpoof")) { @@ -650,14 +705,14 @@ public class TProxyClient extends TProxyCommon else if (par1Str.equals("angryVillager")) { entityfx = new EntityHeartFX(mc.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12); - ((EntityFX)entityfx).setParticleTextureIndex(81); - ((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + ((EntityFX) entityfx).setParticleTextureIndex(81); + ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); } else if (par1Str.equals("happyVillager")) { entityfx = new EntityAuraFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntityFX)entityfx).setParticleTextureIndex(82); - ((EntityFX)entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); + ((EntityFX) entityfx).setParticleTextureIndex(82); + ((EntityFX) entityfx).setRBGColorF(1.0F, 1.0F, 1.0F); } else if (par1Str.startsWith("iconcrack_")) { @@ -674,10 +729,10 @@ public class TProxyClient extends TProxyCommon if (entityfx != null) { - this.mc.effectRenderer.addEffect((EntityFX)entityfx); + this.mc.effectRenderer.addEffect((EntityFX) entityfx); } - return (EntityFX)entityfx; + return (EntityFX) entityfx; } } } @@ -685,5 +740,5 @@ public class TProxyClient extends TProxyCommon { return null; } - } + } } diff --git a/mods/tinker/tconstruct/client/AxleRender.java b/mods/tinker/tconstruct/client/blockrender/AxleRender.java similarity index 98% rename from mods/tinker/tconstruct/client/AxleRender.java rename to mods/tinker/tconstruct/client/blockrender/AxleRender.java index c9c8b5ec..fa1f633d 100644 --- a/mods/tinker/tconstruct/client/AxleRender.java +++ b/mods/tinker/tconstruct/client/blockrender/AxleRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/mods/tinker/tconstruct/client/BreakingFX.java b/mods/tinker/tconstruct/client/blockrender/BreakingFX.java similarity index 98% rename from mods/tinker/tconstruct/client/BreakingFX.java rename to mods/tinker/tconstruct/client/blockrender/BreakingFX.java index 1ee40bc4..50edd950 100644 --- a/mods/tinker/tconstruct/client/BreakingFX.java +++ b/mods/tinker/tconstruct/client/blockrender/BreakingFX.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import net.minecraft.block.Block; import net.minecraft.client.particle.EntityFX; diff --git a/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java b/mods/tinker/tconstruct/client/blockrender/CastingTableSpecialRenderer.java similarity index 97% rename from mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java rename to mods/tinker/tconstruct/client/blockrender/CastingTableSpecialRenderer.java index abb3fd26..bd14513f 100644 --- a/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java +++ b/mods/tinker/tconstruct/client/blockrender/CastingTableSpecialRenderer.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.common.fancyitem.FancyEntityItem; import mods.tinker.tconstruct.logic.CastingTableLogic; diff --git a/mods/tinker/tconstruct/client/FluidRender.java b/mods/tinker/tconstruct/client/blockrender/FluidRender.java similarity index 99% rename from mods/tinker/tconstruct/client/FluidRender.java rename to mods/tinker/tconstruct/client/blockrender/FluidRender.java index 22982ecf..e20cd2fd 100644 --- a/mods/tinker/tconstruct/client/FluidRender.java +++ b/mods/tinker/tconstruct/client/blockrender/FluidRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.tconstruct.blocks.LiquidMetalBase; import net.minecraft.block.Block; diff --git a/mods/tinker/tconstruct/client/FrypanRender.java b/mods/tinker/tconstruct/client/blockrender/FrypanRender.java similarity index 96% rename from mods/tinker/tconstruct/client/FrypanRender.java rename to mods/tinker/tconstruct/client/blockrender/FrypanRender.java index 7ab41162..3b0de4a4 100644 --- a/mods/tinker/tconstruct/client/FrypanRender.java +++ b/mods/tinker/tconstruct/client/blockrender/FrypanRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/mods/tinker/tconstruct/client/GolemCoreRender.java b/mods/tinker/tconstruct/client/blockrender/GolemCoreRender.java similarity index 99% rename from mods/tinker/tconstruct/client/GolemCoreRender.java rename to mods/tinker/tconstruct/client/blockrender/GolemCoreRender.java index 9275c45f..c7bd70ee 100644 --- a/mods/tinker/tconstruct/client/GolemCoreRender.java +++ b/mods/tinker/tconstruct/client/blockrender/GolemCoreRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import org.lwjgl.opengl.GL11; diff --git a/mods/tinker/tconstruct/client/GolemCoreSpecialRender.java b/mods/tinker/tconstruct/client/blockrender/GolemCoreSpecialRender.java similarity index 97% rename from mods/tinker/tconstruct/client/GolemCoreSpecialRender.java rename to mods/tinker/tconstruct/client/blockrender/GolemCoreSpecialRender.java index 24c58806..7a59b0f2 100644 --- a/mods/tinker/tconstruct/client/GolemCoreSpecialRender.java +++ b/mods/tinker/tconstruct/client/blockrender/GolemCoreSpecialRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.common.fancyitem.FancyEntityItem; import mods.tinker.tconstruct.logic.GolemCoreLogic; diff --git a/mods/tinker/tconstruct/client/SearedRender.java b/mods/tinker/tconstruct/client/blockrender/SearedRender.java similarity index 99% rename from mods/tinker/tconstruct/client/SearedRender.java rename to mods/tinker/tconstruct/client/blockrender/SearedRender.java index e4a192f2..68dcf856 100644 --- a/mods/tinker/tconstruct/client/SearedRender.java +++ b/mods/tinker/tconstruct/client/blockrender/SearedRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.common.BlockSkinRenderHelper; import mods.tinker.tconstruct.TContent; diff --git a/mods/tinker/tconstruct/client/SmallFontRenderer.java b/mods/tinker/tconstruct/client/blockrender/SmallFontRenderer.java similarity index 99% rename from mods/tinker/tconstruct/client/SmallFontRenderer.java rename to mods/tinker/tconstruct/client/blockrender/SmallFontRenderer.java index 72b787d1..f136c0d5 100644 --- a/mods/tinker/tconstruct/client/SmallFontRenderer.java +++ b/mods/tinker/tconstruct/client/blockrender/SmallFontRenderer.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import java.awt.image.BufferedImage; import java.io.IOException; diff --git a/mods/tinker/tconstruct/client/SmelteryRender.java b/mods/tinker/tconstruct/client/blockrender/SmelteryRender.java similarity index 99% rename from mods/tinker/tconstruct/client/SmelteryRender.java rename to mods/tinker/tconstruct/client/blockrender/SmelteryRender.java index 69280d41..91af6092 100644 --- a/mods/tinker/tconstruct/client/SmelteryRender.java +++ b/mods/tinker/tconstruct/client/blockrender/SmelteryRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.common.BlockSkinRenderHelper; import mods.tinker.tconstruct.crafting.Smeltery; diff --git a/mods/tinker/tconstruct/client/TableRender.java b/mods/tinker/tconstruct/client/blockrender/TableRender.java similarity index 98% rename from mods/tinker/tconstruct/client/TableRender.java rename to mods/tinker/tconstruct/client/blockrender/TableRender.java index 950a4bda..b6ef5d7c 100644 --- a/mods/tinker/tconstruct/client/TableRender.java +++ b/mods/tinker/tconstruct/client/blockrender/TableRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/mods/tinker/tconstruct/client/TankRender.java b/mods/tinker/tconstruct/client/blockrender/TankRender.java similarity index 99% rename from mods/tinker/tconstruct/client/TankRender.java rename to mods/tinker/tconstruct/client/blockrender/TankRender.java index c004be5d..6e39e840 100644 --- a/mods/tinker/tconstruct/client/TankRender.java +++ b/mods/tinker/tconstruct/client/blockrender/TankRender.java @@ -1,4 +1,4 @@ -package mods.tinker.tconstruct.client; +package mods.tinker.tconstruct.client.blockrender; import mods.tinker.common.BlockSkinRenderHelper; import mods.tinker.tconstruct.logic.LavaTankLogic; diff --git a/mods/tinker/tconstruct/client/gui/GuiManual.java b/mods/tinker/tconstruct/client/gui/GuiManual.java index c67b2e1b..2e96db9e 100644 --- a/mods/tinker/tconstruct/client/gui/GuiManual.java +++ b/mods/tinker/tconstruct/client/gui/GuiManual.java @@ -222,6 +222,35 @@ public class GuiManual extends GuiScreen iconsLeft[2] = PatternBuilder.instance.getShardFromSet(materialLeft.name()); iconsLeft[3] = PatternBuilder.instance.getRodFromSet(materialLeft.name()); } + + else if (pageLeftType.equals("toolpage")) + { + NodeList nodes = element.getElementsByTagName("title"); + if (nodes != null) + textLeft = nodes.item(0).getTextContent(); + + nodes = element.getElementsByTagName("item"); + multiTextLeft = new String[nodes.getLength() + 2]; + iconsLeft = new ItemStack[nodes.getLength() + 1]; + + for (int i = 0; i < nodes.getLength(); i++) + { + NodeList children = nodes.item(i).getChildNodes(); + multiTextLeft[i+2] = children.item(1).getTextContent(); + iconsLeft[i+1] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent()); + } + + nodes = element.getElementsByTagName("text"); + if (nodes != null) + { + multiTextLeft[0] = nodes.item(0).getTextContent(); + multiTextLeft[1] = nodes.item(1).getTextContent(); + } + + nodes = element.getElementsByTagName("icon"); + if (nodes != null) + iconsLeft[0] = TConstructClientRegistry.getManualIcon(nodes.item(0).getTextContent()); + } } node = nList.item(currentPage + 1); @@ -334,8 +363,36 @@ public class GuiManual extends GuiScreen iconsRight[1] = TConstructClientRegistry.getManualIcon(nodes.item(1).getTextContent()); iconsRight[2] = PatternBuilder.instance.getShardFromSet(materialRight.name()); - iconsRight[3] = PatternBuilder.instance.getRodFromSet(materialRight.name()); + iconsRight[3] = PatternBuilder.instance.getRodFromSet(materialRight.name()); + } + + else if (pageRightType.equals("toolpage")) + { + NodeList nodes = element.getElementsByTagName("title"); + if (nodes != null) + textRight = nodes.item(0).getTextContent(); + nodes = element.getElementsByTagName("item"); + multiTextRight = new String[nodes.getLength() + 2]; + iconsRight = new ItemStack[nodes.getLength() + 1]; + + for (int i = 0; i < nodes.getLength(); i++) + { + NodeList children = nodes.item(i).getChildNodes(); + multiTextRight[i+2] = children.item(1).getTextContent(); + iconsRight[i+1] = TConstructClientRegistry.getManualIcon(children.item(3).getTextContent()); + } + + nodes = element.getElementsByTagName("text"); + if (nodes != null) + { + multiTextRight[0] = nodes.item(0).getTextContent(); + multiTextRight[1] = nodes.item(1).getTextContent(); + } + + nodes = element.getElementsByTagName("icon"); + if (nodes != null) + iconsRight[0] = TConstructClientRegistry.getManualIcon(nodes.item(0).getTextContent()); } } else @@ -432,7 +489,12 @@ public class GuiManual extends GuiScreen { drawMaterialPage(textLeft, iconsLeft, multiTextLeft, materialLeft, localWidth + 16, localHeight + 12); } + else if (pageLeftType.equals("toolpage")) + { + drawToolPage(textLeft, iconsLeft, multiTextLeft, localWidth + 16, localHeight + 12); + } + //Right if (pageRightType.equals("text")) { if (textRight != null) @@ -470,6 +532,11 @@ public class GuiManual extends GuiScreen { drawMaterialPage(textRight, iconsRight, multiTextRight, materialRight, localWidth + 220, localHeight + 12); } + + else if (pageRightType.equals("toolpage")) + { + drawToolPage(textRight, iconsRight, multiTextRight, localWidth + 220, localHeight + 12); + } } /* Page types */ @@ -594,11 +661,6 @@ public class GuiManual extends GuiScreen renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, TConstructClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2); renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[1], (localWidth + 38) / 2, (localHeight + 38) / 2); - /*for (int i = 0; i < icons.length - 1; i++) - { - if (icons[i + 1] != null) - renderitem.renderItemIntoGUI(fontRenderer, mc.renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2); - }*/ if (icons[0].stackSize > 1) renderitem.renderItemStack(fontRenderer, mc.renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize)); @@ -672,4 +734,25 @@ public class GuiManual extends GuiScreen offset++; } } + + public void drawToolPage (String title, ItemStack[] icons, String[] multiText, int localWidth, int localHeight) + { + this.fontRenderer.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0); + this.fontRenderer.drawSplitString(multiText[0], localWidth, localHeight + 16, 178, 0); + int size = multiText[0].length()/50; + this.fontRenderer.drawSplitString(multiText[1], localWidth, localHeight + 28 + 10*size, 118, 0); + + this.fontRenderer.drawString("Crafting Parts: ", localWidth + 124, localHeight + 28 + 10*size, 0); + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); + renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[0], localWidth + 50, localHeight + 0); + for (int i = 1; i < icons.length; i++) + { + renderitem.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10*size + 18*i); + this.fontRenderer.drawSplitString(multiText[i+1], localWidth + 140, localHeight + 24 + 10*size + 18*i, 42, 0); + } + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } } diff --git a/mods/tinker/tconstruct/client/gui/ToolStationGui.java b/mods/tinker/tconstruct/client/gui/ToolStationGui.java index a7e6a285..ec983287 100644 --- a/mods/tinker/tconstruct/client/gui/ToolStationGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolStationGui.java @@ -29,352 +29,359 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ToolStationGui extends GuiContainer { - ToolStationLogic logic; - ToolStationContainer toolSlots; - GuiTextField text; - String toolName; - int guiType; - int[] slotX, slotY, iconX, iconY; - String title, body = ""; + ToolStationLogic logic; + ToolStationContainer toolSlots; + GuiTextField text; + String toolName; + int guiType; + int[] slotX, slotY, iconX, iconY; + String title, body = ""; - public ToolStationGui(InventoryPlayer inventoryplayer, ToolStationLogic stationlogic, World world, int x, int y, int z) - { - super(stationlogic.getGuiContainer(inventoryplayer, world, x, y, z)); - this.logic = stationlogic; - toolSlots = (ToolStationContainer) inventorySlots; - text = new GuiTextField(this.fontRenderer, this.xSize / 2 - 5, 8, 30, 12); - this.text.setMaxStringLength(40); - this.text.setEnableBackgroundDrawing(false); - this.text.setVisible(true); - this.text.setCanLoseFocus(false); - this.text.setFocused(true); - this.text.setTextColor(0xffffff); - toolName = ""; - resetGui(); - Keyboard.enableRepeatEvents(true); - } + public ToolStationGui(InventoryPlayer inventoryplayer, ToolStationLogic stationlogic, World world, int x, int y, int z) + { + super(stationlogic.getGuiContainer(inventoryplayer, world, x, y, z)); + this.logic = stationlogic; + toolSlots = (ToolStationContainer) inventorySlots; + text = new GuiTextField(this.fontRenderer, this.xSize / 2 - 5, 8, 30, 12); + this.text.setMaxStringLength(40); + this.text.setEnableBackgroundDrawing(false); + this.text.setVisible(true); + this.text.setCanLoseFocus(false); + this.text.setFocused(true); + this.text.setTextColor(0xffffff); + toolName = ""; + resetGui(); + Keyboard.enableRepeatEvents(true); + } - void resetGui () - { - this.text.setText(""); - guiType = 0; - setSlotType(0); - iconX = new int[] { 0, 1, 2 }; - iconY = new int[] { 13, 13, 13 }; - title = "\u00A7nRepair and Modification"; - body = "The main way to repair or change your tools. Place a tool and a material on the left to get started."; - } + void resetGui () + { + this.text.setText(""); + guiType = 0; + setSlotType(0); + iconX = new int[] { 0, 1, 2 }; + iconY = new int[] { 13, 13, 13 }; + title = "\u00A7nRepair and Modification"; + body = "The main way to repair or change your tools. Place a tool and a material on the left to get started."; + } - public void initGui () - { - super.initGui(); - int cornerX = (this.width - this.xSize) / 2; - int cornerY = (this.height - this.ySize) / 2; + public void initGui () + { + super.initGui(); + int cornerX = (this.width - this.xSize) / 2; + int cornerY = (this.height - this.ySize) / 2; - this.buttonList.clear(); - ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0); - GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.texture); // Repair - repairButton.enabled = false; - this.buttonList.add(repairButton); + this.buttonList.clear(); + ToolGuiElement repair = TConstructClientRegistry.toolButtons.get(0); + GuiButtonTool repairButton = new GuiButtonTool(0, cornerX - 110, cornerY, repair.buttonIconX, repair.buttonIconY, repair.texture); // Repair + repairButton.enabled = false; + this.buttonList.add(repairButton); - for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++) - { - ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter); - GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, element.texture); // Repair - this.buttonList.add(button); - } - } + for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++) + { + ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter); + GuiButtonTool button = new GuiButtonTool(iter, cornerX - 110 + 22 * (iter % 5), cornerY + 22 * (iter / 5), element.buttonIconX, element.buttonIconY, element.texture); // Repair + this.buttonList.add(button); + } + } - protected void actionPerformed (GuiButton button) - { - ((GuiButton) this.buttonList.get(guiType)).enabled = true; - guiType = button.id; - button.enabled = false; + protected void actionPerformed (GuiButton button) + { + ((GuiButton) this.buttonList.get(guiType)).enabled = true; + guiType = button.id; + button.enabled = false; - ToolGuiElement element = TConstructClientRegistry.toolButtons.get(guiType); - setSlotType(element.slotType); - iconX = element.iconsX; - iconY = element.iconsY; - title = "\u00A7n" + element.title; - body = element.body; - } + ToolGuiElement element = TConstructClientRegistry.toolButtons.get(guiType); + setSlotType(element.slotType); + iconX = element.iconsX; + iconY = element.iconsY; + title = "\u00A7n" + element.title; + body = element.body; + } - void setSlotType (int type) - { - switch (type) - { - case 0: - slotX = new int[] { 56, 38, 38 }; // Repair - slotY = new int[] { 37, 28, 46 }; - break; - case 1: - slotX = new int[] { 56, 56, 56 }; // Three parts - slotY = new int[] { 19, 55, 37 }; - break; - case 2: - slotX = new int[] { 56, 56, 14 }; // Two parts - slotY = new int[] { 28, 46, 37 }; - break; - case 3: - slotX = new int[] { 38, 47, 56 }; // Double head - slotY = new int[] { 28, 46, 28 }; - break; - case 4: - slotX = new int[] { 47, 47, 38, 56 }; // Four parts - slotY = new int[] { 19, 55, 37, 37 }; - break; - } - toolSlots.resetSlots(slotX, slotY); - } + void setSlotType (int type) + { + switch (type) + { + case 0: + slotX = new int[] { 56, 38, 38 }; // Repair + slotY = new int[] { 37, 28, 46 }; + break; + case 1: + slotX = new int[] { 56, 56, 56 }; // Three parts + slotY = new int[] { 19, 55, 37 }; + break; + case 2: + slotX = new int[] { 56, 56, 14 }; // Two parts + slotY = new int[] { 28, 46, 37 }; + break; + case 3: + slotX = new int[] { 38, 47, 56 }; // Double head + slotY = new int[] { 28, 46, 28 }; + break; + case 4: + slotX = new int[] { 47, 47, 38, 56 }; // Four parts + slotY = new int[] { 19, 55, 37, 37 }; + break; + } + toolSlots.resetSlots(slotX, slotY); + } - public void updateScreen () - { - super.updateScreen(); - this.text.updateCursorCounter(); - } + public void updateScreen () + { + super.updateScreen(); + this.text.updateCursorCounter(); + } - /** - * Draw the foreground layer for the GuiContainer (everything in front of the items) - */ - protected void drawGuiContainerForegroundLayer (int par1, int par2) - { - this.fontRenderer.drawString(StatCollector.translateToLocal("crafters.ToolStation"), 6, 8, 0x000000); - this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 0x000000); - this.fontRenderer.drawString(toolName + "_", this.xSize / 2 - 18, 8, 0xffffff); + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer (int par1, int par2) + { + this.fontRenderer.drawString(StatCollector.translateToLocal("crafters.ToolStation"), 6, 8, 0x000000); + this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 0x000000); + this.fontRenderer.drawString(toolName + "_", this.xSize / 2 - 18, 8, 0xffffff); - if (logic.isStackInSlot(0)) - drawToolStats(); - else - drawToolInformation(); - } + if (logic.isStackInSlot(0)) + drawToolStats(); + else + drawToolInformation(); + } - void drawToolStats () - { - ItemStack stack = logic.getStackInSlot(0); - ToolCore tool = (ToolCore) stack.getItem(); - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - this.drawCenteredString(fontRenderer, "\u00A7n" + tool.getToolName(), xSize + 63, 8, 0xffffff); - if (tool instanceof Weapon) - drawWeaponStats(stack, tool, tags); - else if (tool.getHeadType() == 3) - drawDualStats(stack, tool, tags); - else - drawHarvestStats(stack, tool, tags); - } + void drawToolStats () + { + ItemStack stack = logic.getStackInSlot(0); + ToolCore tool = (ToolCore) stack.getItem(); + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + this.drawCenteredString(fontRenderer, "\u00A7n" + tool.getToolName(), xSize + 63, 8, 0xffffff); + if (tool instanceof Weapon) + drawWeaponStats(stack, tool, tags); + else if (tool.getHeadType() == 3) + drawDualStats(stack, tool, tags); + else + drawHarvestStats(stack, tool, tags); + } - void drawWeaponStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) - { - int dur = tags.getInteger("Damage"); - int maxDur = tags.getInteger("TotalDurability"); - dur = maxDur - dur; - fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); - int attack = tags.getInteger("Attack"); + void drawWeaponStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) + { + int dur = tags.getInteger("Damage"); + int maxDur = tags.getInteger("TotalDurability"); + dur = maxDur - dur; + fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); + int attack = tags.getInteger("Attack"); String heart = attack == 2 ? " Heart" : " Hearts"; if (attack % 2 == 0) - this.fontRenderer.drawString("Attack: " + attack/2 + heart, xSize + 8, 35, 0xffffff); + this.fontRenderer.drawString("Attack: " + attack / 2 + heart, xSize + 8, 35, 0xffffff); else - this.fontRenderer.drawString("Attack: " +attack/2f + heart, xSize + 8, 35, 0xffffff); - //fontRenderer.drawString("Attack: " + damage, xSize + 8, 35, 0xffffff); + this.fontRenderer.drawString("Attack: " + attack / 2f + heart, xSize + 8, 35, 0xffffff); + //fontRenderer.drawString("Attack: " + damage, xSize + 8, 35, 0xffffff); - fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 57, 0xffffff); - if (tags.hasKey("Tooltip1")) - fontRenderer.drawString("Modifiers:", xSize + 8, 68, 0xffffff); + fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 57, 0xffffff); + if (tags.hasKey("Tooltip1")) + fontRenderer.drawString("Modifiers:", xSize + 8, 68, 0xffffff); - boolean displayToolTips = true; - int tipNum = 0; - while (displayToolTips) - { - tipNum++; - String tooltip = "ModifierTip" + tipNum; - if (tags.hasKey(tooltip)) - { - String tipName = tags.getString(tooltip); - fontRenderer.drawString("- " + tipName, xSize + 8, 68 + tipNum * 11, 0xffffff); - } - else - displayToolTips = false; - } - } + boolean displayToolTips = true; + int tipNum = 0; + while (displayToolTips) + { + tipNum++; + String tooltip = "ModifierTip" + tipNum; + if (tags.hasKey(tooltip)) + { + String tipName = tags.getString(tooltip); + fontRenderer.drawString("- " + tipName, xSize + 8, 68 + tipNum * 11, 0xffffff); + } + else + displayToolTips = false; + } + } - void drawHarvestStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) - { - int dur = tags.getInteger("Damage"); - int maxDur = tags.getInteger("TotalDurability"); - dur = maxDur - dur; - fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); - int damage = tags.getInteger("Attack"); - fontRenderer.drawString("Damage: " + damage, xSize + 8, 35, 0xffffff); - float mineSpeed = tags.getInteger("MiningSpeed") / 100f; - fontRenderer.drawString("Mining Speed: " + mineSpeed, xSize + 8, 46, 0xffffff); - fontRenderer.drawString("Mining Level: " + getHarvestLevelName(tags.getInteger("HarvestLevel")), xSize + 8, 57, 0xffffff); + void drawHarvestStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) + { + int dur = tags.getInteger("Damage"); + int maxDur = tags.getInteger("TotalDurability"); + dur = maxDur - dur; + fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); - fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 79, 0xffffff); - if (tags.hasKey("Tooltip1")) - fontRenderer.drawString("Modifiers:", xSize + 8, 90, 0xffffff); + int attack = tags.getInteger("Attack"); + String heart = attack == 2 ? " Heart" : " Hearts"; + if (attack % 2 == 0) + this.fontRenderer.drawString("Attack: " + attack / 2 + heart, xSize + 8, 35, 0xffffff); + else + this.fontRenderer.drawString("Attack: " + attack / 2f + heart, xSize + 8, 35, 0xffffff); + /*int damage = tags.getInteger("Attack"); + fontRenderer.drawString("Damage: " + damage, xSize + 8, 35, 0xffffff);*/ + float mineSpeed = tags.getInteger("MiningSpeed") / 100f; + fontRenderer.drawString("Mining Speed: " + mineSpeed, xSize + 8, 46, 0xffffff); + fontRenderer.drawString("Mining Level: " + getHarvestLevelName(tags.getInteger("HarvestLevel")), xSize + 8, 57, 0xffffff); - boolean displayToolTips = true; - int tipNum = 0; - while (displayToolTips) - { - tipNum++; - String tooltip = "ModifierTip" + tipNum; - if (tags.hasKey(tooltip)) - { - String tipName = tags.getString(tooltip); - fontRenderer.drawString("- " + tipName, xSize + 8, 90 + tipNum * 11, 0xffffff); - } - else - displayToolTips = false; - } - } + fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 79, 0xffffff); + if (tags.hasKey("Tooltip1")) + fontRenderer.drawString("Modifiers:", xSize + 8, 90, 0xffffff); - void drawDualStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) - { - int dur = tags.getInteger("Damage"); - int maxDur = tags.getInteger("TotalDurability"); - dur = maxDur - dur; - fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); - float mineSpeed = tags.getInteger("MiningSpeed") / 100f; - float mineSpeed2 = tags.getInteger("MiningSpeed2") / 100f; - fontRenderer.drawString("Mining Speeds: ", xSize + 8, 35, 0xffffff); - fontRenderer.drawString("- " + mineSpeed + ", " + mineSpeed2, xSize + 8, 46, 0xffffff); - fontRenderer.drawString("Harvest Levels:", xSize + 8, 57, 0xffffff); - fontRenderer.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")), xSize + 8, 68, 0xffffff); - fontRenderer.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, 79, 0xffffff); + boolean displayToolTips = true; + int tipNum = 0; + while (displayToolTips) + { + tipNum++; + String tooltip = "ModifierTip" + tipNum; + if (tags.hasKey(tooltip)) + { + String tipName = tags.getString(tooltip); + fontRenderer.drawString("- " + tipName, xSize + 8, 90 + tipNum * 11, 0xffffff); + } + else + displayToolTips = false; + } + } - fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 90, 0xffffff); - if (tags.hasKey("Tooltip1")) - fontRenderer.drawString("Modifiers:", xSize + 8, 101, 0xffffff); + void drawDualStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) + { + int dur = tags.getInteger("Damage"); + int maxDur = tags.getInteger("TotalDurability"); + dur = maxDur - dur; + fontRenderer.drawString("Durability: " + dur + "/" + maxDur, xSize + 8, 24, 0xffffff); + float mineSpeed = tags.getInteger("MiningSpeed") / 100f; + float mineSpeed2 = tags.getInteger("MiningSpeed2") / 100f; + fontRenderer.drawString("Mining Speeds: ", xSize + 8, 35, 0xffffff); + fontRenderer.drawString("- " + mineSpeed + ", " + mineSpeed2, xSize + 8, 46, 0xffffff); + fontRenderer.drawString("Harvest Levels:", xSize + 8, 57, 0xffffff); + fontRenderer.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")), xSize + 8, 68, 0xffffff); + fontRenderer.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, 79, 0xffffff); - boolean displayToolTips = true; - int tipNum = 0; - while (displayToolTips) - { - tipNum++; - String tooltip = "ModifierTip" + tipNum; - if (tags.hasKey(tooltip)) - { - String tipName = tags.getString(tooltip); - fontRenderer.drawString("- " + tipName, xSize + 8, 101 + tipNum * 11, 0xffffff); - } - else - displayToolTips = false; - } - } + fontRenderer.drawString("Modifiers remaining: " + tags.getInteger("Modifiers"), xSize + 8, 90, 0xffffff); + if (tags.hasKey("Tooltip1")) + fontRenderer.drawString("Modifiers:", xSize + 8, 101, 0xffffff); - void drawToolInformation () - { - this.drawCenteredString(fontRenderer, title, xSize + 63, 8, 0xffffff); - fontRenderer.drawSplitString(body, xSize + 8, 24, 115, 0xffffff); - } + boolean displayToolTips = true; + int tipNum = 0; + while (displayToolTips) + { + tipNum++; + String tooltip = "ModifierTip" + tipNum; + if (tags.hasKey(tooltip)) + { + String tipName = tags.getString(tooltip); + fontRenderer.drawString("- " + tipName, xSize + 8, 101 + tipNum * 11, 0xffffff); + } + else + displayToolTips = false; + } + } - String getHarvestLevelName (int num) - { - switch (num) - { - case 0: - return "Stone"; - case 1: - return "Iron"; - case 2: - return "Redstone"; - case 3: - return "Obsidian"; //Mithril - case 4: - return "Vulcanite"; - case 5: - return "Adamantine"; - default: - return String.valueOf(num); - } - } + void drawToolInformation () + { + this.drawCenteredString(fontRenderer, title, xSize + 63, 8, 0xffffff); + fontRenderer.drawSplitString(body, xSize + 8, 24, 115, 0xffffff); + } - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3) - { - // Draw the background - //int texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/toolstation.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolstation.png"); - int cornerX = (this.width - this.xSize) / 2; - int cornerY = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize); + String getHarvestLevelName (int num) + { + switch (num) + { + case 0: + return "Stone"; + case 1: + return "Iron"; + case 2: + return "Redstone"; + case 3: + return "Obsidian"; //Mithril + case 4: + return "Vulcanite"; + case 5: + return "Adamantine"; + default: + return String.valueOf(num); + } + } - //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/icons.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/icons.png"); - // Draw the slots + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3) + { + // Draw the background + //int texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/toolstation.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolstation.png"); + int cornerX = (this.width - this.xSize) / 2; + int cornerY = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize); - for (int i = 0; i < slotX.length; i++) - { - this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 0, 0, 18, 18); - if (!logic.isStackInSlot(i + 1)) - { - this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 18 * iconX[i], 18 * iconY[i], 18, 18); - } - } + //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/icons.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + //this.mc.renderEngine.bindTexture(texID); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/icons.png"); + // Draw the slots - // Draw description - //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png"); - cornerX = (this.width + this.xSize) / 2; - cornerY = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, this.ySize + 30); - } + for (int i = 0; i < slotX.length; i++) + { + this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 0, 0, 18, 18); + if (!logic.isStackInSlot(i + 1)) + { + this.drawTexturedModalRect(cornerX + slotX[i], cornerY + slotY[i], 18 * iconX[i], 18 * iconY[i], 18, 18); + } + } - protected void keyTyped (char par1, int keyCode) - { - if (keyCode == 1) - { - logic.setToolname(""); - updateServer(""); - Keyboard.enableRepeatEvents(false); - this.mc.thePlayer.closeScreen(); - } - else - { - text.textboxKeyTyped(par1, keyCode); - toolName = text.getText().trim(); - logic.setToolname(toolName); - updateServer(toolName); - } - } + // Draw description + //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + //this.mc.renderEngine.bindTexture(texID); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png"); + cornerX = (this.width + this.xSize) / 2; + cornerY = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, this.ySize + 30); + } - void updateServer (String name) - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(8); - DataOutputStream outputStream = new DataOutputStream(bos); - try - { - outputStream.writeByte(1); - outputStream.writeInt(logic.worldObj.provider.dimensionId); - outputStream.writeInt(logic.xCoord); - outputStream.writeInt(logic.yCoord); - outputStream.writeInt(logic.zCoord); - outputStream.writeUTF(name); - } - catch (Exception ex) - { - ex.printStackTrace(); - } + protected void keyTyped (char par1, int keyCode) + { + if (keyCode == 1) + { + logic.setToolname(""); + updateServer(""); + Keyboard.enableRepeatEvents(false); + this.mc.thePlayer.closeScreen(); + } + else + { + text.textboxKeyTyped(par1, keyCode); + toolName = text.getText().trim(); + logic.setToolname(toolName); + updateServer(toolName); + } + } - Packet250CustomPayload packet = new Packet250CustomPayload(); - packet.channel = "TConstruct"; - packet.data = bos.toByteArray(); - packet.length = bos.size(); - - PacketDispatcher.sendPacketToServer(packet); - } + void updateServer (String name) + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(8); + DataOutputStream outputStream = new DataOutputStream(bos); + try + { + outputStream.writeByte(1); + outputStream.writeInt(logic.worldObj.provider.dimensionId); + outputStream.writeInt(logic.xCoord); + outputStream.writeInt(logic.yCoord); + outputStream.writeInt(logic.zCoord); + outputStream.writeUTF(name); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - /*protected void mouseClicked(int par1, int par2, int par3) - { - super.mouseClicked(par1, par2, par3); - text.mouseClicked(par1, par2, par3); - }*/ + Packet250CustomPayload packet = new Packet250CustomPayload(); + packet.channel = "TConstruct"; + packet.data = bos.toByteArray(); + packet.length = bos.size(); + + PacketDispatcher.sendPacketToServer(packet); + } + + /*protected void mouseClicked(int par1, int par2, int par3) + { + super.mouseClicked(par1, par2, par3); + text.mouseClicked(par1, par2, par3); + }*/ } diff --git a/mods/tinker/tconstruct/container/SlotTool.java b/mods/tinker/tconstruct/container/SlotTool.java index 8778bc53..f223c209 100644 --- a/mods/tinker/tconstruct/container/SlotTool.java +++ b/mods/tinker/tconstruct/container/SlotTool.java @@ -26,6 +26,7 @@ public class SlotTool extends Slot */ public boolean isItemValid(ItemStack stack) { + //return false; return stack.getItem() instanceof ToolCore; } @@ -55,9 +56,10 @@ public class SlotTool extends Slot if (!tags.getCompoundTag("InfiTool").hasKey("Built")) { tags.getCompoundTag("InfiTool").setBoolean("Built", true); + Boolean full = (inventory.getStackInSlot(2) != null || inventory.getStackInSlot(3) != null); for (int i = 1; i <= 3; i++) inventory.decrStackSize(i, 1); - if (!player.worldObj.isRemote) + if (!player.worldObj.isRemote && full ) //player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "crafting.saw", 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0); } diff --git a/mods/tinker/tconstruct/container/SmelteryContainer.java b/mods/tinker/tconstruct/container/SmelteryContainer.java index c2cb89b6..984a175c 100644 --- a/mods/tinker/tconstruct/container/SmelteryContainer.java +++ b/mods/tinker/tconstruct/container/SmelteryContainer.java @@ -53,7 +53,7 @@ public class SmelteryContainer extends ActiveContainer if (invRow != slotRow) { slotRow = invRow; - System.out.println(invRow); + //System.out.println(invRow); int basePos = invRow * 3; for (int iter = 0; iter < activeInventorySlots.size(); iter++) { @@ -169,7 +169,7 @@ public class SmelteryContainer extends ActiveContainer @Override protected boolean mergeItemStack (ItemStack inputStack, int startSlot, int endSlot, boolean flag) { - System.out.println("Merge"); + //System.out.println("Merge"); boolean merged = false; int slotPos = startSlot; diff --git a/mods/tinker/tconstruct/container/ToolStationContainer.java b/mods/tinker/tconstruct/container/ToolStationContainer.java index c8fbb9cc..3555c8c5 100644 --- a/mods/tinker/tconstruct/container/ToolStationContainer.java +++ b/mods/tinker/tconstruct/container/ToolStationContainer.java @@ -219,8 +219,10 @@ public class ToolStationContainer extends Container } } - if (!failedToMerge) - player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0); + /*boolean emptySlots = ( ((Slot) inventorySlots.get(2)).getStack() == null && ((Slot) inventorySlots.get(3)).getStack() == null ); + System.out.println("Empty slots"); + if (!failedToMerge && emptySlots) + player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/ return failedToMerge; } diff --git a/mods/tinker/tconstruct/crafting/CastingRecipe.java b/mods/tinker/tconstruct/crafting/CastingRecipe.java index 7d3fb277..39ea29ed 100644 --- a/mods/tinker/tconstruct/crafting/CastingRecipe.java +++ b/mods/tinker/tconstruct/crafting/CastingRecipe.java @@ -22,7 +22,7 @@ public class CastingRecipe public boolean matches(LiquidStack metal, ItemStack cast) { - if (castingMetal.isLiquidEqual(metal) && metal.amount >= castingMetal.amount && ItemStack.areItemStacksEqual(this.cast, cast)) + if (castingMetal.isLiquidEqual(metal) && ItemStack.areItemStacksEqual(this.cast, cast)) return true; else return false; diff --git a/mods/tinker/tconstruct/crafting/LiquidCasting.java b/mods/tinker/tconstruct/crafting/LiquidCasting.java index c95de3ec..849bcf2a 100644 --- a/mods/tinker/tconstruct/crafting/LiquidCasting.java +++ b/mods/tinker/tconstruct/crafting/LiquidCasting.java @@ -11,44 +11,70 @@ import net.minecraftforge.liquids.LiquidStack; /* Melting becomes hardened */ public class LiquidCasting { - public static LiquidCasting instance = new LiquidCasting(); - private ArrayList casts = new ArrayList(); - - public static void addCastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay) - { - instance.casts.add(new CastingRecipe(replacement, metal, cast, consume, delay)); - } - - public static void addCastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, int delay) - { addCastingRecipe(replacement, metal, cast, false, delay); } - public static void addCastingRecipe(ItemStack replacement, LiquidStack metal, int delay) - { addCastingRecipe(replacement, metal, null, false, delay); } - - public int getCastingDelay(LiquidStack metal, ItemStack cast) - { - for (CastingRecipe recipe : casts) - { - if (recipe.matches(metal, cast)) - return recipe.coolTime; - } - return -1; - } - - public int getCastingAmount(LiquidStack metal, ItemStack cast) - { - CastingRecipe recipe = getCastingRecipe(metal, cast); - if (recipe != null) - return recipe.castingMetal.amount; - return 0; - } - - public CastingRecipe getCastingRecipe(LiquidStack metal, ItemStack cast) - { - for (CastingRecipe recipe : casts) - { - if (recipe.matches(metal, cast)) - return recipe; - } - return null; - } + public static LiquidCasting instance = new LiquidCasting(); + private ArrayList casts = new ArrayList(); + + /** Adds a casting recipe + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param cast The empty item to cast with. ex Ingot Cast + * @param consume Whether the item should be consumed while casting + * @param delay Time to cast in ticks + */ + public static void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, boolean consume, int delay) + { + instance.casts.add(new CastingRecipe(output, metal, cast, consume, delay)); + } + + /** Adds a casting recipe. Does not consume the cast + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param cast The empty item to cast with. ex Ingot Cast + * @param delay Time to cast in ticks + */ + public static void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, int delay) + { + addCastingRecipe(output, metal, cast, false, delay); + } + + /** Adds a casting recipe. Does not consume the cast or have an item to cast against + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param delay Time to cast in ticks + */ + public static void addCastingRecipe (ItemStack output, LiquidStack metal, int delay) + { + addCastingRecipe(output, metal, null, false, delay); + } + + public int getCastingDelay (LiquidStack metal, ItemStack cast) + { + for (CastingRecipe recipe : casts) + { + if (recipe.matches(metal, cast)) + return recipe.coolTime; + } + return -1; + } + + public int getCastingAmount (LiquidStack metal, ItemStack cast) + { + CastingRecipe recipe = getCastingRecipe(metal, cast); + if (recipe != null) + return recipe.castingMetal.amount; + return 0; + } + + public CastingRecipe getCastingRecipe (LiquidStack metal, ItemStack cast) + { + for (CastingRecipe recipe : casts) + { + if (recipe.matches(metal, cast)) + return recipe; + } + return null; + } } diff --git a/mods/tinker/tconstruct/crafting/Smeltery.java b/mods/tinker/tconstruct/crafting/Smeltery.java index 736dbb57..ddb73f63 100644 --- a/mods/tinker/tconstruct/crafting/Smeltery.java +++ b/mods/tinker/tconstruct/crafting/Smeltery.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; +import mods.tinker.tconstruct.TConstruct; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.liquids.LiquidStack; @@ -19,44 +20,55 @@ public class Smeltery private HashMap, ItemStack> renderIndex = new HashMap, ItemStack>(); private ArrayList alloys = new ArrayList(); - /** Adds mappings between an itemstack and its liquid + /** Adds mappings between an itemstack and an output liquid + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); * * @param stack The itemstack to liquify - * @param temperature How hot the block should be before liquifying - * @param liquid The result of the process + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form */ - public static void addMelting(ItemStack stack, int temperature, LiquidStack liquid) + public static void addMelting(ItemStack stack, int temperature, LiquidStack output) { - addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, liquid); + addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, output); } /** Adds mappings between a block and its liquid + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); * * @param blockID The ID of the block to liquify and render * @param metadata The metadata of the block to liquify and render - * @param temperature How hot the block should be before liquifying - * @param liquid The result of the process + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form */ - public static void addMelting(Block block, int metadata, int temperature, LiquidStack liquid) + public static void addMelting(Block block, int metadata, int temperature, LiquidStack output) { - addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, liquid); + addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, output); } - /** Adds mappings between an input and its liquid + /** Adds mappings between an input and its liquid. + * Renders with the given input's block ID and metadata + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); * * @param input The item to liquify - * @param itemID The ID of the block to render + * @param blockID The ID of the block to render * @param metadata The metadata of the block to render * @param temperature How hot the block should be before liquifying * @param liquid The result of the process */ - public static void addMelting(ItemStack input, int itemID, int metadata, int temperature, LiquidStack liquid) + public static void addMelting(ItemStack input, int blockID, int metadata, int temperature, LiquidStack liquid) { instance.smeltingList.put(Arrays.asList(input.itemID, input.getItemDamage()), liquid); instance.temperatureList.put(Arrays.asList(input.itemID, input.getItemDamage()), temperature); - instance.renderIndex.put(Arrays.asList(input.itemID, input.getItemDamage()), new ItemStack(itemID, input.stackSize, metadata)); + instance.renderIndex.put(Arrays.asList(input.itemID, input.getItemDamage()), new ItemStack(blockID, input.stackSize, metadata)); } + /** Adds an alloy mixing recipe. + * Example: Smeltery.addAlloyMixing(new LiquidStack(bronzeID, 2, 0), new LiquidStack(copperID, 3, 0), new LiquidStack(tinID, 1, 0)); + * The example mixes 3 copper with 1 tin to make 2 bronze + * + * @param result The output of the combination of mixers. The quantity is used for amount of a successful mix + * @param mixers the liquids to be mixed. Quantities are used as ratios + */ public static void addAlloyMixing(LiquidStack result, LiquidStack... mixers) { ArrayList inputs = new ArrayList(); diff --git a/mods/tinker/tconstruct/crafting/ToolBuilder.java b/mods/tinker/tconstruct/crafting/ToolBuilder.java index 385c9af8..f250fe2b 100644 --- a/mods/tinker/tconstruct/crafting/ToolBuilder.java +++ b/mods/tinker/tconstruct/crafting/ToolBuilder.java @@ -162,10 +162,16 @@ public class ToolBuilder public ItemStack modifyTool (ItemStack input, ItemStack topSlot, ItemStack bottomSlot) { + //if (topSlot == null && bottomSlot == null) + //return input; + ItemStack tool = input.copy(); NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); tags.removeTag("Built"); + if (topSlot == null && bottomSlot == null) + return tool; + boolean built = false; for (ToolMod mod : toolMods) { diff --git a/mods/tinker/tconstruct/items/ToolShard.java b/mods/tinker/tconstruct/items/ToolShard.java index efe5e4e0..055209f2 100644 --- a/mods/tinker/tconstruct/items/ToolShard.java +++ b/mods/tinker/tconstruct/items/ToolShard.java @@ -2,8 +2,13 @@ package mods.tinker.tconstruct.items; import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; public class ToolShard extends ToolPart { @@ -15,13 +20,42 @@ public class ToolShard extends ToolPart this.setMaxDamage(0); } + private static String[] buildTextureNames (String textureType) + { + String[] names = new String[toolMaterialNames.length]; + for (int i = 0; i < toolMaterialNames.length; i++) + names[i] = toolTextureNames[i]+textureType; + return names; + } + + @SideOnly(Side.CLIENT) + public void updateIcons(IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < 5; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]); + } + icons[5] = icons[4]; + for (int i = 6; i < 9; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]); + } + icons[9] = icons[8]; + for (int i = 10; i < icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]); + } + } + public void getSubItems(int id, CreativeTabs tab, List list) { for (int i = 1; i < 5; i++) list.add(new ItemStack(id, 1, i)); for (int i = 6; i < 9; i++) list.add(new ItemStack(id, 1, i)); - for (int i = 10; i < 17; i++) + for (int i = 10; i < icons.length; i++) list.add(new ItemStack(id, 1, i)); } } diff --git a/mods/tinker/tconstruct/library/AbilityHelper.java b/mods/tinker/tconstruct/library/AbilityHelper.java index caa1eec4..5f1a9a65 100644 --- a/mods/tinker/tconstruct/library/AbilityHelper.java +++ b/mods/tinker/tconstruct/library/AbilityHelper.java @@ -36,7 +36,6 @@ import cpw.mods.fml.client.FMLClientHandler; public class AbilityHelper { - static Minecraft mc; static Random random = new Random(); /* Normal interactions */ @@ -418,19 +417,6 @@ public class AbilityHelper return new PiercingEntityDamage("player", player); } - public static void thrust (ItemStack stack, World world, EntityPlayer player) - { - if (mc == null) - mc = FMLClientHandler.instance().getClient(); - - if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) - { - mc.playerController.attackEntity(player, mc.objectMouseOver.entityHit); - mc.playerController.attackEntity(player, mc.objectMouseOver.entityHit); - mc.playerController.attackEntity(player, mc.objectMouseOver.entityHit); - } - } - public static void knockbackEntity (EntityLiving living, double boost) { living.motionX *= boost; diff --git a/mods/tinker/tconstruct/library/ToolCore.java b/mods/tinker/tconstruct/library/ToolCore.java index be3ade32..204ef9d1 100644 --- a/mods/tinker/tconstruct/library/ToolCore.java +++ b/mods/tinker/tconstruct/library/ToolCore.java @@ -111,7 +111,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox @Override public int getRenderPasses (int metadata) { - return 6; + return 9; } //Override me please! @@ -231,6 +231,24 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox if (tags.hasKey("Effect3")) return (effectIcons.get(tags.getInteger("Effect3"))); } + + else if (renderPass == getPartAmount() + 3) + { + if (tags.hasKey("Effect4")) + return (effectIcons.get(tags.getInteger("Effect4"))); + } + + else if (renderPass == getPartAmount() + 4) + { + if (tags.hasKey("Effect5")) + return (effectIcons.get(tags.getInteger("Effect5"))); + } + + else if (renderPass == getPartAmount() + 5) + { + if (tags.hasKey("Effect6")) + return (effectIcons.get(tags.getInteger("Effect6"))); + } } return blankSprite; diff --git a/mods/tinker/tconstruct/library/Weapon.java b/mods/tinker/tconstruct/library/Weapon.java index ec43d313..c44f9c03 100644 --- a/mods/tinker/tconstruct/library/Weapon.java +++ b/mods/tinker/tconstruct/library/Weapon.java @@ -90,5 +90,6 @@ public abstract class Weapon extends ToolCore return 1; } - private static Material[] web = new Material[] { Material.web }; + public static Material[] web = new Material[] { Material.web }; + public static Material[] none = new Material[0]; } diff --git a/mods/tinker/tconstruct/logic/SmelteryLogic.java b/mods/tinker/tconstruct/logic/SmelteryLogic.java index 4dc1b507..e5c8e4c7 100644 --- a/mods/tinker/tconstruct/logic/SmelteryLogic.java +++ b/mods/tinker/tconstruct/logic/SmelteryLogic.java @@ -354,6 +354,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci updateTemperatures(); super.onInventoryChanged(); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); } /* Multiblock */ @@ -615,6 +616,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public LiquidStack drain (int maxDrain, boolean doDrain) { + System.out.println("Liquid: "+currentLiquid); if (moltenMetal.size() == 0) return null; diff --git a/mods/tinker/tconstruct/logic/ToolStationLogic.java b/mods/tinker/tconstruct/logic/ToolStationLogic.java index df3d6e5d..a52b6607 100644 --- a/mods/tinker/tconstruct/logic/ToolStationLogic.java +++ b/mods/tinker/tconstruct/logic/ToolStationLogic.java @@ -65,8 +65,6 @@ public class ToolStationLogic extends InventoryLogic inventory[0] = tool; } } - /*if (container != null) - container.detectAndSendChanges();*/ } public void setToolname (String name) @@ -74,15 +72,6 @@ public class ToolStationLogic extends InventoryLogic toolName = name; buildTool (name); } - - void consumeItems () - { - for (int i = 1; i <= 3; i++) - super.decrStackSize(i, 1); - - /*if (container != null) - container.detectAndSendChanges();*/ - } public boolean canUpdate() { diff --git a/mods/tinker/tconstruct/modifiers/ModAttack.java b/mods/tinker/tconstruct/modifiers/ModAttack.java index eaeb0521..cbb65f19 100644 --- a/mods/tinker/tconstruct/modifiers/ModAttack.java +++ b/mods/tinker/tconstruct/modifiers/ModAttack.java @@ -1,6 +1,7 @@ package mods.tinker.tconstruct.modifiers; import mods.tinker.common.ToolMod; +import mods.tinker.tconstruct.library.ToolCore; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -45,9 +46,13 @@ public class ModAttack extends ToolMod NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); if (tags.hasKey(key)) { + int amount = 24; + if (((ToolCore) tool.getItem()).pierceArmor()) + amount = 36; + int[] keyPair = tags.getIntArray(key); - int leftToBoost = 36 - (keyPair[0] % 36); + int leftToBoost = amount - (keyPair[0] % amount); if (increase >= leftToBoost) { int attack = tags.getInteger("Attack"); diff --git a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java index 1e246524..05b3659c 100644 --- a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java +++ b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java @@ -16,9 +16,6 @@ public class ModExtraModifier extends ToolMod @Override protected boolean canModify (ItemStack tool, ItemStack[] input) { - if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack - return false; - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); if (tags.getBoolean(key)) { @@ -33,7 +30,9 @@ public class ModExtraModifier extends ToolMod NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); tags.setBoolean(key, true); int modifiers = tags.getInteger("Modifiers"); - tags.setInteger("Modifiers", modifiers + 1); + modifiers += 1; + tags.setInteger("Modifiers", modifiers); } - + + public void addMatchingEffect (ItemStack tool) {} } diff --git a/mods/tinker/tconstruct/tools/Axe.java b/mods/tinker/tconstruct/tools/Axe.java index ab5a3cf4..8d747cde 100644 --- a/mods/tinker/tconstruct/tools/Axe.java +++ b/mods/tinker/tconstruct/tools/Axe.java @@ -66,7 +66,7 @@ public class Axe extends HarvestTool @Override public int getRenderPasses (int metadata) { - return 5; + return 8; } @Override diff --git a/mods/tinker/tconstruct/tools/BattleSign.java b/mods/tinker/tconstruct/tools/BattleSign.java index 621f8ab3..3f70ed8b 100644 --- a/mods/tinker/tconstruct/tools/BattleSign.java +++ b/mods/tinker/tconstruct/tools/BattleSign.java @@ -109,17 +109,17 @@ public class BattleSign extends Weapon } @SideOnly(Side.CLIENT) - @Override - public int getRenderPasses (int metadata) - { - return 5; - } - - @Override - public int getPartAmount() - { - return 2; - } + @Override + public int getRenderPasses (int metadata) + { + return 8; + } + + @Override + public int getPartAmount() + { + return 2; + } @Override public void registerPartPaths (int index, String[] location) diff --git a/mods/tinker/tconstruct/tools/Broadsword.java b/mods/tinker/tconstruct/tools/Broadsword.java index 8b47fdd1..331f2db3 100644 --- a/mods/tinker/tconstruct/tools/Broadsword.java +++ b/mods/tinker/tconstruct/tools/Broadsword.java @@ -21,7 +21,7 @@ public class Broadsword extends Weapon @Override protected Item getAccessoryItem () { - return TContent.largeGuard; + return TContent.wideGuard; } public float getDurabilityModifier () diff --git a/mods/tinker/tconstruct/tools/FryingPan.java b/mods/tinker/tconstruct/tools/FryingPan.java index a06f9787..777836c5 100644 --- a/mods/tinker/tconstruct/tools/FryingPan.java +++ b/mods/tinker/tconstruct/tools/FryingPan.java @@ -108,11 +108,11 @@ public class FryingPan extends Weapon } @SideOnly(Side.CLIENT) - @Override - public int getRenderPasses (int metadata) - { - return 5; - } + @Override + public int getRenderPasses (int metadata) + { + return 8; + } @Override public int getPartAmount() diff --git a/mods/tinker/tconstruct/tools/Longsword.java b/mods/tinker/tconstruct/tools/Longsword.java index 63ab8cf6..9e74a2ea 100644 --- a/mods/tinker/tconstruct/tools/Longsword.java +++ b/mods/tinker/tconstruct/tools/Longsword.java @@ -1,98 +1,97 @@ package mods.tinker.tconstruct.tools; import mods.tinker.tconstruct.TContent; +import mods.tinker.tconstruct.library.AbilityHelper; import mods.tinker.tconstruct.library.Weapon; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; public class Longsword extends Weapon { - public Longsword(int itemID) - { - super(itemID, 4); - this.setUnlocalizedName("InfiTool.Longsword"); - } - - /*public EnumAction getItemUseAction(ItemStack par1ItemStack) + public Longsword(int itemID) + { + super(itemID, 4); + this.setUnlocalizedName("InfiTool.Longsword"); + } + + public EnumAction getItemUseAction (ItemStack par1ItemStack) { return EnumAction.bow; - }*/ - - /*public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + } + + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); - NBTTagCompound tags = stack.getTagCompound(); - tags.getCompoundTag("InfiTool").setBoolean("InUse", true); + if (player.onGround) + { + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + NBTTagCompound tags = stack.getTagCompound(); + tags.getCompoundTag("InfiTool").setBoolean("InUse", true); + } return stack; - }*/ - - public float chargeAttack() - { - return 1.2f; - } - - /*public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int time) + } + + public float chargeAttack () { - if (time > 5) - AbilityHelper.thrust(stack, world, player); - player.swingItem(); - }*/ + return 1.5f; + } - @Override - protected Item getHeadItem () - { - return TContent.swordBlade; - } + public void onPlayerStoppedUsing (ItemStack stack, World world, EntityPlayer player, int time) + { + if (time > 10) + { + player.setSprinting(true); + player.motionY += 0.62; - @Override - protected Item getAccessoryItem () - { - return TContent.medGuard; - } - - /*@Override - public boolean hitEntity(ItemStack stack, EntityLiving mob, EntityLiving player) - { - NBTTagCompound tags = stack.getTagCompound(); - System.out.println("Inuuse: "+tags.getCompoundTag("InfiTool").getBoolean("InUse")); - if (tags.getCompoundTag("InfiTool").getBoolean("InUse")) - { - AbilityHelper.hitEntity(stack, mob, player, damageVsEntity, 2.0f); - AbilityHelper.knockbackEntity(mob, 3); - tags.getCompoundTag("InfiTool").setBoolean("InUse", false); - } - else - AbilityHelper.hitEntity(stack, mob, player, damageVsEntity); - - return true; - }*/ - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_longsword_blade"; - case 1: - return "_longsword_blade_broken"; - case 2: - return "_longsword_handle"; - case 3: - return "_longsword_accessory"; - default: - return ""; - } - } + float f = 1.0F; + player.motionX = (double) (-MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); + player.motionZ = (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); + } + } - @Override - public String getEffectSuffix () - { - return "_longsword_effect"; - } + @Override + protected Item getHeadItem () + { + return TContent.swordBlade; + } - @Override - public String getDefaultFolder () - { - return "longsword"; - } + @Override + protected Item getAccessoryItem () + { + return TContent.handGuard; + } + + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_longsword_blade"; + case 1: + return "_longsword_blade_broken"; + case 2: + return "_longsword_handle"; + case 3: + return "_longsword_accessory"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_longsword_effect"; + } + + @Override + public String getDefaultFolder () + { + return "longsword"; + } } diff --git a/mods/tinker/tconstruct/tools/Rapier.java b/mods/tinker/tconstruct/tools/Rapier.java index d7b6b8e9..a7c85a1c 100644 --- a/mods/tinker/tconstruct/tools/Rapier.java +++ b/mods/tinker/tconstruct/tools/Rapier.java @@ -3,11 +3,13 @@ package mods.tinker.tconstruct.tools; import mods.tinker.tconstruct.TContent; import mods.tinker.tconstruct.library.AbilityHelper; import mods.tinker.tconstruct.library.Weapon; +import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLiving; 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.MathHelper; import net.minecraft.world.World; public class Rapier extends Weapon @@ -25,6 +27,13 @@ public class Rapier extends Weapon public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { + if (player.onGround) + { + player.motionY += 0.32; + float f = 0.5F; + player.motionX = (double) (MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); + player.motionZ = (double) (-MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); + } return stack; } @@ -95,4 +104,9 @@ public class Rapier extends Weapon { return "rapier"; } + + protected Material[] getEffectiveMaterials() + { + return none; + } } diff --git a/mods/tinker/tconstruct/tools/Shovel.java b/mods/tinker/tconstruct/tools/Shovel.java index 926f7abd..5aad3039 100644 --- a/mods/tinker/tconstruct/tools/Shovel.java +++ b/mods/tinker/tconstruct/tools/Shovel.java @@ -51,7 +51,7 @@ public class Shovel extends HarvestTool @Override public int getRenderPasses (int metadata) { - return 5; + return 8; } @Override