This commit is contained in:
mDiyo committed 2013-03-03 20:25:43 -08:00
1 parent 3cf838e03c
commit 01c4a785eb
19 files changed
+765 -606

No files matched your search

+7 -2
View File
@@ -34,7 +34,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author: mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.4.7_1.1.14")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.4.7_1.1.14", dependencies = "before:*")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
@@ -46,11 +46,16 @@ public class TConstruct
/* Proxies for sides, used for graphics processing */
@SidedProxy(clientSide = "tinker.tconstruct.client.TProxyClient", serverSide = "tinker.tconstruct.TProxyCommon")
public static TProxyCommon proxy;
public TConstruct()
{
//Take that, any mod that does ore dictionary registration in preinit!
MinecraftForge.EVENT_BUS.register(new TEventHandler());
}
@PreInit
public void preInit (FMLPreInitializationEvent evt)
{
MinecraftForge.EVENT_BUS.register(new TEventHandler());
PHConstruct.initProps();
materialTab = new TabTools("TConstructMaterials");
toolTab = new TabTools("TConstructTools");
+11 -149
View File
@@ -271,7 +271,7 @@ public class TContent implements IFuelHandler
TConstructRegistry.addToolMaterial(39, "Tartarite", 3, 7, 3000, 1400, 5, 1.6667F, 4, 0f);
PatternBuilder pb = PatternBuilder.instance;
pb.registerFullMaterial(Block.planks, 2, "Wood", new ItemStack(Item.stick), new ItemStack(Item.stick), 0);
pb.registerFullMaterial(Block.planks, 2, "Wood", new ItemStack(Item.stick, 2), new ItemStack(Item.stick), 0);
pb.registerFullMaterial(Block.stone, 2, "Stone", 1);
pb.registerMaterial(Block.cobblestone, 2, "Stone");
pb.registerFullMaterial(Item.ingotIron, 2, "Iron", 2);
@@ -281,9 +281,14 @@ public class TContent implements IFuelHandler
pb.registerFullMaterial(Block.obsidian, 2, "Obsidian", 6);
pb.registerFullMaterial(Block.netherrack, 2, "Netherrack", 7);
pb.registerFullMaterial(new ItemStack(materials, 1, 1), 2, "Slime", new ItemStack(toolShard, 1, 8), new ItemStack(toolRod, 1, 8), 8);
pb.registerFullMaterial(new ItemStack(materials, 1, 0), 2, "Paper", new ItemStack(Item.paper), new ItemStack(toolRod, 1, 9), 9);
pb.registerFullMaterial(new ItemStack(materials, 1, 0), 2, "Paper", new ItemStack(Item.paper, 2), new ItemStack(toolRod, 1, 9), 9);
pb.registerMaterialSet("Cobalt", new ItemStack(toolShard, 1, 10), new ItemStack(toolRod, 1, 10), 10);
pb.registerMaterialSet("Ardite", new ItemStack(toolShard, 1, 11), new ItemStack(toolRod, 1, 11), 11);
pb.registerMaterialSet("Manyullyn", new ItemStack(toolShard, 1, 12), new ItemStack(toolRod, 1, 12), 12);
pb.registerMaterialSet("Copper", new ItemStack(toolShard, 1, 13), new ItemStack(toolRod, 1, 13), 13);
pb.registerMaterialSet("Bronze", new ItemStack(toolShard, 1, 14), new ItemStack(toolRod, 1, 14), 14);
pb.registerMaterialSet("Alumite", new ItemStack(toolShard, 1, 15), new ItemStack(toolRod, 1, 15), 15);
pb.registerMaterialSet("Steel", new ItemStack(toolShard, 1, 16), new ItemStack(toolRod, 1, 16), 16);
pb.addToolPattern((IPattern) woodPattern);
}
@@ -379,9 +384,9 @@ public class TContent implements IFuelHandler
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 1));
//Items
Smeltery.addMelting(new ItemStack(Item.ingotIron, 8), Block.blockSteel.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 8), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 8), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 1));
Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockSteel.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue/9, 1));
//Blocks
Smeltery.addMelting(Block.blockSteel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 0));
@@ -491,7 +496,7 @@ public class TContent implements IFuelHandler
OreDictionary.registerOre("blockCopper", new ItemStack(metalBlock, 1, 3));
OreDictionary.registerOre("blockBronze", new ItemStack(metalBlock, 1, 4));
OreDictionary.registerOre("blockTin", new ItemStack(metalBlock, 1, 5));
OreDictionary.registerOre("blockAluminum", new ItemStack(metalBlock, 1, 6));
OreDictionary.registerOre("blockNaturalAluminum", new ItemStack(metalBlock, 1, 6));
OreDictionary.registerOre("blockAluminumBrass", new ItemStack(metalBlock, 1, 7));
OreDictionary.registerOre("blockAlumite", new ItemStack(metalBlock, 1, 8));
OreDictionary.registerOre("blockSteel", new ItemStack(metalBlock, 1, 9));
@@ -508,149 +513,6 @@ public class TContent implements IFuelHandler
public void modIntegration ()
{
/* Liquids */
//Block[] liquids = new Block[] { ironStill, goldStill, copperStill, tinStill, aluminumStill, cobaltStill,
//arditeStill, bronzeStill, alBrassStill, manyullynStill, alumiteStill, obsidianStill, steelStill };
/* Ore Dictionary */
//Ingots
ArrayList<ItemStack> copperIngots = OreDictionary.getOres("ingotCopper");
for (ItemStack copper : copperIngots)
{
PatternBuilder.instance.registerMaterial(copper, 2, "Copper");
Smeltery.addMelting(copper, metalBlock.blockID, 3, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2));
}
ArrayList<ItemStack> tinIngots = OreDictionary.getOres("ingotTin");
for (ItemStack tin : tinIngots)
{
Smeltery.addMelting(tin, metalBlock.blockID, 5, 175, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3));
}
ArrayList<ItemStack> bronzeIngots = OreDictionary.getOres("ingotBronze");
for (ItemStack bronze : bronzeIngots)
{
PatternBuilder.instance.registerMaterial(bronze, 2, "Bronze");
Smeltery.addMelting(bronze, metalBlock.blockID, 4, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7));
}
ArrayList<ItemStack> cobaltIngots = OreDictionary.getOres("ingotCobalt");
for (ItemStack cobalt : cobaltIngots)
{
Smeltery.addMelting(cobalt, metalBlock.blockID, 0, 650, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5));
}
ArrayList<ItemStack> arditeIngots = OreDictionary.getOres("ingotArdite");
for (ItemStack ardite : arditeIngots)
{
Smeltery.addMelting(ardite, metalBlock.blockID, 1, 650, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6));
}
ArrayList<ItemStack> aluminumIngots = OreDictionary.getOres("ingotAluminum");
for (ItemStack aluminum : aluminumIngots)
{
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4));
}
ArrayList<ItemStack> aluminumRaw = OreDictionary.getOres("naturalAluminum");
for (ItemStack aluminum : aluminumRaw)
{
Smeltery.addMelting(aluminum, metalBlock.blockID, 6, 250, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4));
}
ArrayList<ItemStack> manyullynIngots = OreDictionary.getOres("ingotManyullyn");
for (ItemStack manyullyn : manyullynIngots)
{
Smeltery.addMelting(manyullyn, metalBlock.blockID, 2, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9));
}
ArrayList<ItemStack> alBrassIngots = OreDictionary.getOres("ingotAluminumBrass");
for (ItemStack alBrass : alBrassIngots)
{
Smeltery.addMelting(alBrass, metalBlock.blockID, 7, 350, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8));
}
ArrayList<ItemStack> alumiteIngots = OreDictionary.getOres("ingotAlumite");
for (ItemStack alumite : alumiteIngots)
{
Smeltery.addMelting(alumite, metalBlock.blockID, 8, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10));
}
ArrayList<ItemStack> steelIngots = OreDictionary.getOres("ingotSteel");
for (ItemStack steel : steelIngots)
{
Smeltery.addMelting(steel, metalBlock.blockID, 9, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12));
}
//Ores
ArrayList<ItemStack> cobaltOres = OreDictionary.getOres("oreCobalt");
for (ItemStack cobalt : cobaltOres)
{
Smeltery.addMelting(cobalt, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 5));
}
ArrayList<ItemStack> arditeOres = OreDictionary.getOres("oreArdite");
for (ItemStack ardite : arditeOres)
{
Smeltery.addMelting(ardite, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 6));
}
ArrayList<ItemStack> copperOres = OreDictionary.getOres("oreCopper");
for (ItemStack copper : copperOres)
{
Smeltery.addMelting(copper, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 2));
}
ArrayList<ItemStack> tinOres = OreDictionary.getOres("oreTin");
for (ItemStack tin : tinOres)
{
Smeltery.addMelting(tin, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 3));
}
ArrayList<ItemStack> aluminumOres = OreDictionary.getOres("oreNaturalAluminum");
for (ItemStack aluminum : aluminumOres)
{
Smeltery.addMelting(aluminum, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 4));
}
//Blocks
ArrayList<ItemStack> copperblocks = OreDictionary.getOres("blockCopper");
for (ItemStack copper : copperblocks)
{
Smeltery.addMelting(copper, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2));
}
ArrayList<ItemStack> tinblocks = OreDictionary.getOres("blockTin");
for (ItemStack tin : tinblocks)
{
Smeltery.addMelting(tin, 175, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3));
}
ArrayList<ItemStack> bronzeblocks = OreDictionary.getOres("blockBronze");
for (ItemStack bronze : bronzeblocks)
{
Smeltery.addMelting(bronze, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7));
}
ArrayList<ItemStack> cobaltblocks = OreDictionary.getOres("blockCobalt");
for (ItemStack cobalt : cobaltblocks)
{
Smeltery.addMelting(cobalt, 650, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5));
}
ArrayList<ItemStack> arditeblocks = OreDictionary.getOres("blockArdite");
for (ItemStack ardite : arditeblocks)
{
Smeltery.addMelting(ardite, 650, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6));
}
ArrayList<ItemStack> aluminumblocks = OreDictionary.getOres("blockAluminum");
for (ItemStack aluminum : aluminumblocks)
{
Smeltery.addMelting(aluminum, 250, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4));
}
ArrayList<ItemStack> manyullynblocks = OreDictionary.getOres("blockManyullyn");
for (ItemStack manyullyn : manyullynblocks)
{
Smeltery.addMelting(manyullyn, 750, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9));
}
ArrayList<ItemStack> alBrassblocks = OreDictionary.getOres("blockAluminumBrass");
for (ItemStack alBrass : alBrassblocks)
{
Smeltery.addMelting(alBrass, 350, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8));
}
ArrayList<ItemStack> alumiteblocks = OreDictionary.getOres("blockAlumite");
for (ItemStack alumite : alumiteblocks)
{
Smeltery.addMelting(alumite, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10));
}
ArrayList<ItemStack> steelblocks = OreDictionary.getOres("blockSteel");
for (ItemStack steel : steelblocks)
{
Smeltery.addMelting(steel, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12));
}
/* IC2 */
ItemStack reBattery = ic2.api.Items.getItem("reBattery");
if (reBattery != null)
+193 -46
View File
@@ -6,7 +6,10 @@ import net.minecraft.util.EnumMovingObjectType;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
import tinker.tconstruct.crafting.PatternBuilder;
import tinker.tconstruct.crafting.Smeltery;
import tinker.tconstruct.logic.LiquidTextureLogic;
public class TEventHandler
@@ -17,25 +20,209 @@ public class TEventHandler
if (evt.Name == "battery")
TConstruct.content.modE.batteries.add(evt.Ore);
if (evt.Name == "basicCircuit")
else if (evt.Name == "basicCircuit")
TConstruct.content.modE.circuits.add(evt.Ore);
/*if (evt.Name == "ingotCopper")
//Ingots
else if (evt.Name == "ingotCopper")
{
PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Copper");
Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, 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, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3));
}
if (evt.Name == "ingotBronze")
else if (evt.Name == "ingotBronze")
{
PatternBuilder.instance.registerMaterial(evt.Ore, 2, "Bronze");
}*/
Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, 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, 4, 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, 4, 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, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9));
}
else if (evt.Name == "ingotAluminum")
{
Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, 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, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12));
}
}
@ForgeSubscribe
public void bucketFill (FillBucketEvent evt)
{
System.out.println("Fired");
if (evt.current.getItem() == Item.bucketEmpty && evt.target.typeOfHit == EnumMovingObjectType.TILE)
{
int hitX = evt.target.blockX;
@@ -57,46 +244,6 @@ public class TEventHandler
meta = logic.getLiquidType();
}
//Want switch, can't do it!
/*if (bID == TContent.ironStill.blockID)
meta = 0;
else if (bID == TContent.goldStill.blockID)
meta = 1;
else if (bID == TContent.copperStill.blockID)
meta = 2;
else if (bID == TContent.tinStill.blockID)
meta = 3;
else if (bID == TContent.aluminumStill.blockID)
meta = 4;
else if (bID == TContent.cobaltStill.blockID)
meta = 5;
else if (bID == TContent.arditeStill.blockID)
meta = 6;
else if (bID == TContent.bronzeStill.blockID)
meta = 7;
else if (bID == TContent.alBrassStill.blockID)
meta = 8;
else if (bID == TContent.manyullynStill.blockID)
meta = 9;
else if (bID == TContent.alumiteStill.blockID)
meta = 10;
else if (bID == TContent.obsidianStill.blockID)
meta = 11;
else if (bID == TContent.steelStill.blockID)
meta = 12;*/
if (meta != -1)
{
evt.world.setBlockWithNotify(hitX, hitY, hitZ, 0);
+13 -2
View File
@@ -1,8 +1,9 @@
package tinker.tconstruct;
import org.w3c.dom.Document;
import java.util.WeakHashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@@ -15,6 +16,7 @@ import tinker.tconstruct.client.gui.PatternChestGui;
import tinker.tconstruct.client.gui.PatternShaperGui;
import tinker.tconstruct.client.gui.SmelteryGui;
import tinker.tconstruct.client.gui.ToolStationGui;
import tinker.tconstruct.container.SmelteryContainer;
import tinker.tconstruct.logic.FrypanLogic;
import tinker.tconstruct.logic.PartCrafterLogic;
import tinker.tconstruct.logic.PatternChestLogic;
@@ -33,6 +35,8 @@ public class TGuiHandler implements IGuiHandler
public static int smeltery = 7;
public static int manualGui = -1;
public static WeakHashMap<String, Container> openContainers = new WeakHashMap<String, Container>();
@Override
public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z)
@@ -42,7 +46,14 @@ public class TGuiHandler implements IGuiHandler
TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile != null && tile instanceof InventoryLogic)
return ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
{
Object o = ((InventoryLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
if (o instanceof SmelteryContainer)
{
openContainers.put(player.username, (Container) o);
}
return o;
}
return null;
}
+15 -10
View File
@@ -3,18 +3,15 @@ package tinker.tconstruct;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import tinker.armory.content.EntityEquipment;
import tinker.common.InventoryLogic;
import tinker.tconstruct.entity.CartEntity;
import tinker.tconstruct.container.SmelteryContainer;
import tinker.tconstruct.logic.ToolStationLogic;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.IPacketHandler;
@@ -68,19 +65,18 @@ public class TPacketHandler implements IPacketHandler
//System.out.println("Handling server packet");
DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));
byte packetType;
int dimension;
//byte packetType;
//int dimension;
byte packetID;
try
{
packetID = inputStream.readByte();
dimension = inputStream.readInt();
World world = DimensionManager.getWorld(dimension);
if (packetID == 1) //Tool Station
{
int dimension = inputStream.readInt();
World world = DimensionManager.getWorld(dimension);
int x = inputStream.readInt();
int y = inputStream.readInt();
int z = inputStream.readInt();
@@ -94,6 +90,8 @@ public class TPacketHandler implements IPacketHandler
}
else if (packetID == 2) //Stencil Table
{
int dimension = inputStream.readInt();
World world = DimensionManager.getWorld(dimension);
int x = inputStream.readInt();
int y = inputStream.readInt();
int z = inputStream.readInt();
@@ -106,7 +104,14 @@ public class TPacketHandler implements IPacketHandler
((InventoryLogic) te).setInventorySlotContents(1, new ItemStack(itemID, 1, itemDamage));
}
}
else if (packetID == 3) //Smeltery
{
int rowPos = inputStream.readInt();
String user = inputStream.readUTF();
SmelteryContainer container = (SmelteryContainer) TGuiHandler.openContainers.get(user);
System.out.println("Recieved a scroll packet for row "+rowPos);
container.updateRows(rowPos);
}
}
catch (IOException e)
{
+2 -2
View File
@@ -23,7 +23,7 @@ public class LavaTankBlock extends BlockContainer
public LavaTankBlock(int id)
{
super(id, 38, Material.rock);
setHardness(30F);
setHardness(12);
setCreativeTab(TConstruct.blockTab);
setBlockName("TConstruct.LavaTank");
setStepSound(Block.soundGlassFootstep);
@@ -106,7 +106,7 @@ public class LavaTankBlock extends BlockContainer
if (liquid != null)
{
LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z);
int amount = logic.fill(liquid, true);
int amount = logic.fill(0, liquid, true);
if (amount > 0)
return true;
else
+33 -38
View File
@@ -25,7 +25,7 @@ public class SearedBlock extends InventoryBlock
super(id, Material.rock);
this.setCreativeTab(TConstruct.blockTab);
blockIndexInTexture = 32;
setHardness(30F);
setHardness(12);
setStepSound(soundMetalFootstep);
}
@@ -92,6 +92,9 @@ public class SearedBlock extends InventoryBlock
{
//System.out.println("Castses");
CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z);
if (logic.liquid != null)
return true;
if (!logic.isStackInSlot(0) && !logic.isStackInSlot(1))
{
ItemStack stack = player.getCurrentEquippedItem();
@@ -112,17 +115,6 @@ public class SearedBlock extends InventoryBlock
if (stack != null)
addItemToInventory(player, world, x, y, z, stack);
}
/*ItemStack insideStack = logic.takeItemInColumn(0);
if (insideStack == null)
{r
insideStack = logic.takeItemInColumn(1 - 0);
}
if (insideStack != null)
{
this.spawnItem(world, x, y, z, insideStack);
}*/
}
world.markBlockForUpdate(x, y, z);
@@ -250,39 +242,42 @@ public class SearedBlock extends InventoryBlock
int meta = world.getBlockMetadata(x, y, z);
if (meta == 0)
{
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(x, y, z, x+1, y+1, z+1);
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool(x, y, z, x + 1, y + 1, z + 1);
}
if (meta == 1)
{
FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z);
float xMin = 0.25F;
float xMax = 0.75F;
float zMin = 0.25F;
float zMax = 0.75F;
switch (logic.getRenderDirection())
if (logic != null)
{
case 2:
zMin = 0.625F;
zMax = 1.0F;
break;
case 3:
zMax = 0.375F;
zMin = 0F;
break;
case 4:
xMin = 0.625F;
xMax = 1.0F;
break;
case 5:
xMax = 0.375F;
xMin = 0F;
break;
}
float xMin = 0.25F;
float xMax = 0.75F;
float zMin = 0.25F;
float zMax = 0.75F;
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax));
switch (logic.getRenderDirection())
{
case 2:
zMin = 0.625F;
zMax = 1.0F;
break;
case 3:
zMax = 0.375F;
zMin = 0F;
break;
case 4:
xMin = 0.625F;
xMax = 1.0F;
break;
case 5:
xMax = 0.375F;
xMin = 0F;
break;
}
return AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax));
}
}
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ public class SmelteryBlock extends InventoryBlock
{
super(id, Material.rock);
blockIndexInTexture = 64;
setHardness(30F);
setHardness(12F);
setStepSound(soundMetalFootstep);
rand = new Random();
this.setCreativeTab(TConstruct.blockTab);
+2 -1
View File
@@ -94,7 +94,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
liquidSize -= countSize;
float height = countSize > 20000 ? 1.0F : countSize / 20000F;
renderer.setRenderBounds(0.0F, base, 0.0F, 1.0F, height + base, 1.0F);
renderer.setRenderBounds(0, base, 0, 1, height + base, 1);
base += height;
liquidBase += countSize;
@@ -129,6 +129,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
void renderLayer(SmelteryLogic logic, int start, int posX, int posY, int posZ, RenderBlocks renderer, IBlockAccess world)
{
renderer.setRenderBounds(-0.001F, -0.001F, -0.001F, 1.001F, 1.001F, 1.001F);
for (int i = 0; i < 9; i++)
{
//System.out.println("layers:"+logic.layers);
+3 -10
View File
@@ -47,17 +47,10 @@ public class TankRender implements ISimpleBlockRenderingHandler
}
renderer.renderStandardBlock(block, x, y, z);
LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z);
if (logic.getLiquidAmount() > 0)
if (logic.containsLiquid())
{
LiquidStack liquid = logic.liquid;
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount() / 4020f, 0.97);
/*Block liquidBlock = Block.blocksList[logic.liquid.itemID];
if (liquidBlock != null)
{
ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount() / 4020f, 0.97);
renderer.renderStandardBlock(liquidBlock, x, y, z);
}*/
LiquidStack liquid = logic.tank.getLiquid();
renderer.setRenderBounds(0.001, 0.001, 0.001, 0.999, logic.getLiquidAmountScaled(), 0.999);
if (liquid.itemID < 4096) //Block
{
Block liquidBlock = Block.blocksList[liquid.itemID];
+124 -18
View File
@@ -1,27 +1,116 @@
package tinker.tconstruct.client.gui;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import net.minecraft.block.Block;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import tinker.common.BlockSkinRenderHelper;
import cpw.mods.fml.common.network.PacketDispatcher;
import tinker.tconstruct.container.SmelteryContainer;
import tinker.tconstruct.logic.SmelteryLogic;
public class SmelteryGui extends GuiContainer
{
public SmelteryLogic logic;
String username;
boolean isScrolling = false;
boolean wasClicking;
float currentScroll = 0.0F;
int slotPos = 0;
int prevSlotPos = 0;
public SmelteryGui(InventoryPlayer inventoryplayer, SmelteryLogic smeltery, World world, int x, int y, int z)
{
super(smeltery.getGuiContainer(inventoryplayer, world, x, y, z));
logic = smeltery;
username = inventoryplayer.player.username;
}
public void drawScreen (int mouseX, int mouseY, float par3)
{
super.drawScreen(mouseX, mouseY, par3);
if (logic.layers > 2)
{
boolean mouseDown = Mouse.isButtonDown(0);
int lefto = this.guiLeft;
int topo = this.guiTop;
int xScroll = lefto + 31;
int yScroll = topo + 8;
int scrollWidth = xScroll + 14;
int scrollHeight = yScroll + 144;
if (!this.wasClicking && mouseDown && mouseX >= xScroll && mouseY >= yScroll && mouseX < scrollWidth && mouseY < scrollHeight)
{
this.isScrolling = true;
}
if (!mouseDown)
{
this.isScrolling = false;
}
if (wasClicking && !isScrolling && slotPos != prevSlotPos)
{
updateServer(username, slotPos);
prevSlotPos = slotPos;
}
this.wasClicking = mouseDown;
if (this.isScrolling)
{
this.currentScroll = ((float) (mouseY - yScroll) - 7.5F) / ((float) (scrollHeight - yScroll) - 15.0F);
if (this.currentScroll < 0.0F)
{
this.currentScroll = 0.0F;
}
if (this.currentScroll > 1.0F)
{
this.currentScroll = 1.0F;
}
int s = ((SmelteryContainer) this.inventorySlots).scrollTo(this.currentScroll);
if (s != -1)
slotPos = s;
}
}
}
void updateServer (String name, int row)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
DataOutputStream outputStream = new DataOutputStream(bos);
try
{
outputStream.writeByte(3);
outputStream.writeInt(row);
outputStream.writeUTF(name);
}
catch (Exception ex)
{
ex.printStackTrace();
}
Packet250CustomPayload packet = new Packet250CustomPayload();
packet.channel = "TConstruct";
packet.data = bos.toByteArray();
packet.length = bos.size();
PacketDispatcher.sendPacketToServer(packet);
}
protected void drawGuiContainerForegroundLayer (int par1, int par2)
@@ -29,7 +118,7 @@ public class SmelteryGui extends GuiContainer
fontRenderer.drawString(StatCollector.translateToLocal("crafters.Smeltery"), 50, 5, 0x404040);
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 50, (ySize - 96) + 2, 0x404040);
}
protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
int texID = mc.renderEngine.getTexture("/tinkertextures/gui/smeltery.png");
@@ -37,7 +126,7 @@ public class SmelteryGui extends GuiContainer
mc.renderEngine.bindTexture(texID);
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX+46, cornerY, 0, 0, xSize, ySize);
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, xSize, ySize);
//Fuel - Lava
if (logic.fuelGague > 0)
@@ -85,44 +174,61 @@ public class SmelteryGui extends GuiContainer
{
int size = liquidSize >= 16 ? 16 : liquidSize;
int basePos = 54;
drawTexturedModalRect(cornerX + basePos, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos+16, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos+32, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos+48, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 4, size);
drawTexturedModalRect(cornerX + basePos, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos + 16, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos + 32, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 16, size);
drawTexturedModalRect(cornerX + basePos + 48, (cornerY + 68) - size - base, xTex, yTex + 16 - size, 4, size);
liquidSize -= size;
base += size;
}
}
//base = liquid.amount / 10000 * 52;
}
//Liquid gague
texID = this.mc.renderEngine.getTexture("/tinkertextures/gui/smeltery.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(texID);
drawTexturedModalRect(cornerX+54, cornerY+16, xSize, 76, 52, 52);
drawTexturedModalRect(cornerX + 54, cornerY + 16, xSize, 76, 52, 52);
//drawTexturedModalRect(cornerX+111, cornerY+16, xSize, 128, 52, 52);
//Side inventory
texID = this.mc.renderEngine.getTexture("/tinkertextures/gui/smelteryside.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(texID);
drawTexturedModalRect(cornerX-46, cornerY, 0, 0, 98, ySize-8);
drawTexturedModalRect(cornerX+32, cornerY+8, 98, 0, 12, 15);
//drawStats();
if (logic.layers == 1)
{
drawTexturedModalRect(cornerX - 46, cornerY, 0, 0, 98, 43);
drawTexturedModalRect(cornerX - 46, cornerY+43, 0, 133, 98, 25);
}
else if (logic.layers == 2)
{
drawTexturedModalRect(cornerX - 46, cornerY, 0, 0, 98, 61);
drawTexturedModalRect(cornerX - 46, cornerY+61, 0, 97, 98, 61);
}
else
{
drawTexturedModalRect(cornerX - 46, cornerY, 0, 0, 98, ySize - 8);
}
drawTexturedModalRect(cornerX + 32, (int) (cornerY + 8 + 127 * currentScroll), 98, 0, 12, 15);
//Temperature
int slotSize = logic.layers * 9;
if (slotSize > 24)
slotSize = 24;
for (int iter = 0; iter < slotSize; iter++)
{
int slotTemp = logic.getTempForSlot(iter) - 20;
int maxTemp = logic.getMeltingPointForSlot(iter) - 20;
int slotTemp = logic.getTempForSlot(iter + slotPos*3) - 20;
int maxTemp = logic.getMeltingPointForSlot(iter + slotPos*3) - 20;
if (slotTemp > 0 && maxTemp > 0)
{
{
int size = 16 * slotTemp / maxTemp + 1;
drawTexturedModalRect(cornerX-38+(iter%3*22), cornerY+8+(iter/3*18) + 16 - size, 98, 15 + 16 - size, 5, size);
drawTexturedModalRect(cornerX - 38 + (iter % 3 * 22), cornerY + 8 + (iter / 3 * 18) + 16 - size, 98, 15 + 16 - size, 5, size);
}
}
/*fontRenderer.drawString("Clicking: "+wasClicking, 140, 30, 0xFFFFFF);
fontRenderer.drawString("Scrolling: "+isScrolling, 140, 40, 0xFFFFFF);
fontRenderer.drawString("Scroll: "+currentScroll, 140, 50, 0xFFFFFF);*/
}
}
+154 -102
View File
@@ -1,6 +1,10 @@
package tinker.tconstruct.container;
import java.util.ArrayList;
import java.util.List;
import tinker.tconstruct.logic.SmelteryLogic;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
@@ -14,48 +18,90 @@ import net.minecraft.tileentity.TileEntityFurnace;
public class SmelteryContainer extends Container
{
public SmelteryLogic logic;
public InventoryPlayer playerInv;
public int fuel = 0;
int slotRow;
public SmelteryContainer(InventoryPlayer inventoryplayer, SmelteryLogic smeltery)
{
logic = smeltery;
if (smeltery.layers > 0)
{
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(smeltery, x + y * 3, -34 + x * 22, 8 + y * 18));
}
if (smeltery.layers > 1)
{
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(smeltery, 9 + x + y * 3, -34 + x * 22, 62 + y * 18));
}
playerInv = inventoryplayer;
if (smeltery.layers > 2)
{
for (int y = 0; y < 2; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(smeltery, 18 + x + y * 3, -34 + x * 22, 116 + y * 18));
slotRow = -1;
updateRows(0);
}
/* Player inventory */
for (int column = 0; column < 3; column++)
else
{
for (int row = 0; row < 9; row++)
if (smeltery.layers > 0)
{
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 54 + row * 18, 84 + column * 18));
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(smeltery, x + y * 3, -34 + x * 22, 8 + y * 18));
}
if (smeltery.layers > 1)
{
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(smeltery, 9 + x + y * 3, -34 + x * 22, 62 + y * 18));
}
/* Player inventory */
for (int column = 0; column < 3; column++)
{
for (int row = 0; row < 9; row++)
{
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 54 + row * 18, 84 + column * 18));
}
}
for (int column = 0; column < 9; column++)
{
this.addSlotToContainer(new Slot(inventoryplayer, column, 54 + column * 18, 142));
}
}
for (int column = 0; column < 9; column++)
}
public int updateRows(int invRow)
{
if (invRow != slotRow)
{
this.addSlotToContainer(new Slot(inventoryplayer, column, 54 + column * 18, 142));
slotRow = invRow;
this.inventorySlots.clear();
this.inventoryItemStacks.clear();
for (int y = 0; y < 8; y++)
for (int x = 0; x < 3; x++)
this.addSlotToContainer(new Slot(logic, x + y*3 + invRow*3, -34 + x * 22, 8 + y * 18));
/* Player inventory */
for (int column = 0; column < 3; column++)
{
for (int row = 0; row < 9; row++)
{
this.addSlotToContainer(new Slot(playerInv, row + column * 9 + 9, 54 + row * 18, 84 + column * 18));
}
}
for (int column = 0; column < 9; column++)
{
this.addSlotToContainer(new Slot(playerInv, column, 54 + column * 18, 142));
}
return slotRow;
}
return -1;
}
public int scrollTo(float scrollPos)
{
float total = (logic.getSizeInventory() - 24) / 3;
int rowPos = (int) (total * scrollPos);
return updateRows(rowPos);
}
@Override
public void detectAndSendChanges ()
public void detectAndSendChanges () //TODO: Sync with this
{
super.detectAndSendChanges();
/*for (int i = 0; i < crafters.size(); i++)
@@ -137,93 +183,99 @@ public class SmelteryContainer extends Container
return stack;
}
protected boolean mergeItemStack (ItemStack par1ItemStack, int par2, int par3, boolean par4)
/*protected boolean mergeItemStack (ItemStack inputStack, int par2, int par3, boolean flag)
{
boolean var5 = false;
int var6 = par2;
boolean merged = false;
int slotPos = par2;
if (par4)
{
var6 = par3 - 1;
}
if (flag)
{
slotPos = par3 - 1;
}
Slot var7;
ItemStack var8;
Slot slot;
ItemStack slotStack;
if (par1ItemStack.isStackable())
{
while (par1ItemStack.stackSize > 0 && (!par4 && var6 < par3 || par4 && var6 >= par2))
{
var7 = (Slot) this.inventorySlots.get(var6);
var8 = var7.getStack();
if (inputStack.isStackable())
{
while (inputStack.stackSize > 0 && (!flag && slotPos < par3 || flag && slotPos >= par2))
{
slot = (Slot)this.inventorySlots.get(slotPos);
slotStack = slot.getStack();
if (var8 != null && var8.itemID == par1ItemStack.itemID && (!par1ItemStack.getHasSubtypes() || par1ItemStack.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(par1ItemStack, var8))
{
int var9 = var8.stackSize + par1ItemStack.stackSize;
//System.out.println("Boom");
if (slotStack != null && ItemStack.areItemStacksEqual(inputStack, slotStack) && !inputStack.getHasSubtypes())
{
//System.out.println("DeyadaBoomDeyada");
int totalSize = slotStack.stackSize + inputStack.stackSize;
if (var9 <= par1ItemStack.getMaxStackSize())
{
par1ItemStack.stackSize = 0;
var8.stackSize = var9;
var7.onSlotChanged();
var5 = true;
}
else if (var8.stackSize < par1ItemStack.getMaxStackSize())
{
par1ItemStack.stackSize -= par1ItemStack.getMaxStackSize() - var8.stackSize;
var8.stackSize = par1ItemStack.getMaxStackSize();
var7.onSlotChanged();
var5 = true;
}
}
if (totalSize <= inputStack.getMaxStackSize())
{
inputStack.stackSize = 0;
slotStack.stackSize = totalSize;
slot.onSlotChanged();
merged = true;
}
else if (slotStack.stackSize < inputStack.getMaxStackSize())
{
inputStack.stackSize -= inputStack.getMaxStackSize() - slotStack.stackSize;
slotStack.stackSize = inputStack.getMaxStackSize();
slot.onSlotChanged();
merged = true;
}
}
if (par4)
{
--var6;
}
else
{
++var6;
}
}
}
//System.out.println("Heyo~");
if (flag)
{
--slotPos;
}
else
{
++slotPos;
}
}
}
if (par1ItemStack.stackSize > 0)
{
if (par4)
{
var6 = par3 - 1;
}
else
{
var6 = par2;
}
if (inputStack.stackSize > 0)
{
//System.out.println("Boom");
if (flag)
{
slotPos = par3 - 1;
}
else
{
slotPos = par2;
}
while (!par4 && var6 < par3 || par4 && var6 >= par2)
{
var7 = (Slot) this.inventorySlots.get(var6);
var8 = var7.getStack();
while (!flag && slotPos < par3 || flag && slotPos >= par2)
{
slot = (Slot)this.inventorySlots.get(slotPos);
slotStack = slot.getStack();
if (var8 == null)
{
var7.putStack(par1ItemStack.copy());
var7.onSlotChanged();
par1ItemStack.stackSize = 0;
var5 = true;
break;
}
System.out.println("Boom");
if (slotStack == null)
{
System.out.println("Deya");
slot.putStack(inputStack.copy());
slot.onSlotChanged();
inputStack.stackSize = 0;
merged = true;
break;
}
if (par4)
{
--var6;
}
else
{
++var6;
}
}
}
if (flag)
{
--slotPos;
}
else
{
++slotPos;
}
}
}
return var5;
}
return merged;
}*/
}
+1 -1
View File
@@ -26,7 +26,7 @@ public class ToolPart extends CraftingItem
public void getSubItems(int id, CreativeTabs tab, List list)
{
for (int i = 0; i < 15; i++)
for (int i = 0; i < 17; i++)
list.add(new ItemStack(id, 1, i));
}
+54 -4
View File
@@ -7,7 +7,9 @@ import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack;
import tinker.common.IPattern;
import tinker.common.InventoryLogic;
@@ -15,7 +17,8 @@ import tinker.tconstruct.TConstruct;
import tinker.tconstruct.crafting.CastingRecipe;
import tinker.tconstruct.crafting.LiquidCasting;
public class CastingTableLogic extends InventoryLogic implements ILiquidTank
public class CastingTableLogic extends InventoryLogic
implements ILiquidTank, ITankContainer
{
public LiquidStack liquid;
float materialRedux = 0;
@@ -38,6 +41,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank
return null;
}
/* Tank */
@Override
public LiquidStack getLiquid ()
{
@@ -87,7 +91,10 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
liquid.amount = getCapacity();
castingDelay = LiquidCasting.instance.getCastingDelay(liquid, inventory[0]);
if (castingDelay <= 0)
{
castingDelay = LiquidCasting.instance.getCastingDelay(liquid, inventory[0]);
}
}
return cap;
}
@@ -113,7 +120,49 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank
{
return 0;
}
/* Tank Container */
@Override
public int fill (ForgeDirection from, LiquidStack resource, boolean doFill)
{
if (from == ForgeDirection.UP)
return fill(0, resource, doFill);
return 0;
}
@Override
public int fill (int tankIndex, LiquidStack resource, boolean doFill)
{
return fill(resource, doFill);
}
@Override
public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
{
return null;
}
@Override
public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain)
{
return null;
}
@Override
public ILiquidTank[] getTanks (ForgeDirection direction)
{
return new ILiquidTank[] { this };
}
@Override
public ILiquidTank getTank (ForgeDirection direction, LiquidStack type)
{
return this;
}
/* Updating */
@Override
public void updateEntity ()
{
@@ -145,8 +194,8 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank
{
if (tags.getBoolean("hasLiquid"))
this.liquid = new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta"));
//else
//this.liquid = null;
else
this.liquid = null;
super.readFromNBT(tags);
}
@@ -177,4 +226,5 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank
readFromNBT(packet.customParam1);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
}
+10 -9
View File
@@ -9,6 +9,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack;
import tinker.common.IActiveLogic;
import tinker.common.IFacingLogic;
@@ -18,8 +19,8 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
byte direction;
boolean active;
public LiquidStack liquid;
ILiquidTank drain;
ILiquidTank tank;
ITankContainer drain;
ITankContainer tank;
int drainAmount = 5;
public void activateFaucet ()
@@ -45,12 +46,12 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
TileEntity drainte = worldObj.getBlockTileEntity(x, yCoord, z);
TileEntity tankte = worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord);
if (drainte != null && drainte instanceof ILiquidTank && tankte != null && tankte instanceof ILiquidTank)
if (drainte != null && drainte instanceof ITankContainer && tankte != null && tankte instanceof ITankContainer)
{
//System.out.println("Activating Faucet");
liquid = ((ILiquidTank) drainte).drain(drainAmount, true);
drain = (ILiquidTank) drainte;
tank = (ILiquidTank) tankte;
liquid = ((ITankContainer) drainte).drain(getForgeDirection(), drainAmount, true);
drain = (ITankContainer) drainte;
tank = (ITankContainer) tankte;
active = true;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
//System.out.println("Drained");
@@ -63,7 +64,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
public void deactivateFaucet ()
{
//System.out.println("Deactivating Faucet");
drain.fill(liquid, true);
drain.fill(getForgeDirection(), liquid, true);
liquid = null;
drain = null;
tank = null;
@@ -75,7 +76,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
{
if (active && liquid != null)
{
int drained = tank.fill(liquid, true);
int drained = tank.fill(ForgeDirection.UP, liquid, true);
//System.out.println("Drained: "+drained);
if (drained < drainAmount)
{
@@ -84,7 +85,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
}
else
{
liquid = drain.drain(drainAmount, true);
liquid = drain.drain(getForgeDirection(), drainAmount, true);
}
/*TileEntity te = worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord);
if (te != null && te instanceof ILiquidTank)
+41 -85
View File
@@ -7,127 +7,83 @@ import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.liquids.LiquidTank;
public class LavaTankLogic extends MultiServantLogic
implements ILiquidTank
implements ITankContainer
{
public int maxLiquid;
public int pressure;
public LiquidStack liquid;
public LiquidTank tank;
public LavaTankLogic()
{
maxLiquid = LiquidContainerRegistry.BUCKET_VOLUME*4;
pressure = 0;
}
public boolean canUpdate()
{
return false;
}
@Override
public LiquidStack getLiquid ()
{
return liquid;
}
public int getLiquidAmount ()
{
if (liquid == null)
return 0;
else
return liquid.amount;
tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME*4);
}
@Override
public int getCapacity ()
public int fill (ForgeDirection from, LiquidStack resource, boolean doFill)
{
return maxLiquid;
return fill(0, resource, doFill);
}
@Override
public int fill (LiquidStack resource, boolean doFill)
public int fill (int tankIndex, LiquidStack resource, boolean doFill)
{
if (resource == null)
return 0;
if (liquid == null)
{
liquid = resource.copy();
int amount = tank.fill(resource, doFill);
if (amount > 0 && doFill)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return liquid.amount;
}
else if (resource.itemID != liquid.itemID || resource.itemMeta != liquid.itemMeta)
{
return 0;
}
else if (resource.amount + liquid.amount >= getCapacity())
{
int total = getCapacity();
int cap = total - liquid.amount;
if (doFill && cap != total)
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
liquid.amount = getCapacity();
}
return cap;
}
else
{
if (doFill)
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
liquid.amount += resource.amount;
}
return resource.amount;
}
return amount;
}
@Override
public LiquidStack drain (int maxDrain, boolean doDrain)
public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
{
if (liquid == null)
return null;
if (liquid.amount - maxDrain < 0)
{
LiquidStack liq = liquid.copy();
if (doDrain)
{
liquid = null;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
return liq;
}
else
{
if (doDrain)
{
liquid.amount -= maxDrain;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
return new LiquidStack(liquid.itemID, maxDrain, liquid.itemMeta);
}
return drain(0, maxDrain, doDrain);
}
@Override
public int getTankPressure ()
public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain)
{
return pressure;
LiquidStack amount = tank.drain(maxDrain, doDrain);
if (amount != null && doDrain)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return amount;
}
@Override
public ILiquidTank[] getTanks (ForgeDirection direction)
{
return new ILiquidTank[] { tank };
}
@Override
public ILiquidTank getTank (ForgeDirection direction, LiquidStack type)
{
return tank;
}
public float getLiquidAmountScaled()
{
return (float) (tank.getLiquid().amount) / (float) (tank.getCapacity() * 1.01F);
}
public boolean containsLiquid()
{
return tank.getLiquid() != null;
}
public void readFromNBT(NBTTagCompound tags)
{
if (tags.getBoolean("hasLiquid"))
this.liquid = new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta"));
tank.setLiquid(new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta")));
super.readFromNBT(tags);
}
public void writeToNBT(NBTTagCompound tags)
{
LiquidStack liquid = tank.getLiquid();
tags.setBoolean("hasLiquid", liquid != null);
if (liquid != null)
{
@@ -8,11 +8,12 @@ import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer;
import net.minecraftforge.liquids.LiquidStack;
import tinker.common.IFacingLogic;
public class SmelteryDrainLogic extends MultiServantLogic
implements ILiquidTank, IFacingLogic
implements ITankContainer, IFacingLogic
{
byte direction;
@@ -21,7 +22,7 @@ public class SmelteryDrainLogic extends MultiServantLogic
return false;
}
@Override
/*@Override
public LiquidStack getLiquid ()
{
return null;
@@ -35,17 +36,37 @@ public class SmelteryDrainLogic extends MultiServantLogic
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
return smeltery.getCapacity();
}*/
/*@Override
public int fill (LiquidStack resource, boolean doFill)
{
}*/
/*@Override
public LiquidStack drain (int maxDrain, boolean doDrain)
{
}*/
@Override
public int fill (ForgeDirection from, LiquidStack resource, boolean doFill)
{
//if (from == ForgeDirection.OPPOSITES[getRenderDirection()])
return fill(0, resource, doFill);
//return 0;
}
@Override
public int fill (LiquidStack resource, boolean doFill)
public int fill (int tankIndex, LiquidStack resource, boolean doFill)
{
if (hasMaster) //Not sure if it should fill or not
{
if (doFill)
{
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
return smeltery.fill(resource);
return smeltery.fill(resource, doFill);
}
else
{
@@ -59,7 +80,13 @@ public class SmelteryDrainLogic extends MultiServantLogic
}
@Override
public LiquidStack drain (int maxDrain, boolean doDrain)
public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain)
{
return drain(0, maxDrain, doDrain);
}
@Override
public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain)
{
if (hasValidMaster())
{
@@ -73,9 +100,24 @@ public class SmelteryDrainLogic extends MultiServantLogic
}
@Override
public int getTankPressure ()
public ILiquidTank[] getTanks (ForgeDirection direction)
{
return 0;
if (hasValidMaster())
{
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
return new ILiquidTank[] { smeltery };
}
return null;
}
@Override
public ILiquidTank getTank (ForgeDirection direction, LiquidStack type)
{
if (hasValidMaster())
{
return (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z);
}
return null;
}
@Override
+46 -12
View File
@@ -28,7 +28,8 @@ import tinker.tconstruct.crafting.Smeltery;
/* Simple class for storing items in the block
*/
public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFacingLogic
public class SmelteryLogic extends InventoryLogic
implements IActiveLogic, IFacingLogic, ILiquidTank
{
public boolean validStructure;
byte direction;
@@ -226,12 +227,12 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
if (result != null)
{
inventory[i] = null;
addMoltenMetal(result);
addMoltenMetal(result, false);
ArrayList alloys = Smeltery.mixMetals(moltenMetal);
for (int al = 0; al < alloys.size(); al++)
{
LiquidStack liquid = (LiquidStack) alloys.get(al);
addMoltenMetal(liquid);
addMoltenMetal(liquid, true);
}
onInventoryChanged();
//setWorldToInventory();
@@ -246,27 +247,35 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
}
}
void addMoltenMetal (LiquidStack liquid)
void addMoltenMetal (LiquidStack liquid, boolean first)
{
if (moltenMetal.size() == 0)
moltenMetal.add(liquid);
else
{
boolean added = false;
for (LiquidStack l : moltenMetal)
//for (LiquidStack l : moltenMetal)
for (int i = 0; i < moltenMetal.size(); i++)
{
LiquidStack l = moltenMetal.get(i);
if (l.itemID == liquid.itemID && l.itemMeta == liquid.itemMeta)
{
l.amount += liquid.amount;
added = true;
}
/*if (l.amount <= 0)
if (l.amount <= 0)
{
moltenMetal.remove(l);
}*/
i--;
}
}
if (!added)
moltenMetal.add(liquid);
{
if (first)
moltenMetal.add(0, liquid);
else
moltenMetal.add(liquid);
}
}
}
@@ -305,6 +314,15 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
}
/* Inventory */
public int getMaxStackStackSize(ItemStack stack)
{
LiquidStack liquid = getResultFor(stack);
System.out.println("Liquid: "+liquid);
if (liquid == null)
return 0;
return liquid.amount;
}
public int getInventoryStackLimit ()
{
return 1;
@@ -314,7 +332,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
updateTemperatures();
super.onInventoryChanged();
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
/* Multiblock */
@@ -596,7 +614,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
return null;
LiquidStack liquid = moltenMetal.get(0);
if (liquid.amount - maxDrain < 0)
if (liquid.amount - maxDrain <= 0)
{
LiquidStack liq = liquid.copy();
if (doDrain)
@@ -618,12 +636,28 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
}
}
public int fill (LiquidStack resource)
public int fill (LiquidStack resource, boolean doFill)
{
int amount = resource.amount;
addMoltenMetal(resource);
addMoltenMetal(resource, false);
return amount;
}
@Override
public LiquidStack getLiquid ()
{
if (moltenMetal.size() == 0)
return null;
return moltenMetal.get(0);
}
@Override
public int getTankPressure ()
{
return 0;
}
/* NBT */
@Override
+6 -107
View File
@@ -173,108 +173,6 @@ public abstract class ToolCore extends Item
protected abstract String getRenderString(int renderPass, boolean broken);
protected abstract String getEffectString(int renderPass);
/*String getRenderString (int renderPass, boolean broken)
{
switch (renderPass)
{
case 0:
return "_pickaxe_handle.png";
case 1:
if (broken)
return "_pickaxe_head_broken.png";
else
return "_pickaxe_head.png";
case 2:
return "_pickaxe_accessory.png";
default:
return "";
}
}
String getEffectString ()
{
return "_pickaxe_effect.png";
}*/
/*String types[] = {
"_pickaxe_effect.png",
"_pickaxe_effect.png",
"_pickaxe_effect.png"
};*/
/*@SideOnly(Side.CLIENT)
@Override
public int getIconIndex (ItemStack stack, int renderPass)
{
if (!stack.hasTagCompound())
return 255;
NBTTagCompound tags = stack.getTagCompound();
if (tags.hasKey("InfiTool"))
{
if (renderPass == 0) // Handle
{
return tags.getCompoundTag("InfiTool").getInteger("RenderHandle");
}
if (renderPass == 1) // Head
{
if (tags.getCompoundTag("InfiTool").getBoolean("Broken"))
return tags.getCompoundTag("InfiTool").getInteger("RenderHead") + 192;
return tags.getCompoundTag("InfiTool").getInteger("RenderHead") + 64;
}
if (renderPass == 2) // Accessory
{
if (tags.getCompoundTag("InfiTool").hasKey("RenderAccessory"))
{
int index = tags.getCompoundTag("InfiTool").getInteger("RenderAccessory");
if (index == -1)
return 32;
return index + 32;
}
}
if (renderPass == 3)
{
if (tags.getCompoundTag("InfiTool").hasKey("Effect1"))
return tags.getCompoundTag("InfiTool").getInteger("Effect1") + 224;
else
return 255;
}
if (renderPass == 4)
{
if (tags.getCompoundTag("InfiTool").hasKey("Effect2"))
return tags.getCompoundTag("InfiTool").getInteger("Effect2") + 224;
else
return 255;
}
if (renderPass == 5)
{
if (tags.getCompoundTag("InfiTool").hasKey("Effect3"))
return tags.getCompoundTag("InfiTool").getInteger("Effect3") + 224;
else
return 255;
}
}
return 255; //Keep 255 blank
}
int renderDamageBar (int damage, int maxDamage, boolean broken)
{
//setTextureFile(ToolItems.craftingTexture);
if (damage == 0 || broken)
return 255;
return 240 + (damage * 13 / maxDamage);
}*/
/* Tags and information about the tool */
@Override
@SideOnly(Side.CLIENT)
@@ -349,7 +247,7 @@ public abstract class ToolCore extends Item
}
}
public static String getColorCodeForType (int type)
public static String getColorCodeForType (int type) //TODO: unhardcode this
{
String colorCode = "\u00A7";
switch (type)
@@ -388,7 +286,7 @@ public abstract class ToolCore extends Item
return colorCode;
}
public String getAbilityNameForType (int type)
public String getAbilityNameForType (int type)//TODO: unhardcode this
{
switch (type)
{
@@ -428,7 +326,7 @@ public abstract class ToolCore extends Item
}
//This method is temporary
public static String getReinforcedName (int head, int handle, int accessory)
public static String getReinforcedName (int head, int handle, int accessory) //TODO: unhardcode this
{
if (head == 7 || handle == 7 || accessory == 7)
return "\u00A7dReinforced III";
@@ -441,12 +339,13 @@ public abstract class ToolCore extends Item
return "";
}
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ", "Bronze " };
static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Nethrrack ", "Slime ", "Paper ",
"Cobalt ", "Ardite ", "Manyullyn ", "Copper ", "Bronze ", "Alumite ", "Steel " };
/* Creative mode tools */
public void getSubItems (int id, CreativeTabs tab, List list)
{
for (int i = 0; i < 15; i++)
for (int i = 0; i < 17; i++)
{
Item accessory = getAccessoryItem();
ItemStack accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, i) : null;