Unified Casting Theory

This commit is contained in:
mDiyo 2013-04-30 20:22:21 -07:00
parent 87097b0b42
commit b547187c11
15 changed files with 1097 additions and 705 deletions

View File

@ -3,6 +3,7 @@ package mods.tinker.tconstruct;
import mods.tinker.tconstruct.common.TContent; import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.common.TProxyCommon; import mods.tinker.tconstruct.common.TProxyCommon;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.util.TabTools; import mods.tinker.tconstruct.library.util.TabTools;
import mods.tinker.tconstruct.util.PHConstruct; import mods.tinker.tconstruct.util.PHConstruct;
import mods.tinker.tconstruct.util.TCraftingHandler; import mods.tinker.tconstruct.util.TCraftingHandler;
@ -33,7 +34,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, EBXL API * @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) @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
public class TConstruct public class TConstruct
{ {
@ -55,6 +56,9 @@ public class TConstruct
TConstructRegistry.materialTab = new TabTools("TConstructMaterials"); TConstructRegistry.materialTab = new TabTools("TConstructMaterials");
TConstructRegistry.toolTab = new TabTools("TConstructTools"); TConstructRegistry.toolTab = new TabTools("TConstructTools");
TConstructRegistry.blockTab = new TabTools("TConstructBlocks"); TConstructRegistry.blockTab = new TabTools("TConstructBlocks");
tableCasting = new LiquidCasting();
basinCasting = new LiquidCasting();
content = new TContent(); content = new TContent();
events = new TEventHandler(); events = new TEventHandler();
@ -100,8 +104,20 @@ public class TConstruct
content.modIntegration(); content.modIntegration();
} }
public static LiquidCasting getTableCasting()
{
return tableCasting;
}
public static LiquidCasting getBasinCasting()
{
return basinCasting;
}
public static TEventHandler events; public static TEventHandler events;
public static TPlayerHandler playerTracker; public static TPlayerHandler playerTracker;
public static TContent content; public static TContent content;
public static LiquidCasting tableCasting;
public static LiquidCasting basinCasting;
} }

View File

