diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 207ab0ef..b0012266 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -3,6 +3,7 @@ package mods.tinker.tconstruct; import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TProxyCommon; import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.crafting.LiquidCasting; import mods.tinker.tconstruct.library.util.TabTools; import mods.tinker.tconstruct.util.PHConstruct; import mods.tinker.tconstruct.util.TCraftingHandler; @@ -33,7 +34,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry; * @dependencies: IC2 API, EBXL API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev29", dependencies = "required-after:Forge@[7.7.1.675,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev30", dependencies = "required-after:Forge@[7.7.1.675,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class) public class TConstruct { @@ -55,6 +56,9 @@ public class TConstruct TConstructRegistry.materialTab = new TabTools("TConstructMaterials"); TConstructRegistry.toolTab = new TabTools("TConstructTools"); TConstructRegistry.blockTab = new TabTools("TConstructBlocks"); + + tableCasting = new LiquidCasting(); + basinCasting = new LiquidCasting(); content = new TContent(); events = new TEventHandler(); @@ -100,8 +104,20 @@ public class TConstruct content.modIntegration(); } + + public static LiquidCasting getTableCasting() + { + return tableCasting; + } + + public static LiquidCasting getBasinCasting() + { + return basinCasting; + } public static TEventHandler events; public static TPlayerHandler playerTracker; public static TContent content; + public static LiquidCasting tableCasting; + public static LiquidCasting basinCasting; } diff --git a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java index 34a0dd3a..c954f4b9 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java @@ -3,7 +3,6 @@ package mods.tinker.tconstruct.blocks.logic; import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.library.crafting.CastingRecipe; -import mods.tinker.tconstruct.library.crafting.LiquidBlockCasting; import mods.tinker.tconstruct.library.util.IPattern; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -81,7 +80,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5; else - ret = LiquidBlockCasting.instance.getCastingAmount(this.liquid, inv); + ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv); return ret; } @@ -109,7 +108,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT if (this.liquid == null) { - CastingRecipe recipe = LiquidBlockCasting.instance.getCastingRecipe(resource, inventory[0]); + CastingRecipe recipe = TConstruct.basinCasting.getCastingRecipe(resource, inventory[0]); if (recipe == null) return 0; this.capacity = updateCapacity(recipe.castingMetal.amount); @@ -150,7 +149,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT if (doFill && roomInTank > 0) { renderOffset = roomInTank; - castingDelay = LiquidBlockCasting.instance.getCastingDelay(this.liquid, inventory[0]); + castingDelay = TConstruct.basinCasting.getCastingDelay(this.liquid, inventory[0]); this.liquid.amount = this.capacity; worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); needsUpdate = true; @@ -276,7 +275,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT public void castLiquid () { - CastingRecipe recipe = LiquidBlockCasting.instance.getCastingRecipe(liquid, inventory[0]); + CastingRecipe recipe = TConstruct.basinCasting.getCastingRecipe(liquid, inventory[0]); if (recipe != null) { inventory[1] = recipe.getResult(); diff --git a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java index 7fc22ce6..ecae7518 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java @@ -81,7 +81,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5; else - ret = LiquidCasting.instance.getCastingAmount(this.liquid, inv); + ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv); return ret; } @@ -109,7 +109,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT if (this.liquid == null) { - CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(resource, inventory[0]); + CastingRecipe recipe = TConstruct.tableCasting.getCastingRecipe(resource, inventory[0]); if (recipe == null) return 0; this.capacity = updateCapacity(recipe.castingMetal.amount); @@ -150,7 +150,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT if (doFill && roomInTank > 0) { renderOffset = roomInTank; - castingDelay = LiquidCasting.instance.getCastingDelay(this.liquid, inventory[0]); + castingDelay = TConstruct.tableCasting.getCastingDelay(this.liquid, inventory[0]); this.liquid.amount = this.capacity; worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); needsUpdate = true; @@ -276,7 +276,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT public void castLiquid () { - CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(liquid, inventory[0]); + CastingRecipe recipe = TConstruct.tableCasting.getCastingRecipe(liquid, inventory[0]); if (recipe != null) { inventory[1] = recipe.getResult(); diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index 2ccfbfb6..1a03b317 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -69,7 +69,6 @@ import mods.tinker.tconstruct.util.player.ArmorExtended; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.model.ModelSlime; import net.minecraft.client.particle.EntityAuraFX; @@ -97,6 +96,7 @@ import net.minecraft.client.particle.EntitySnowShovelFX; import net.minecraft.client.particle.EntitySpellParticleFX; import net.minecraft.client.particle.EntitySplashFX; import net.minecraft.client.particle.EntitySuspendFX; +import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.entity.RenderCreeper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.settings.GameSettings; diff --git a/mods/tinker/tconstruct/client/block/TankRender.java b/mods/tinker/tconstruct/client/block/TankRender.java index ebc54642..805cd55c 100644 --- a/mods/tinker/tconstruct/client/block/TankRender.java +++ b/mods/tinker/tconstruct/client/block/TankRender.java @@ -62,8 +62,8 @@ public class TankRender implements ISimpleBlockRenderingHandler { renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); renderer.renderStandardBlock(block, x, y + 1, z); - renderer.setRenderBounds(0, 0, 0, 1, 1, 1); } + renderer.setRenderBounds(0, 0, 0, 1, 1, 1); renderer.renderStandardBlock(block, x, y, z); } return true; diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index f0ce1976..4170fd1b 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -35,10 +35,10 @@ import mods.tinker.tconstruct.entity.projectile.DaggerEntity; import mods.tinker.tconstruct.items.CraftingItem; import mods.tinker.tconstruct.items.FilledBucket; import mods.tinker.tconstruct.items.HeartContainer; +import mods.tinker.tconstruct.items.Manual; import mods.tinker.tconstruct.items.MetalPattern; import mods.tinker.tconstruct.items.OreBerries; import mods.tinker.tconstruct.items.Pattern; -import mods.tinker.tconstruct.items.Manual; import mods.tinker.tconstruct.items.StrangeFood; import mods.tinker.tconstruct.items.TitleIcon; import mods.tinker.tconstruct.items.ToolPart; @@ -69,7 +69,6 @@ import mods.tinker.tconstruct.items.tools.Rapier; import mods.tinker.tconstruct.items.tools.Shovel; import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.client.TConstructClientRegistry; -import mods.tinker.tconstruct.library.crafting.LiquidBlockCasting; import mods.tinker.tconstruct.library.crafting.LiquidCasting; import mods.tinker.tconstruct.library.crafting.PatternBuilder; import mods.tinker.tconstruct.library.crafting.Smeltery; @@ -92,8 +91,6 @@ import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialLiquid; -import net.minecraft.entity.EntityEggInfo; -import net.minecraft.entity.EntityList; import net.minecraft.entity.EnumCreatureType; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -230,8 +227,6 @@ public class TContent implements IFuelHandler registerBlocks(); registerItems(); registerMaterials(); - addToolRecipes(); - addSmelteryRecipes(); addCraftingRecipes(); setupToolTabs(); } @@ -533,7 +528,7 @@ public class TContent implements IFuelHandler public static Item[] patternOutputs; public static LiquidStack[] liquids; - void addToolRecipes () + void addCraftingRecipes () { /*List removeTools = new ArrayList(); if (PHConstruct.disableWoodTools) @@ -639,43 +634,44 @@ public class TContent implements IFuelHandler tb.registerToolMod(new ModExtraModifier(new ItemStack[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free")); tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free")); + //Smeltery ItemStack ingotcast = new ItemStack(metalPattern, 1, 0); - LiquidCasting lc = LiquidCasting.instance; + LiquidCasting tableCasting = TConstructRegistry.instance.getTableCasting(); //Blank - lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), 80); - lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1), 80); + tableCasting.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), 80); + tableCasting.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1), 80); //Ingots - lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 80); //Iron - lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 80); //gold - lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 80); //copper - lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 80); //tin - lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 80); //aluminum - lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 80); //cobalt - lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 80); //ardite - lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 80); //bronze - lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 80); //albrass - lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 80); //manyullyn - lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 80); //alumite - lc.addCastingRecipe(new ItemStack(materials, 1, 18), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11), ingotcast, 80); //obsidian - lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 80); //steel + tableCasting.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 80); //Iron + tableCasting.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 80); //gold + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 80); //copper + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 80); //tin + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 80); //aluminum + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 80); //cobalt + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 80); //ardite + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 80); //bronze + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 80); //albrass + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 80); //manyullyn + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 80); //alumite + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 18), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11), ingotcast, 80); //obsidian + tableCasting.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 80); //steel //Buckets ItemStack bucket = new ItemStack(Item.bucketEmpty); - 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 + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), bucket, true, 10); //Iron + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), bucket, true, 10); //gold + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), bucket, true, 10); //copper + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), bucket, true, 10); //tin + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), bucket, true, 10); //aluminum + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), bucket, true, 10); //cobalt + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), bucket, true, 10); //ardite + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), bucket, true, 10); //bronze + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), bucket, true, 10); //albrass + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), bucket, true, 10); //manyullyn + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), bucket, true, 10); //alumite + tableCasting.addCastingRecipe(new ItemStack(buckets, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 11), bucket, true, 10);// obsidian + tableCasting.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), @@ -687,33 +683,28 @@ public class TContent implements IFuelHandler ItemStack cast = new ItemStack(metalPattern, 1, iter + 1); for (int iterTwo = 0; iterTwo < liquids.length; iterTwo++) { - lc.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), new LiquidStack(liquids[iterTwo].itemID, ((IPattern) metalPattern).getPatternCost(iter) + tableCasting.addCastingRecipe(new ItemStack(patternOutputs[iter], 1, liquidDamage[iterTwo]), new LiquidStack(liquids[iterTwo].itemID, ((IPattern) metalPattern).getPatternCost(iter) * TConstruct.ingotLiquidValue / 2, liquids[iterTwo].itemMeta), cast, 50); } } - LiquidBlockCasting lbc = LiquidBlockCasting.instance; - lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron - lbc.addBlockCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), null, true, 100); //copper - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), null, true, 100); //tin - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), null, true, 100); //aluminum - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), null, true, 100); //cobalt - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), null, true, 100); //ardite - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), null, true, 100); //bronze - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), null, true, 100); //albrass - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), null, true, 100); //manyullyn - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite - lbc.addBlockCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel + LiquidCasting basinCasting = TConstructRegistry.getBasinCasting(); + basinCasting.addCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron + basinCasting.addCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), null, true, 100); //copper + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), null, true, 100); //tin + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), null, true, 100); //aluminum + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), null, true, 100); //cobalt + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), null, true, 100); //ardite + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), null, true, 100); //bronze + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), null, true, 100); //albrass + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), null, true, 100); //manyullyn + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite + basinCasting.addCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian + basinCasting.addCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel + + basinCasting.addCastingRecipe(new ItemStack(speedBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3), new ItemStack(Block.gravel), true, 100); //steel - lbc.addBlockCastingRecipe(new ItemStack(speedBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3), new ItemStack(Block.gravel), true, 100); //steel - } - - //WeakReference tool = new WeakReference(null); - - void addSmelteryRecipes () - { //Ore Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1)); @@ -747,10 +738,8 @@ public class TContent implements IFuelHandler Smeltery.addMelting(new ItemStack(oreBerries, 4, 2), metalBlock.blockID, 3, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 2)); //Copper Smeltery.addMelting(new ItemStack(oreBerries, 4, 3), metalBlock.blockID, 5, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3)); //Tin Smeltery.addMelting(new ItemStack(oreBerries, 4, 4), metalBlock.blockID, 6, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 4)); //Aluminum - } - - void addCraftingRecipes () - { + + //Crafting GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 0), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', Block.workbench); GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 1), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 0)); GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 2), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 1)); @@ -826,7 +815,7 @@ public class TContent implements IFuelHandler GameRegistry.addRecipe(new ItemStack(materials, 1, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin GameRegistry.addRecipe(new ItemStack(materials, 1, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum - LiquidBlockCasting lbc = LiquidBlockCasting.instance; + /*LiquidBlockCasting lbc = LiquidBlockCasting.instance; lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron lbc.addBlockCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), null, true, 100); //copper @@ -839,7 +828,7 @@ public class TContent implements IFuelHandler lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), null, true, 100); //manyullyn lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite lbc.addBlockCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian - lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel + lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel*/ //Smeltery ItemStack searedBrick = new ItemStack(materials, 1, 2); @@ -881,7 +870,7 @@ public class TContent implements IFuelHandler TConstructRegistry.toolTab.init(tool); } - public static LiquidStack[] liquidIcons; + public static LiquidStack[] liquidIcons = new LiquidStack[0]; public static String[] liquidNames; public void oreRegistry () diff --git a/mods/tinker/tconstruct/library/TConstructRegistry.java b/mods/tinker/tconstruct/library/TConstructRegistry.java index 10947c3e..7a42d03f 100644 --- a/mods/tinker/tconstruct/library/TConstructRegistry.java +++ b/mods/tinker/tconstruct/library/TConstructRegistry.java @@ -1,11 +1,15 @@ package mods.tinker.tconstruct.library; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; +import mods.tinker.tconstruct.TConstruct; +import mods.tinker.tconstruct.library.crafting.LiquidCasting; import mods.tinker.tconstruct.library.tools.ToolCore; import mods.tinker.tconstruct.library.tools.ToolMaterial; import mods.tinker.tconstruct.library.util.TabTools; +import net.minecraft.block.Block; import net.minecraft.item.Item; /** A registry to store any relevant API work @@ -64,4 +68,46 @@ public class TConstructRegistry { return (toolMaterialStrings.get(key)); } + + public static LiquidCasting getTableCasting() + { + return instance.tableCasting(); + } + + LiquidCasting tableCasting() + { + try + { + Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct"); + Method method = clazz.getMethod("getTableCasting"); + LiquidCasting lc = (LiquidCasting) method.invoke(this); + return lc; + } + catch (Exception e) + { + System.out.println("[TCon API] Could not find casting table recipes."); + return null; + } + } + + public static LiquidCasting getBasinCasting() + { + return instance.basinCasting(); + } + + LiquidCasting basinCasting() + { + try + { + Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct"); + Method method = clazz.getMethod("getBasinCasting"); + LiquidCasting lc = (LiquidCasting) method.invoke(this); + return lc; + } + catch (Exception e) + { + System.out.println("[TCon API] Could not find casting table recipes."); + return null; + } + } } diff --git a/mods/tinker/tconstruct/library/crafting/LiquidBlockCasting.java b/mods/tinker/tconstruct/library/crafting/LiquidBlockCasting.java deleted file mode 100644 index 67fd70de..00000000 --- a/mods/tinker/tconstruct/library/crafting/LiquidBlockCasting.java +++ /dev/null @@ -1,85 +0,0 @@ -package mods.tinker.tconstruct.library.crafting; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.liquids.LiquidStack; - -/* Melting becomes hardened */ -public class LiquidBlockCasting -{ - public static LiquidBlockCasting instance = new LiquidBlockCasting(); - private ArrayList blockCasts = 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 addBlockCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, boolean consume, int delay) - { - instance.blockCasts.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 addBlockCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, int delay) - { - addBlockCastingRecipe(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 addBlockCastingRecipe (ItemStack output, LiquidStack metal, int delay) - { - addBlockCastingRecipe(output, metal, null, false, delay); - } - - public int getCastingDelay (LiquidStack metal, ItemStack cast) - { - CastingRecipe recipe = getCastingRecipe(metal, cast); - if (recipe != null) - 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 : blockCasts) - { - if (recipe.matches(metal, cast)) - return recipe; - } - System.out.println("Recipe: "); - return null; - } - - //Getter for public viewing - public ArrayList getCastingRecipes() - { - return blockCasts; - } -} diff --git a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java index cc2e686b..57441dd7 100644 --- a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java +++ b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java @@ -11,7 +11,7 @@ import net.minecraftforge.liquids.LiquidStack; /* Melting becomes hardened */ public class LiquidCasting { - public static LiquidCasting instance = new LiquidCasting(); + //public static LiquidCasting instance = new LiquidCasting(); private ArrayList casts = new ArrayList(); /** Adds a casting recipe @@ -22,9 +22,9 @@ public class LiquidCasting * @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) + public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, boolean consume, int delay) { - instance.casts.add(new CastingRecipe(output, metal, cast, consume, delay)); + casts.add(new CastingRecipe(output, metal, cast, consume, delay)); } /** Adds a casting recipe. Does not consume the cast @@ -34,7 +34,7 @@ public class LiquidCasting * @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) + public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, int delay) { addCastingRecipe(output, metal, cast, false, delay); } @@ -45,7 +45,7 @@ public class LiquidCasting * @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) + public void addCastingRecipe (ItemStack output, LiquidStack metal, int delay) { addCastingRecipe(output, metal, null, false, delay); } diff --git a/mods/tinker/tconstruct/util/TEventHandler.java b/mods/tinker/tconstruct/util/TEventHandler.java index 894244f2..dfa2f773 100644 --- a/mods/tinker/tconstruct/util/TEventHandler.java +++ b/mods/tinker/tconstruct/util/TEventHandler.java @@ -34,12 +34,13 @@ import cpw.mods.fml.relauncher.SideOnly; public class TEventHandler { Random random = new Random(); - /* Sounds */ + + /* Sounds */ @ForgeSubscribe @SideOnly(Side.CLIENT) - public void onSound(SoundLoadEvent event) + public void onSound (SoundLoadEvent event) { - try + try { event.manager.soundPoolSounds.addSound("hit.frypan", TConstruct.class.getResource("/mods/tinker/resources/sounds/frypan_hit.ogg")); event.manager.soundPoolSounds.addSound("crafting.saw", TConstruct.class.getResource("/mods/tinker/resources/sounds/little_saw.ogg")); @@ -50,22 +51,24 @@ public class TEventHandler System.err.println("[TConstruct] Failed to register one or more sounds"); } } - + @ForgeSubscribe @SideOnly(Side.CLIENT) - public void postStitch(TextureStitchEvent.Post event) + public void postStitch (TextureStitchEvent.Post event) { for (int i = 0; i < TContent.liquidIcons.length; i++) { TContent.liquidIcons[i].setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); - TContent.liquidIcons[i].canonical().setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); + LiquidStack canon = TContent.liquidIcons[i].canonical(); + if (canon != null) + canon.setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); } } - + @ForgeSubscribe - public void onHurt(LivingHurtEvent event) + public void onHurt (LivingHurtEvent event) { - if (event.source instanceof EntityDamageSource && event.source.damageType.equals("explosion.player") && ((EntityDamageSource)event.source).getEntity() instanceof NitroCreeper) + if (event.source instanceof EntityDamageSource && event.source.damageType.equals("explosion.player") && ((EntityDamageSource) event.source).getEntity() instanceof NitroCreeper) { if (event.entityLiving.worldObj.difficultySetting == 3) event.ammount /= 2.3; @@ -73,10 +76,10 @@ public class TEventHandler event.ammount /= 1.5; } } - + /* Drops */ @ForgeSubscribe - public void onLivingDrop(LivingDropsEvent event) + public void onLivingDrop (LivingDropsEvent event) { if (event.entityLiving.getClass() == EntityCow.class) { @@ -87,7 +90,7 @@ public class TEventHandler event.entityLiving.dropItem(Item.leather.itemID, 1); } } - + else if (event.entityLiving.getClass() == EntityChicken.class) { int amount = random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + random.nextInt(3) + random.nextInt(1 + event.lootingLevel) + 1; @@ -97,519 +100,566 @@ public class TEventHandler event.entityLiving.dropItem(Item.feather.itemID, 1); } } - + else if (event.recentlyHit && event.entityLiving.getClass() == EntitySkeleton.class) { EntitySkeleton skeleton = (EntitySkeleton) event.entityLiving; - if (skeleton.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5-event.lootingLevel)) == 0) + if (skeleton.getSkeletonType() == 1 && random.nextInt(Math.max(1, 5 - event.lootingLevel)) == 0) { skeleton.entityDropItem(new ItemStack(TContent.materials, 1, 8), 0f); } } } - - /* Ore Dictionary */ - @ForgeSubscribe - public void registerOre (OreRegisterEvent evt) - { - if (evt.Name == "battery") - TConstruct.content.modE.batteries.add(evt.Ore); - else if (evt.Name == "basicCircuit") - TConstruct.content.modE.circuits.add(evt.Ore); - - else if (evt.Name == "plankWood") + /* Ore Dictionary */ + @ForgeSubscribe + public void registerOre (OreRegisterEvent evt) + { + if (evt.Name == "battery") + TConstruct.content.modE.batteries.add(evt.Ore); + + else if (evt.Name == "basicCircuit") + TConstruct.content.modE.circuits.add(evt.Ore); + + else if (evt.Name == "plankWood") { PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Wood"); } - - else if (evt.Name == "crystalQuartz") + + else if (evt.Name == "crystalQuartz") { - ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 2)); + ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 2)); } - - else if (evt.Name == "crystalCerusQuartz") + + else if (evt.Name == "crystalCerusQuartz") { ToolBuilder.instance.registerToolMod(new ModAttack("Quartz", new ItemStack[] { evt.Ore }, 11, 24)); } - //Ingots - else if (evt.Name == "ingotCopper") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Copper"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2)); - } - - else if (evt.Name == "ingotTin") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3)); - } + //Ingots + else if (evt.Name == "ingotCopper") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Copper"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 2)); + } - else if (evt.Name == "ingotBronze") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Bronze"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7)); - } - - else if (evt.Name == "ingotCobalt") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Cobalt"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5)); - } - - else if (evt.Name == "ingotArdite") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Ardite"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6)); - } - - else if (evt.Name == "ingotManyullyn") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Manyullyn"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9)); - } - - else if (evt.Name == "ingotNaturalAluminum") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - else if (evt.Name == "naturalAluminum") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - else if (evt.Name == "ingotAluminumBrass") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8)); - } - - else if (evt.Name == "ingotAlumite") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Alumite"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10)); - } - - else if (evt.Name == "ingotSteel") - { - PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Steel"); - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12)); - } - - //Ores - else if (evt.Name == "oreCopper") - { - Smeltery.addMelting(evt.Ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 2)); - } - - else if (evt.Name == "oreTin") - { - Smeltery.addMelting(evt.Ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 3)); - } - - else if (evt.Name == "oreNaturalAluminum") - { - Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 4)); - } - - else if (evt.Name == "oreCobalt") - { - Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 5)); - } - - else if (evt.Name == "oreArdite") - { - Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 6)); - } - - //Blocks - else if (evt.Name == "blockCopper") - { - Smeltery.addMelting(evt.Ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2)); - } - - else if (evt.Name == "blockTin") - { - Smeltery.addMelting(evt.Ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3)); - } + else if (evt.Name == "ingotTin") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 3)); + } - else if (evt.Name == "blockBronze") - { - Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7)); - } - - else if (evt.Name == "blockNaturalAluminum") - { - Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4)); - } - - else if (evt.Name == "blockCobalt") - { - Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5)); - } - - else if (evt.Name == "blockArdite") - { - Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6)); - } - - else if (evt.Name == "blockManyullyn") - { - Smeltery.addMelting(evt.Ore, 800, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9)); - } - - else if (evt.Name == "blockAluminumBrass") - { - Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8)); - } - - else if (evt.Name == "blockAlumite") - { - Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10)); - } - - else if (evt.Name == "blockSteel") - { - Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12)); - } - - //Dust - else if (evt.Name == "dustCopper") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2)); - } - - else if (evt.Name == "dustTin") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3)); - } + else if (evt.Name == "ingotBronze") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Bronze"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 7)); + } - else if (evt.Name == "dustBronze") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7)); - } - - else if (evt.Name == "dustCobalt") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5)); - } - - else if (evt.Name == "dustArdite") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6)); - } - - else if (evt.Name == "dustManyullyn") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9)); - } - - else if (evt.Name == "dustAluminum") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - else if (evt.Name == "dustNaturalAluminum") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - else if (evt.Name == "dustAluminumBrass") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8)); - } - - else if (evt.Name == "dustAlumite") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10)); - } - - else if (evt.Name == "dustSteel") - { - Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12)); - } - } + else if (evt.Name == "ingotCobalt") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Cobalt"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 5)); + } - public void unfuxOreDictionary () //TODO: This isn't the best - { - ArrayList ores = OreDictionary.getOres("ingotCopper"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Copper"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2)); - } - - ores = OreDictionary.getOres("ingotTin"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3)); - } - - ores = OreDictionary.getOres("ingotBronze"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Bronze"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7)); - } - - ores = OreDictionary.getOres("ingotCobalt"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Cobalt"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5)); - } - - ores = OreDictionary.getOres("ingotArdite"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Ardite"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6)); - } - - ores = OreDictionary.getOres("ingotManyullyn"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Manyullyn"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9)); - } - - ores = OreDictionary.getOres("naturalAluminum"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - ores = OreDictionary.getOres("ingotNaturalAluminum"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - ores = OreDictionary.getOres("ingotAluminumBrass"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8)); - } - - ores = OreDictionary.getOres("ingotAlumite"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Alumite"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10)); - } - - ores = OreDictionary.getOres("ingotSteel"); - for (ItemStack ore : ores) - { - PatternBuilder.instance.registerMaterial(ore, 2, "Steel"); - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12)); - } - - ores = OreDictionary.getOres("oreCopper"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 2)); - } - - ores = OreDictionary.getOres("oreTin"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 3)); - } - - ores = OreDictionary.getOres("oreNaturalAluminum"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 4)); - } - - ores = OreDictionary.getOres("oreCobalt"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 5)); - } - - ores = OreDictionary.getOres("oreArdite"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 6)); - } - - ores = OreDictionary.getOres("blockCopper"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2)); - } - - ores = OreDictionary.getOres("blockTin"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3)); - } - - ores = OreDictionary.getOres("blockBronze"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7)); - } - - ores = OreDictionary.getOres("blockNaturalAluminum"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4)); - } - - ores = OreDictionary.getOres("blockCobalt"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5)); - } - - ores = OreDictionary.getOres("blockArdite"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6)); - } - - ores = OreDictionary.getOres("blockManyullyn"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 800, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9)); - } - - ores = OreDictionary.getOres("blockAluminumBrass"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8)); - } - - ores = OreDictionary.getOres("blockAlumite"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10)); - } - - ores = OreDictionary.getOres("blockSteel"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12)); - } - - ores = OreDictionary.getOres("dustCopper"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2)); - } - - ores = OreDictionary.getOres("dustTin"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3)); - } - - ores = OreDictionary.getOres("dustBronze"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7)); - } - - ores = OreDictionary.getOres("dustCobalt"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5)); - } - - ores = OreDictionary.getOres("dustArdite"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6)); - } - - ores = OreDictionary.getOres("dustManyullyn"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9)); - } - - ores = OreDictionary.getOres("dustNaturalAluminum"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4)); - } - - ores = OreDictionary.getOres("dustAluminumBrass"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8)); - } - - ores = OreDictionary.getOres("dustAlumite"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10)); - } - - ores = OreDictionary.getOres("dustSteel"); - for (ItemStack ore : ores) - { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12)); - } - - ores = OreDictionary.getOres("nuggetIron"); + else if (evt.Name == "ingotArdite") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Ardite"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 6)); + } + + else if (evt.Name == "ingotManyullyn") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Manyullyn"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 9)); + } + + else if (evt.Name == "ingotNaturalAluminum") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 4)); + } + + else if (evt.Name == "naturalAluminum") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 4)); + } + + else if (evt.Name == "ingotAluminumBrass") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 8)); + } + + else if (evt.Name == "ingotAlumite") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Alumite"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 10)); + } + + else if (evt.Name == "ingotSteel") + { + PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Steel"); + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 12)); + } + + //Ores + else if (evt.Name == "oreCopper") + { + Smeltery.addMelting(evt.Ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 2)); + } + + else if (evt.Name == "oreTin") + { + Smeltery.addMelting(evt.Ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 3)); + } + + else if (evt.Name == "oreNaturalAluminum") + { + Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 4)); + } + + else if (evt.Name == "oreCobalt") + { + Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 5)); + } + + else if (evt.Name == "oreArdite") + { + Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 6)); + } + + //Blocks + else if (evt.Name == "blockCopper") + { + Smeltery.addMelting(evt.Ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2)); + } + + else if (evt.Name == "blockTin") + { + Smeltery.addMelting(evt.Ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3)); + } + + else if (evt.Name == "blockBronze") + { + Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7)); + } + + else if (evt.Name == "blockNaturalAluminum") + { + Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4)); + } + + else if (evt.Name == "blockCobalt") + { + Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5)); + } + + else if (evt.Name == "blockArdite") + { + Smeltery.addMelting(evt.Ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6)); + } + + else if (evt.Name == "blockManyullyn") + { + Smeltery.addMelting(evt.Ore, 800, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9)); + } + + else if (evt.Name == "blockAluminumBrass") + { + Smeltery.addMelting(evt.Ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8)); + } + + else if (evt.Name == "blockAlumite") + { + Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10)); + } + + else if (evt.Name == "blockSteel") + { + Smeltery.addMelting(evt.Ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12)); + } + + //Dust + else if (evt.Name == "dustCopper") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 2)); + } + + else if (evt.Name == "dustTin") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 3)); + } + + else if (evt.Name == "dustBronze") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 7)); + } + + else if (evt.Name == "dustCobalt") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 5)); + } + + else if (evt.Name == "dustArdite") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 6)); + } + + else if (evt.Name == "dustManyullyn") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 9)); + } + + else if (evt.Name == "dustAluminum") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 4)); + } + + else if (evt.Name == "dustNaturalAluminum") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 4)); + } + + else if (evt.Name == "dustAluminumBrass") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 8)); + } + + else if (evt.Name == "dustAlumite") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 10)); + } + + else if (evt.Name == "dustSteel") + { + Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 2, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue, 12)); + } + } + + public void unfuxOreDictionary () //TODO: This isn't the best + { + ArrayList ores = OreDictionary.getOres("ingotCopper"); for (ItemStack ore : ores) { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 2)); + PatternBuilder.instance.registerMaterial(ore, 2, "Copper"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 2)); } - - ores = OreDictionary.getOres("nuggetCopper"); + + ores = OreDictionary.getOres("ingotTin"); for (ItemStack ore : ores) { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 2)); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 3)); } - + + ores = OreDictionary.getOres("ingotBronze"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Bronze"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 7)); + } + + ores = OreDictionary.getOres("ingotCobalt"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Cobalt"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 5)); + } + + ores = OreDictionary.getOres("ingotArdite"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Ardite"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 6)); + } + + ores = OreDictionary.getOres("ingotManyullyn"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Manyullyn"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 9)); + } + + ores = OreDictionary.getOres("naturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 4)); + } + + ores = OreDictionary.getOres("ingotNaturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 4)); + } + + ores = OreDictionary.getOres("ingotAluminumBrass"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 8)); + } + + ores = OreDictionary.getOres("ingotAlumite"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Alumite"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 10)); + } + + ores = OreDictionary.getOres("ingotSteel"); + for (ItemStack ore : ores) + { + PatternBuilder.instance.registerMaterial(ore, 2, "Steel"); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 12)); + } + + ores = OreDictionary.getOres("oreCopper"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 2)); + } + + ores = OreDictionary.getOres("oreTin"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 3)); + } + + ores = OreDictionary.getOres("oreNaturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 4)); + } + + ores = OreDictionary.getOres("oreCobalt"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 5)); + } + + ores = OreDictionary.getOres("oreArdite"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 6)); + } + + ores = OreDictionary.getOres("blockCopper"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2)); + } + + ores = OreDictionary.getOres("blockTin"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3)); + } + + ores = OreDictionary.getOres("blockBronze"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7)); + } + + ores = OreDictionary.getOres("blockNaturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4)); + } + + ores = OreDictionary.getOres("blockCobalt"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5)); + } + + ores = OreDictionary.getOres("blockArdite"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6)); + } + + ores = OreDictionary.getOres("blockManyullyn"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 800, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9)); + } + + ores = OreDictionary.getOres("blockAluminumBrass"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8)); + } + + ores = OreDictionary.getOres("blockAlumite"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10)); + } + + ores = OreDictionary.getOres("blockSteel"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12)); + } + + ores = OreDictionary.getOres("dustCopper"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 2)); + } + + ores = OreDictionary.getOres("dustTin"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 3)); + } + + ores = OreDictionary.getOres("dustBronze"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 7)); + } + + ores = OreDictionary.getOres("dustCobalt"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 5)); + } + + ores = OreDictionary.getOres("dustArdite"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 6)); + } + + ores = OreDictionary.getOres("dustManyullyn"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 9)); + } + + ores = OreDictionary.getOres("dustNaturalAluminum"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 4)); + } + + ores = OreDictionary.getOres("dustAluminumBrass"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 8)); + } + + ores = OreDictionary.getOres("dustAlumite"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 10)); + } + + ores = OreDictionary.getOres("dustSteel"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, + 12)); + } + + ores = OreDictionary.getOres("nuggetIron"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue / 9, 2)); + } + + ores = OreDictionary.getOres("nuggetCopper"); + for (ItemStack ore : ores) + { + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue / 9, 2)); + } + ores = OreDictionary.getOres("nuggetTin"); for (ItemStack ore : ores) { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 3)); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue / 9, 3)); } - + ores = OreDictionary.getOres("nuggetNaturalAluminum"); for (ItemStack ore : ores) { - Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 4)); + Smeltery.addMelting(new ItemStack(ore.itemID, 2, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, + TConstruct.ingotLiquidValue / 9, 4)); } - } + } - @ForgeSubscribe - public void bucketFill (FillBucketEvent evt) - { - if (evt.current.getItem() == Item.bucketEmpty && evt.target.typeOfHit == EnumMovingObjectType.TILE) - { - int hitX = evt.target.blockX; - int hitY = evt.target.blockY; - int hitZ = evt.target.blockZ; + @ForgeSubscribe + public void bucketFill (FillBucketEvent evt) + { + if (evt.current.getItem() == Item.bucketEmpty && evt.target.typeOfHit == EnumMovingObjectType.TILE) + { + int hitX = evt.target.blockX; + int hitY = evt.target.blockY; + int hitZ = evt.target.blockZ; - if (!evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current)) + if (!evt.entityPlayer.canPlayerEdit(hitX, hitY, hitZ, evt.target.sideHit, evt.current)) { - return; + return; //return evt.current; } - - int bID = evt.world.getBlockId(hitX, hitY, hitZ); - int meta = -1; - - if (bID == TContent.liquidMetalStill.blockID) - { - LiquidTextureLogic logic = (LiquidTextureLogic) evt.world.getBlockTileEntity(hitX, hitY, hitZ); - meta = logic.getLiquidType(); - } - - if (meta != -1) - { - evt.world.setBlockToAir(hitX, hitY, hitZ); //Set air block - evt.result = new ItemStack(TContent.buckets, 1, meta); - evt.setResult(Result.ALLOW); - } - } - } + + int bID = evt.world.getBlockId(hitX, hitY, hitZ); + int meta = -1; + + if (bID == TContent.liquidMetalStill.blockID) + { + LiquidTextureLogic logic = (LiquidTextureLogic) evt.world.getBlockTileEntity(hitX, hitY, hitZ); + meta = logic.getLiquidType(); + } + + if (meta != -1) + { + evt.world.setBlockToAir(hitX, hitY, hitZ); //Set air block + evt.result = new ItemStack(TContent.buckets, 1, meta); + evt.setResult(Result.ALLOW); + } + } + } } diff --git a/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java b/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java index 039fc068..f26e34c6 100644 --- a/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java +++ b/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java @@ -28,7 +28,7 @@ public class TBaseWorldGenerator implements IWorldGenerator copperSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 2, 12, true); tinSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 3, 12, true); aluminumSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 4, 12, true); - cobaltSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 4, 30, true); + cobaltSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 5, 30, true); ironBush = new OreberryBushGen(TContent.oreBerry.blockID, 12, 12); goldBush = new OreberryBushGen(TContent.oreBerry.blockID, 13, 6); diff --git a/test/TestTickHandler.java b/test/TestTickHandler.java new file mode 100644 index 00000000..fb10b020 --- /dev/null +++ b/test/TestTickHandler.java @@ -0,0 +1,82 @@ +package test; + +import java.util.EnumSet; + +import mods.tinker.tconstruct.client.block.BlockSkinRenderHelper; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.util.EnumMovingObjectType; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.common.ForgeDirection; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import cpw.mods.fml.common.ITickHandler; +import cpw.mods.fml.common.TickType; + +public class TestTickHandler implements ITickHandler +{ + public static Minecraft mc; + //private RenderBlocks renderBlocksInstance = new RenderBlocks(); + + @Override + public void tickStart (EnumSet type, Object... tickData) + { + + } + + @Override + public void tickEnd (EnumSet type, Object... tickData) + { + if (mc.theWorld != null) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(mc.theWorld, mc.thePlayer, false); + mod_Test.mop = movingobjectposition; + } + } + + @Override + public EnumSet ticks () + { + return EnumSet.of(TickType.RENDER); + } + + @Override + public String getLabel () + { + return "render.ghost"; + } + + public MovingObjectPosition getMovingObjectPositionFromPlayer (World par1World, EntityPlayer par2EntityPlayer, boolean par3) + { + float f = 1.0F; + float f1 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * f; + float f2 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * f; + double d0 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double) f; + double d1 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par2EntityPlayer.yOffset; + double d2 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double) f; + Vec3 vec3 = par1World.getWorldVec3Pool().getVecFromPool(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 500.0D; + if (par2EntityPlayer instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP) par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); + return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); + } +} diff --git a/test/XinBuilder.java b/test/XinBuilder.java new file mode 100644 index 00000000..f35364b4 --- /dev/null +++ b/test/XinBuilder.java @@ -0,0 +1,142 @@ +package test; + +import mods.tinker.tconstruct.client.TProxyClient; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumMovingObjectType; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/* + * mDiyo's development building item + * Builds everything on right-click! + */ + +public class XinBuilder extends Item +{ + public XinBuilder(int id) + { + super(id); + setCreativeTab(CreativeTabs.tabMisc); + } + + public Icon getIconFromDamage (int damage) + { + return Item.hoeStone.getIconFromDamage(damage); + } + + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + placeBlock(player); + return stack; + } + + /*public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + System.out.println("Rawr!"); + return true; + }*/ + + @SideOnly(Side.CLIENT) + public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) + { + + } + + @Override + public boolean onEntitySwing (EntityLiving entityLiving, ItemStack stack) + { + if (entityLiving instanceof EntityPlayer && !mod_Test.leftClick) + { + EntityPlayer player = (EntityPlayer) entityLiving; + placeBlock(player); + mod_Test.leftClick = true; + } + return true; + } + + public void placeBlock(EntityPlayer player) + { + MovingObjectPosition mop = this.raytraceFromPlayer(player.worldObj, player, false); + + if (mop != null) + { + int xPos = mop.blockX; + int yPos = mop.blockY; + int zPos = mop.blockZ; + ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit); + switch (sideHit) + { + case UP: + { + yPos += 1; + break; + } + case DOWN: + { + yPos -= 1; + break; + } + case NORTH: + { + zPos -= 1; + break; + } + case SOUTH: + { + zPos += 1; + break; + } + case EAST: + { + xPos += 1; + break; + } + case WEST: + { + xPos -= 1; + break; + } + default: + break; + } + player.worldObj.setBlock(xPos, yPos, zPos, Block.stone.blockID); + } + } + + public MovingObjectPosition raytraceFromPlayer (World par1World, EntityPlayer par2EntityPlayer, boolean par3) + { + float f = 1.0F; + float f1 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * f; + float f2 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * f; + double d0 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double) f; + double d1 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double) f + 1.62D - (double) par2EntityPlayer.yOffset; + double d2 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double) f; + Vec3 vec3 = par1World.getWorldVec3Pool().getVecFromPool(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 500.0D; + if (par2EntityPlayer instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP) par2EntityPlayer).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); + return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); + } +} diff --git a/test/XinStick.java b/test/XinStick.java index 7f29f66f..a9b81a72 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -12,7 +12,7 @@ import net.minecraft.util.Icon; import net.minecraft.world.World; /* - * mDiyo's development testing mod + * mDiyo's development testing item * Does everything on right-click! */ diff --git a/test/mod_Test.java b/test/mod_Test.java index 8e539a25..5feefef5 100644 --- a/test/mod_Test.java +++ b/test/mod_Test.java @@ -1,19 +1,29 @@ package test; -import javax.script.ScriptException; - +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.client.GuiIngameForge; +import net.minecraftforge.client.event.RenderWorldLastEvent; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeSubscribe; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; -import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.common.registry.TickRegistry; +import cpw.mods.fml.relauncher.Side; /* * mDiyo's development testing mod @@ -21,56 +31,199 @@ import cpw.mods.fml.common.registry.LanguageRegistry; */ @Mod(modid = "mod_Test", name = "mod_Test", version = "Test") -public class mod_Test +public class mod_Test { - public static Item xinstick; - public static Item TArmorChestplate; - public static Item negaFood; - public KeyBinding grabKey; - EntityPlayer player; + public static Item xinstick; + public static Item xinbuilder; + public static Item TArmorChestplate; + public static Item negaFood; + public KeyBinding grabKey; + EntityPlayer player; - @PreInit - public void preInit(FMLPreInitializationEvent evt) - { - //System.out.println("Test!"); - } - - @Init - public void init (FMLInitializationEvent evt) - { - - } + public static int x; + public static int y; + public static int z; + public static MovingObjectPosition mop; + Minecraft mc; + public static boolean leftClick; - @PostInit - public void postInit (FMLPostInitializationEvent evt) throws ScriptException - { - /*TArmorChestplate = new TArmor(4598, EnumArmorMaterial.CLOTH, 1, 1); - GameRegistry.addRecipe(new ItemStack(TArmorChestplate, 64, 0), "s", 's', Block.dirt); - GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().chiselDiamond, 64, 0), "ss", 's', Block.dirt); - GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, 0), "s", "s", 's', Block.dirt);*/ + @PreInit + public void preInit (FMLPreInitializationEvent evt) + { + } - /*ScriptEngineManager manager = new ScriptEngineManager(); - ScriptEngine engine = manager.getEngineByName("ruby"); - InputStream resource = mod_Test.class.getResourceAsStream("/test/JTest.rb"); - engine.eval(new InputStreamReader(resource));*/ - //JTest jRubyTest = new JTest(); + @Init + public void init (FMLInitializationEvent evt) + { + /*TickRegistry.registerTickHandler(new TestTickHandler(), Side.CLIENT); + TestTickHandler.mc = Minecraft.getMinecraft(); + MinecraftForge.EVENT_BUS.register(this); + mc = Minecraft.getMinecraft();*/ + } - // Cycle through metadata, don't go over the maximum or it will crash on mouseover - /*for (int i = 0; i < 15; i++) - { - //GameRegistry.addRecipe(new ItemStack(TConstructContent.woodPattern, 1, i + 1), "s", 's', new ItemStack(TConstructContent.woodPattern, 1, i)); - GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "s", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i)); - GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "ss", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i)); - }*/ + @ForgeSubscribe + public void lastRender (RenderWorldLastEvent event) + { + //GuiIngameForge.renderCrosshairs = false; + if (mc.thePlayer != null) + { + ItemStack equipstack = mc.thePlayer.getCurrentEquippedItem(); + if (equipstack != null && equipstack.getItem() == xinbuilder) + { + GuiIngameForge.renderCrosshairs = false; + if (mop != null) + { + double xPos = mop.blockX; + double yPos = mop.blockY; + double zPos = mop.blockZ; + ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit); + switch (sideHit) + { + case UP: + { + yPos += 1; + break; + } + case DOWN: + { + yPos -= 1; + break; + } + case NORTH: + { + zPos -= 1; + break; + } + case SOUTH: + { + zPos += 1; + break; + } + case EAST: + { + xPos += 1; + break; + } + case WEST: + { + xPos -= 1; + break; + } + default: + break; + } - // ModLoader.addName(xinstick, "Stick of Power"); - } + Tessellator ts = Tessellator.instance; + Tessellator.renderingWorldRenderer = false; + //event.context.renderEngine.bindTexture("/terrain.png"); + int texture = event.context.renderEngine.getTexture("/mods/tinker/textures/blocks/compressed_steel.png"); + //ts.startDrawing(); + //System.out.println("Rawr!" +xPos); + //GL11.glTranslated(xPos, yPos, zPos); + //GL11.glScalef(2, 2, 2); + //renderBlockBox(ts); - static - { - xinstick = new XinStick(10000).setUnlocalizedName("xinstick"); - negaFood = new NegaFood().setUnlocalizedName("negaFood"); - LanguageRegistry.addName(xinstick, "XinBroken"); - LanguageRegistry.addName(negaFood, "Negafood"); - } + double xD = xPos + 0.5F; + double yD = yPos + 0.5F; + double zD = zPos + 0.5F; + double iPX = mc.thePlayer.prevPosX + (mc.thePlayer.posX - mc.thePlayer.prevPosX) * event.partialTicks; + double iPY = mc.thePlayer.prevPosY + (mc.thePlayer.posY - mc.thePlayer.prevPosY) * event.partialTicks; + double iPZ = mc.thePlayer.prevPosZ + (mc.thePlayer.posZ - mc.thePlayer.prevPosZ) * event.partialTicks; + + GL11.glDepthMask(false); + GL11.glDisable(GL11.GL_CULL_FACE); + + for (int i = 0; i < 6; i++) + { + ForgeDirection forgeDir = ForgeDirection.getOrientation(i); + int zCorrection = i == 2 ? -1 : 1; + GL11.glPushMatrix(); + GL11.glTranslated(-iPX + xD, -iPY + yD, -iPZ + zD); + GL11.glScalef(0.999F, 0.999F, 0.999F); + GL11.glRotatef(90, forgeDir.offsetX, forgeDir.offsetY, forgeDir.offsetZ); + GL11.glTranslated(0, 0, 0.5f * zCorrection); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + renderPulsingQuad(texture, 0.75F); + GL11.glPopMatrix(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDepthMask(true); + + //GL11.glTranslated(iPX, iPY, iPZ); + /*event.context.globalRenderBlocks.renderStandardBlock(Block.blockIron, xPos, yPos, zPos); + event.context.globalRenderBlocks.renderStandardBlock(Block.blockIron, -64, 91, 192);*/ + //event.context.globalRenderBlocks.setRenderBounds(-1, -1, -1, 2, 2, 2); + //event.context.globalRenderBlocks.renderStandardBlock(Block.blockIron, 0, 0, 0); + } + + } + else + { + GuiIngameForge.renderCrosshairs = true; + } + } + } + + public static void renderPulsingQuad (int texture, float maxTransparency) + { + + float pulseTransparency = getPulseValue() * maxTransparency / 3000f; + + GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); + Tessellator tessellator = Tessellator.instance; + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1, 1, 1, pulseTransparency); + + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(1, 1, 1, pulseTransparency); + + tessellator.addVertexWithUV(-0.5D, 0.5D, 0F, 0, 1); + tessellator.addVertexWithUV(0.5D, 0.5D, 0F, 1, 1); + tessellator.addVertexWithUV(0.5D, -0.5D, 0F, 1, 0); + tessellator.addVertexWithUV(-0.5D, -0.5D, 0F, 0, 0); + + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + private static int getPulseValue () + { + return 2000; + + /*if (doInc) + { + pulse += 8; + } + else + { + pulse -= 8; + } + + if (pulse == 3000) + { + doInc = false; + } + + if (pulse == 0) + { + doInc = true; + } + + return pulse;*/ + } + + static + { + xinstick = new XinStick(10000).setUnlocalizedName("xinstick"); + negaFood = new NegaFood().setUnlocalizedName("negaFood"); + xinbuilder = new XinBuilder(10002).setUnlocalizedName("xinbuilder"); + LanguageRegistry.addName(xinstick, "XinStick"); + LanguageRegistry.addName(negaFood, "Negafood"); + LanguageRegistry.addName(xinbuilder, "XinBuilder"); + } }