@ -3,7 +3,6 @@ package mods.tinker.tconstruct.blocks.logic;
import mods.tinker.tconstruct.TConstruct; import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.library.blocks.InventoryLogic; import mods.tinker.tconstruct.library.blocks.InventoryLogic;
import mods.tinker.tconstruct.library.crafting.CastingRecipe; import mods.tinker.tconstruct.library.crafting.CastingRecipe;
import mods.tinker.tconstruct.library.crafting.LiquidBlockCasting;
import mods.tinker.tconstruct.library.util.IPattern; import mods.tinker.tconstruct.library.util.IPattern;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container; 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; ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
else else
ret = LiquidBlockCasting.instance.getCastingAmount(this.liquid, inv); ret = TConstruct.basinCasting.getCastingAmount(this.liquid, inv);
return ret; return ret;
} }
@ -109,7 +108,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT
if (this.liquid == null) if (this.liquid == null)
{ {
CastingRecipe recipe = LiquidBlockCasting.instance.getCastingRecipe(resource, inventory[0]); CastingRecipe recipe = TConstruct.basinCasting.getCastingRecipe(resource, inventory[0]);
if (recipe == null) if (recipe == null)
return 0; return 0;
this.capacity = updateCapacity(recipe.castingMetal.amount); this.capacity = updateCapacity(recipe.castingMetal.amount);
@ -150,7 +149,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT
if (doFill && roomInTank > 0) if (doFill && roomInTank > 0)
{ {
renderOffset = roomInTank; renderOffset = roomInTank;
castingDelay = LiquidBlockCasting.instance.getCastingDelay(this.liquid, inventory[0]); castingDelay = TConstruct.basinCasting.getCastingDelay(this.liquid, inventory[0]);
this.liquid.amount = this.capacity; this.liquid.amount = this.capacity;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true; needsUpdate = true;
@ -276,7 +275,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT
public void castLiquid () public void castLiquid ()
{ {
CastingRecipe recipe = LiquidBlockCasting.instance.getCastingRecipe(liquid, inventory[0]); CastingRecipe recipe = TConstruct.basinCasting.getCastingRecipe(liquid, inventory[0]);
if (recipe != null) if (recipe != null)
{ {
inventory[1] = recipe.getResult(); inventory[1] = recipe.getResult();

View File

@ -81,7 +81,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5; ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5;
else else
ret = LiquidCasting.instance.getCastingAmount(this.liquid, inv); ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv);
return ret; return ret;
} }
@ -109,7 +109,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
if (this.liquid == null) if (this.liquid == null)
{ {
CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(resource, inventory[0]); CastingRecipe recipe = TConstruct.tableCasting.getCastingRecipe(resource, inventory[0]);
if (recipe == null) if (recipe == null)
return 0; return 0;
this.capacity = updateCapacity(recipe.castingMetal.amount); this.capacity = updateCapacity(recipe.castingMetal.amount);
@ -150,7 +150,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
if (doFill && roomInTank > 0) if (doFill && roomInTank > 0)
{ {
renderOffset = roomInTank; renderOffset = roomInTank;
castingDelay = LiquidCasting.instance.getCastingDelay(this.liquid, inventory[0]); castingDelay = TConstruct.tableCasting.getCastingDelay(this.liquid, inventory[0]);
this.liquid.amount = this.capacity; this.liquid.amount = this.capacity;
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
needsUpdate = true; needsUpdate = true;
@ -276,7 +276,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT
public void castLiquid () public void castLiquid ()
{ {
CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(liquid, inventory[0]); CastingRecipe recipe = TConstruct.tableCasting.getCastingRecipe(liquid, inventory[0]);
if (recipe != null) if (recipe != null)
{ {
inventory[1] = recipe.getResult(); inventory[1] = recipe.getResult();

View File

@ -69,7 +69,6 @@ import mods.tinker.tconstruct.util.player.ArmorExtended;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.model.ModelSlime; import net.minecraft.client.model.ModelSlime;
import net.minecraft.client.particle.EntityAuraFX; 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.EntitySpellParticleFX;
import net.minecraft.client.particle.EntitySplashFX; import net.minecraft.client.particle.EntitySplashFX;
import net.minecraft.client.particle.EntitySuspendFX; 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.RenderCreeper;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.GameSettings;

View File

@ -62,8 +62,8 @@ public class TankRender implements ISimpleBlockRenderingHandler
{ {
renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125);
renderer.renderStandardBlock(block, x, y + 1, z); 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); renderer.renderStandardBlock(block, x, y, z);
} }
return true; return true;

View File

@ -35,10 +35,10 @@ import mods.tinker.tconstruct.entity.projectile.DaggerEntity;
import mods.tinker.tconstruct.items.CraftingItem; import mods.tinker.tconstruct.items.CraftingItem;
import mods.tinker.tconstruct.items.FilledBucket; import mods.tinker.tconstruct.items.FilledBucket;
import mods.tinker.tconstruct.items.HeartContainer; import mods.tinker.tconstruct.items.HeartContainer;
import mods.tinker.tconstruct.items.Manual;
import mods.tinker.tconstruct.items.MetalPattern; import mods.tinker.tconstruct.items.MetalPattern;
import mods.tinker.tconstruct.items.OreBerries; import mods.tinker.tconstruct.items.OreBerries;
import mods.tinker.tconstruct.items.Pattern; import mods.tinker.tconstruct.items.Pattern;
import mods.tinker.tconstruct.items.Manual;
import mods.tinker.tconstruct.items.StrangeFood; import mods.tinker.tconstruct.items.StrangeFood;
import mods.tinker.tconstruct.items.TitleIcon; import mods.tinker.tconstruct.items.TitleIcon;
import mods.tinker.tconstruct.items.ToolPart; 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.items.tools.Shovel;
import mods.tinker.tconstruct.library.TConstructRegistry; import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry; 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.LiquidCasting;
import mods.tinker.tconstruct.library.crafting.PatternBuilder; import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.crafting.Smeltery; 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.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid; import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -230,8 +227,6 @@ public class TContent implements IFuelHandler
registerBlocks(); registerBlocks();
registerItems(); registerItems();
registerMaterials(); registerMaterials();
addToolRecipes();
addSmelteryRecipes();
addCraftingRecipes(); addCraftingRecipes();
setupToolTabs(); setupToolTabs();
} }
@ -533,7 +528,7 @@ public class TContent implements IFuelHandler
public static Item[] patternOutputs; public static Item[] patternOutputs;
public static LiquidStack[] liquids; public static LiquidStack[] liquids;
void addToolRecipes () void addCraftingRecipes ()
{ {
/*List<ItemStack> removeTools = new ArrayList<ItemStack>(); /*List<ItemStack> removeTools = new ArrayList<ItemStack>();
if (PHConstruct.disableWoodTools) 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[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free"));
tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free")); tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free"));
//Smeltery
ItemStack ingotcast = new ItemStack(metalPattern, 1, 0); ItemStack ingotcast = new ItemStack(metalPattern, 1, 0);
LiquidCasting lc = LiquidCasting.instance; LiquidCasting tableCasting = TConstructRegistry.instance.getTableCasting();
//Blank //Blank
lc.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, 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 * 2, 1), 80);
//Ingots //Ingots
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 80); //Iron tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 80); //steel
//Buckets //Buckets
ItemStack bucket = new ItemStack(Item.bucketEmpty); 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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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 tableCasting.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, 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), 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), 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); ItemStack cast = new ItemStack(metalPattern, 1, iter + 1);
for (int iterTwo = 0; iterTwo < liquids.length; iterTwo++) 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); * TConstruct.ingotLiquidValue / 2, liquids[iterTwo].itemMeta), cast, 50);
} }
} }
LiquidBlockCasting lbc = LiquidBlockCasting.instance; LiquidCasting basinCasting = TConstructRegistry.getBasinCasting();
lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 basinCasting.addCastingRecipe(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 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<ToolCore> tool = new WeakReference<ToolCore>(null);
void addSmelteryRecipes ()
{
//Ore //Ore
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); 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)); 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, 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, 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 Smeltery.addMelting(new ItemStack(oreBerries, 4, 4), metalBlock.blockID, 6, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 4)); //Aluminum
}
//Crafting
void addCraftingRecipes ()
{
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 0), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', Block.workbench); 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, 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)); 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, 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 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.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(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, 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, 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(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(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 //Smeltery
ItemStack searedBrick = new ItemStack(materials, 1, 2); ItemStack searedBrick = new ItemStack(materials, 1, 2);
@ -881,7 +870,7 @@ public class TContent implements IFuelHandler
TConstructRegistry.toolTab.init(tool); TConstructRegistry.toolTab.init(tool);
} }
public static LiquidStack[] liquidIcons; public static LiquidStack[] liquidIcons = new LiquidStack[0];
public static String[] liquidNames; public static String[] liquidNames;
public void oreRegistry () public void oreRegistry ()

View File

@ -1,11 +1,15 @@
package mods.tinker.tconstruct.library; package mods.tinker.tconstruct.library;
import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; 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.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial; import mods.tinker.tconstruct.library.tools.ToolMaterial;
import mods.tinker.tconstruct.library.util.TabTools; import mods.tinker.tconstruct.library.util.TabTools;
import net.minecraft.block.Block;
import net.minecraft.item.Item; import net.minecraft.item.Item;
/** A registry to store any relevant API work /** A registry to store any relevant API work
@ -64,4 +68,46 @@ public class TConstructRegistry
{ {
return (toolMaterialStrings.get(key)); 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;
}
}
} }

View File

@ -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<CastingRecipe> blockCasts = new ArrayList<CastingRecipe>();
/** 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<CastingRecipe> getCastingRecipes()
{
return blockCasts;
}
}

View File

@ -11,7 +11,7 @@ import net.minecraftforge.liquids.LiquidStack;
/* Melting becomes hardened */ /* Melting becomes hardened */
public class LiquidCasting public class LiquidCasting
{ {
public static LiquidCasting instance = new LiquidCasting(); //public static LiquidCasting instance = new LiquidCasting();
private ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>(); private ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>();
/** Adds a casting recipe /** Adds a casting recipe
@ -22,9 +22,9 @@ public class LiquidCasting
* @param consume Whether the item should be consumed while casting * @param consume Whether the item should be consumed while casting
* @param delay Time to cast in ticks * @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 /** 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 cast The empty item to cast with. ex Ingot Cast
* @param delay Time to cast in ticks * @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); 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 metal Liquid to be used in casting. This also decides how much metal is consumed
* @param delay Time to cast in ticks * @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); addCastingRecipe(output, metal, null, false, delay);
} }

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@ public class TBaseWorldGenerator implements IWorldGenerator
copperSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 2, 12, true); copperSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 2, 12, true);
tinSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 3, 12, true); tinSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 3, 12, true);
aluminumSurface = new SurfaceOreGen(TContent.oreGravel.blockID, 4, 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); ironBush = new OreberryBushGen(TContent.oreBerry.blockID, 12, 12);
goldBush = new OreberryBushGen(TContent.oreBerry.blockID, 13, 6); goldBush = new OreberryBushGen(TContent.oreBerry.blockID, 13, 6);

82
test/TestTickHandler.java Normal file
View File

@ -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<TickType> type, Object... tickData)
{
}
@Override
public void tickEnd (EnumSet<TickType> type, Object... tickData)
{
if (mc.theWorld != null)
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(mc.theWorld, mc.thePlayer, false);
mod_Test.mop = movingobjectposition;
}
}
@Override
public EnumSet<TickType> 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);
}
}

142
test/XinBuilder.java Normal file
View File

@ -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);
}
}

View File

@ -12,7 +12,7 @@ import net.minecraft.util.Icon;
import net.minecraft.world.World; import net.minecraft.world.World;
/* /*
* mDiyo's development testing mod * mDiyo's development testing item
* Does everything on right-click! * Does everything on right-click!
*/ */

View File

@ -1,19 +1,29 @@
package test; 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.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; 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;
import cpw.mods.fml.common.Mod.Init; 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.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent; 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.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.LanguageRegistry; 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 * 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") @Mod(modid = "mod_Test", name = "mod_Test", version = "Test")
public class mod_Test public class mod_Test
{ {
public static Item xinstick; public static Item xinstick;
public static Item TArmorChestplate; public static Item xinbuilder;
public static Item negaFood; public static Item TArmorChestplate;
public KeyBinding grabKey; public static Item negaFood;
EntityPlayer player; public KeyBinding grabKey;
EntityPlayer player;
@PreInit public static int x;
public void preInit(FMLPreInitializationEvent evt) public static int y;
{ public static int z;
//System.out.println("Test!"); public static MovingObjectPosition mop;
} Minecraft mc;
public static boolean leftClick;
@Init
public void init (FMLInitializationEvent evt)
{
}
@PostInit @PreInit
public void postInit (FMLPostInitializationEvent evt) throws ScriptException public void preInit (FMLPreInitializationEvent evt)
{ {
/*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);*/
/*ScriptEngineManager manager = new ScriptEngineManager(); @Init
ScriptEngine engine = manager.getEngineByName("ruby"); public void init (FMLInitializationEvent evt)
InputStream resource = mod_Test.class.getResourceAsStream("/test/JTest.rb"); {
engine.eval(new InputStreamReader(resource));*/ /*TickRegistry.registerTickHandler(new TestTickHandler(), Side.CLIENT);
//JTest jRubyTest = new JTest(); 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 @ForgeSubscribe
/*for (int i = 0; i < 15; i++) public void lastRender (RenderWorldLastEvent event)
{ {
//GameRegistry.addRecipe(new ItemStack(TConstructContent.woodPattern, 1, i + 1), "s", 's', new ItemStack(TConstructContent.woodPattern, 1, i)); //GuiIngameForge.renderCrosshairs = false;
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "s", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i)); if (mc.thePlayer != null)
GameRegistry.addRecipe(new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i + 1), "ss", 's', new ItemStack(InfiBlocks.getContentInstance().storageBlock, 64, i)); {
}*/ 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 double xD = xPos + 0.5F;
{ double yD = yPos + 0.5F;
xinstick = new XinStick(10000).setUnlocalizedName("xinstick"); double zD = zPos + 0.5F;
negaFood = new NegaFood().setUnlocalizedName("negaFood"); double iPX = mc.thePlayer.prevPosX + (mc.thePlayer.posX - mc.thePlayer.prevPosX) * event.partialTicks;
LanguageRegistry.addName(xinstick, "XinBroken"); double iPY = mc.thePlayer.prevPosY + (mc.thePlayer.posY - mc.thePlayer.prevPosY) * event.partialTicks;
LanguageRegistry.addName(negaFood, "Negafood"); 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");
}
} }