This commit is contained in:
mDiyo committed 2013-03-25 22:05:57 -07:00
1 parent 51a69ffbd4
commit 0191732ab0
14 files changed
+298 -77

No files matched your search

-1
View File
@@ -129,7 +129,6 @@ public abstract class InventoryLogic extends TileEntity
NBTTagList nbttaglist = new NBTTagList();
for (int iter = 0; iter < inventory.length; iter++)
{
//System.out.println("Heyo");
if (inventory[iter] != null)
{
NBTTagCompound tagList = new NBTTagCompound();
+6 -4
View File
@@ -25,7 +25,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author: mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.3")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.7")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{
@@ -35,15 +35,13 @@ public class TConstruct
/* Instance of this mod, used for grabbing prototype fields */
@Instance("TConstruct")
public static TConstruct instance;
/* Proxies for sides, used for graphics processing */
/* Proxies for sides, used for graphics processing */
@SidedProxy(clientSide = "mods.tinker.tconstruct.client.TProxyClient", serverSide = "mods.tinker.tconstruct.TProxyCommon")
public static TProxyCommon proxy;
public TConstruct()
{
//Take that, any mod that does ore dictionary registration in preinit!
events = new TEventHandler();
MinecraftForge.EVENT_BUS.register(events);
}
@PreInit
@@ -55,6 +53,10 @@ public class TConstruct
TConstructRegistry.blockTab = new TabTools("TConstructBlocks");
content = new TContent();
events = new TEventHandler();
MinecraftForge.EVENT_BUS.register(events);
events.unfuxOreDictionary();
proxy.registerRenderer();
proxy.addNames();
proxy.readManuals();
+13 -13
View File
@@ -493,22 +493,22 @@ public class TContent implements IFuelHandler
LiquidCasting lc = LiquidCasting.instance;
//Blank
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, 1, 8), 50);
lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), 80);
//Ingots
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 75); //Iron
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 75); //gold
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 75); //copper
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 75); //tin
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 75); //aluminum
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 75); //cobalt
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 75); //ardite
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 75); //bronze
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 75); //albrass
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 75); //manyullyn
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 75); //alumite
lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 80); //Iron
lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 80); //gold
lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 80); //copper
lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 80); //tin
lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 80); //aluminum
lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 80); //cobalt
lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 80); //ardite
lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 80); //bronze
lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 80); //albrass
lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 80); //manyullyn
lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 80); //alumite
// obsidian
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 75); //steel
lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 80); //steel
//Buckets
ItemStack bucket = new ItemStack(Item.bucketEmpty);
+225 -3
View File
@@ -1,5 +1,6 @@
package mods.tinker.tconstruct;
import java.util.ArrayList;
import java.util.Random;
import mods.tinker.tconstruct.crafting.PatternBuilder;
@@ -17,6 +18,7 @@ import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
public class TEventHandler
@@ -67,10 +69,10 @@ public class TEventHandler
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")
/*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")
{
@@ -207,7 +209,7 @@ public class TEventHandler
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")
else if (evt.Name == "dustNaturalAluminum")
{
Smeltery.addMelting(new ItemStack(evt.Ore.itemID, 4, evt.Ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4));
}
@@ -228,6 +230,226 @@ public class TEventHandler
}
}
public void unfuxOreDictionary ()
{
ArrayList<ItemStack> ores = OreDictionary.getOres("ingotCopper");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Copper");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2));
}
ores = OreDictionary.getOres("ingotTin");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3));
}
ores = OreDictionary.getOres("ingotBronze");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Bronze");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7));
}
ores = OreDictionary.getOres("ingotCobalt");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Cobalt");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5));
}
ores = OreDictionary.getOres("ingotArdite");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Ardite");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6));
}
ores = OreDictionary.getOres("ingotManyullyn");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Manyullyn");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9));
}
ores = OreDictionary.getOres("naturalAluminum");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4));
}
ores = OreDictionary.getOres("ingotAluminumBrass");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8));
}
ores = OreDictionary.getOres("ingotAlumite");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Alumite");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10));
}
ores = OreDictionary.getOres("ingotSteel");
for (ItemStack ore : ores)
{
PatternBuilder.instance.registerMaterial(ore, 2, "Steel");
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12));
}
ores = OreDictionary.getOres("oreCopper");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 2));
}
ores = OreDictionary.getOres("oreTin");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 3));
}
ores = OreDictionary.getOres("oreNaturalAluminum");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 4));
}
ores = OreDictionary.getOres("oreCobalt");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 5));
}
ores = OreDictionary.getOres("oreArdite");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*2, 6));
}
ores = OreDictionary.getOres("blockCopper");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 550, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2));
}
ores = OreDictionary.getOres("blockTin");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 275, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3));
}
ores = OreDictionary.getOres("blockBronze");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7));
}
ores = OreDictionary.getOres("blockNaturalAluminum");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4));
}
ores = OreDictionary.getOres("blockCobalt");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5));
}
ores = OreDictionary.getOres("blockArdite");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6));
}
ores = OreDictionary.getOres("blockManyullyn");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 800, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9));
}
ores = OreDictionary.getOres("blockAluminumBrass");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8));
}
ores = OreDictionary.getOres("blockAlumite");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10));
}
ores = OreDictionary.getOres("blockSteel");
for (ItemStack ore : ores)
{
Smeltery.addMelting(ore, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12));
}
ores = OreDictionary.getOres("dustCopper");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 3, 450, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2));
}
ores = OreDictionary.getOres("dustTin");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 5, 175, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3));
}
ores = OreDictionary.getOres("dustBronze");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 4, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7));
}
ores = OreDictionary.getOres("dustCobalt");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 0, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5));
}
ores = OreDictionary.getOres("dustArdite");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 1, 650, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6));
}
ores = OreDictionary.getOres("dustManyullyn");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 2, 750, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9));
}
ores = OreDictionary.getOres("dustNaturalAluminum");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 6, 250, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4));
}
ores = OreDictionary.getOres("dustAluminumBrass");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 7, 350, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8));
}
ores = OreDictionary.getOres("dustAlumite");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 8, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10));
}
ores = OreDictionary.getOres("dustSteel");
for (ItemStack ore : ores)
{
Smeltery.addMelting(new ItemStack(ore.itemID, 4, ore.getItemDamage()), TContent.metalBlock.blockID, 9, 500, new LiquidStack(TContent.liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12));
}
}
@ForgeSubscribe
public void bucketFill (FillBucketEvent evt)
{
@@ -55,7 +55,6 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
for (int i = 0; i < logic.layers; i++)
{
renderLayer(logic, i*9, posX, posY+i, posZ, renderer, world);
//System.out.println("layers:"+logic.layers);
ItemStack input = logic.getStackInSlot(i);
if (input != null && logic.getTempForSlot(i) > 20)
{
@@ -131,7 +130,6 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
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);
ItemStack input = logic.getStackInSlot(i+start);
if (input != null && logic.getTempForSlot(i+start) > 20)
{
@@ -142,14 +140,11 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
if (blockToRender.itemID < 4096) //Block
{
Block liquidBlock = Block.blocksList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0);
BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world);
}
else
//Item
else //Item
{
Item liquidItem = Item.itemsList[blockToRender.itemID];
//ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0);
int metadata = blockToRender.getItemDamage();
BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), metadata, posX + i % 3, posY, posZ + i / 3, renderer, world);
}
@@ -166,12 +166,12 @@ public class TProxyClient extends TProxyCommon
//LanguageRegistry.addName(TContent.manualBook, "Tinker's Log");
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Unstable Creeper");
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.UnstableCreeper.name", "en_US", "Nitro Creeper");
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.EdibleSlime.name", "en_US", "Blue Slime");
LanguageRegistry.instance().addStringLocalization("entity.TConstruct.MetalSlime.name", "en_US", "Metal Slime");
//LanguageRegistry.instance().addStringLocalization("item.tconstruct.diary.diary.name", "en_US", "Tinker's Log");
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_pattern.name", "en_US", "Blank Pattern");
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_cast.name", "en_US", "Cast");
LanguageRegistry.instance().addStringLocalization("item.tconstruct.Pattern.blank_cast.name", "en_US", "Blank Cast");
//LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern");
LanguageRegistry.addName(TContent.pickaxe, "Pickaxe");
LanguageRegistry.addName(TContent.shovel, "Shovel");
@@ -42,7 +42,6 @@ public class TableRender implements ISimpleBlockRenderingHandler
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
{
System.out.println("Rendering Table Block");
if (modelID == tabelModelID)
{
int metadata = world.getBlockMetadata(x, y, z);
@@ -35,6 +35,7 @@ public class SmelteryGui extends GuiContainer
super(smeltery.getGuiContainer(inventoryplayer, world, x, y, z));
logic = smeltery;
username = inventoryplayer.player.username;
xSize = 248;
}
public void drawScreen (int mouseX, int mouseY, float par3)
@@ -114,17 +115,17 @@ public class SmelteryGui extends GuiContainer
protected void drawGuiContainerForegroundLayer (int par1, int par2)
{
fontRenderer.drawString(StatCollector.translateToLocal("crafters.Smeltery"), 50, 5, 0x404040);
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 50, (ySize - 96) + 2, 0x404040);
fontRenderer.drawString(StatCollector.translateToLocal("crafters.Smeltery"), 86, 5, 0x404040);
fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 90, (ySize - 96) + 2, 0x404040);
}
protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png");
int cornerX = (width - xSize) / 2;
int cornerX = (width - xSize) / 2 + 36;
int cornerY = (height - ySize) / 2;
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, xSize, ySize);
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, 176, ySize);
//Fuel - Lava
if (logic.fuelGague > 0)
@@ -192,7 +193,7 @@ public class SmelteryGui extends GuiContainer
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png");
drawTexturedModalRect(cornerX + 54, cornerY + 16, xSize, 76, 52, 52);
drawTexturedModalRect(cornerX + 54, cornerY + 16, 176, 76, 52, 52);
//drawTexturedModalRect(cornerX+111, cornerY+16, xSize, 128, 52, 52);
//Side inventory
@@ -17,7 +17,6 @@ public class SmelteryContainer extends Container
public SmelteryContainer(InventoryPlayer inventoryplayer, SmelteryLogic smeltery)
{
logic = smeltery;
System.out.println("getSizeInventory: "+logic.getSizeInventory());
playerInv = inventoryplayer;
if (smeltery.layers > 2)
{
@@ -30,13 +29,13 @@ public class SmelteryContainer extends Container
{
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));
this.addSlotToContainer(new Slot(smeltery, x + y * 3, 2 + 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));
this.addSlotToContainer(new Slot(smeltery, 9 + x + y * 3, 2 + x * 22, 62 + y * 18));
}
@@ -45,13 +44,13 @@ public class SmelteryContainer extends Container
{
for (int row = 0; row < 9; row++)
{
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 54 + row * 18, 84 + column * 18));
this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 90 + row * 18, 84 + column * 18));
}
}
for (int column = 0; column < 9; column++)
{
this.addSlotToContainer(new Slot(inventoryplayer, column, 54 + column * 18, 142));
this.addSlotToContainer(new Slot(inventoryplayer, column, 90 + column * 18, 142));
}
}
}
@@ -32,7 +32,6 @@ public class PatternBuilder
materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key));
}
// 1 + 2 = EVERYTHING
public void registerFullMaterial (ItemStack material, int value, String key, ItemStack shard, ItemStack rod, int materialID)
{
materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key));
@@ -161,7 +161,7 @@ public class FilledBucket extends ItemBucket
@SideOnly(Side.CLIENT)
public void updateIcons(IconRegister iconRegister)
{
this.icons = new Icon[materialNames.length];
this.icons = new Icon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
@@ -180,6 +180,5 @@ public class FilledBucket extends ItemBucket
"Manganese", "Heptazion", "DSteel", "Angmallen"};
public static final String[] textureNames = new String[] {
"iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel",
"manganese", "heptazion", "dsteel", "angmallen"};
"iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel" };
}
@@ -85,7 +85,6 @@ public class ToolMaterial
public String style()
{
System.out.println("Style: "+this.tipStyle);
return this.tipStyle;
}
@@ -40,7 +40,6 @@ public class PartCrafterLogic extends InventoryLogic
TileEntity tile = world.getBlockTileEntity(xPos, y, zPos);
if (tile != null && tile instanceof PatternChestLogic)
return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic)tile);
//return ((PatternHolderLogic) tile).getGuiContainer(player.inventory, world, x, y, z);
}
}
return new PartCrafterContainer(inventoryplayer, this);
@@ -117,7 +116,7 @@ public class PartCrafterLogic extends InventoryLogic
void buildTopPart ()
{
ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[2], inventory[0], inventory[2]);
ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[2], inventory[0], inventory[1]);
if (parts != null)
{
inventory[4] = parts[0];
@@ -143,16 +142,6 @@ public class PartCrafterLogic extends InventoryLogic
}
}
public boolean shouldRemoveItemsForCrafting (int slot)
{
if ((slot == 4 || slot == 5) && craftedTop)
return false;
if ((slot == 6 || slot == 7) && craftedBottom)
return false;
return true;
}
/* NBT */
public void readFromNBT (NBTTagCompound tags)
{
+38 -20
View File
@@ -33,8 +33,7 @@ import net.minecraftforge.liquids.LiquidStack;
/* Simple class for storing items in the block
*/
public class SmelteryLogic extends InventoryLogic
implements IActiveLogic, IFacingLogic, ILiquidTank, IMasterLogic
public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFacingLogic, ILiquidTank, IMasterLogic
{
public boolean validStructure;
byte direction;
@@ -55,6 +54,7 @@ public class SmelteryLogic extends InventoryLogic
public ArrayList<LiquidStack> moltenMetal = new ArrayList<LiquidStack>();
int maxLiquid;
int currentLiquid;
public int layers;
int slag;
@@ -110,7 +110,6 @@ public class SmelteryLogic extends InventoryLogic
@Override
public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z)
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
return new SmelteryContainer(inventoryplayer, this);
}
@@ -196,9 +195,9 @@ public class SmelteryLogic extends InventoryLogic
checkValidPlacement();
if (useTime > 0)
useTime--;
useTime -= 3;
if (validStructure && useTime == 0)
if (validStructure && useTime <= 0)
{
updateFuelGague();
}
@@ -226,16 +225,17 @@ public class SmelteryLogic extends InventoryLogic
LiquidStack result = getResultFor(inventory[i]);
if (result != null)
{
inventory[i] = null;
addMoltenMetal(result, false);
ArrayList alloys = Smeltery.mixMetals(moltenMetal);
for (int al = 0; al < alloys.size(); al++)
if (addMoltenMetal(result, false))
{
LiquidStack liquid = (LiquidStack) alloys.get(al);
addMoltenMetal(liquid, true);
inventory[i] = null;
ArrayList alloys = Smeltery.mixMetals(moltenMetal);
for (int al = 0; al < alloys.size(); al++)
{
LiquidStack liquid = (LiquidStack) alloys.get(al);
addMoltenMetal(liquid, true);
}
onInventoryChanged();
}
onInventoryChanged();
//setWorldToInventory();
}
}
}
@@ -248,12 +248,20 @@ public class SmelteryLogic extends InventoryLogic
}
}
void addMoltenMetal (LiquidStack liquid, boolean first)
boolean addMoltenMetal (LiquidStack liquid, boolean first)
{
if (moltenMetal.size() == 0)
{
moltenMetal.add(liquid);
return true;
}
else
{
//System.out.println("Liquid: "+liquid.amount+" Current: "+currentLiquid+" Max: "+maxLiquid);
if (liquid.amount + currentLiquid > maxLiquid)
return false;
currentLiquid += liquid.amount;
boolean added = false;
//for (LiquidStack l : moltenMetal)
for (int i = 0; i < moltenMetal.size(); i++)
@@ -277,11 +285,13 @@ public class SmelteryLogic extends InventoryLogic
else
moltenMetal.add(liquid);
}
return true;
}
}
void updateTemperatures ()
{
inUse = true;
for (int i = 0; i < 9 * layers; i++)
{
meltingTemps[i] = Smeltery.instance.getLiquifyTemperature(inventory[i]);
@@ -300,15 +310,18 @@ public class SmelteryLogic extends InventoryLogic
}
if (tankContainer instanceof ITankContainer && inUse)
{
LiquidStack liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 50, false);
LiquidStack liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 150, false);
if (liquid != null && liquid.itemID == Block.lavaStill.blockID)
{
liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 50, true);
liquid = ((ITankContainer) tankContainer).drain(ForgeDirection.DOWN, 150, true);
useTime += liquid.amount;
ILiquidTank tank = ((ITankContainer) tankContainer).getTank(ForgeDirection.DOWN, liquid);
liquid = tank.getLiquid();
int capacity = tank.getCapacity();
fuelGague = liquid.amount * 52 / capacity;
if (liquid != null)
fuelGague = liquid.amount * 52 / capacity;
else
fuelGague = 0;
}
}
}
@@ -345,7 +358,7 @@ public class SmelteryLogic extends InventoryLogic
{
checkValidPlacement();
}
public void checkValidPlacement ()
{
switch (getRenderDirection())
@@ -418,6 +431,7 @@ public class SmelteryLogic extends InventoryLogic
internalTemp = 800;
activeLavaTank = lavaTanks.get(0);
adjustLayers(capacity, false);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
else
{
@@ -609,6 +623,7 @@ public class SmelteryLogic extends InventoryLogic
//liquid = null;
moltenMetal.remove(liquid);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
currentLiquid -= liq.amount;
}
return liq;
}
@@ -618,6 +633,7 @@ public class SmelteryLogic extends InventoryLogic
{
liquid.amount -= maxDrain;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
currentLiquid = 0;
}
return new LiquidStack(liquid.itemID, maxDrain, liquid.itemMeta);
}
@@ -625,7 +641,7 @@ public class SmelteryLogic extends InventoryLogic
public int fill (LiquidStack resource, boolean doFill)
{
if (resource != null)
if (resource != null && resource.amount + currentLiquid < maxLiquid)
{
int amount = resource.amount;
addMoltenMetal(resource, false);
@@ -650,7 +666,7 @@ public class SmelteryLogic extends InventoryLogic
}
/* NBT */
@Override
public void readFromNBT (NBTTagCompound tags)
{
@@ -663,6 +679,7 @@ public class SmelteryLogic extends InventoryLogic
{
direction = tags.getByte("Direction");
useTime = tags.getInteger("UseTime");
currentLiquid = tags.getInteger("CurrentLiquid");
maxLiquid = tags.getInteger("MaxLiquid");
layers = tags.getInteger("Layers");
meltingTemps = tags.getIntArray("MeltingTemps");
@@ -693,6 +710,7 @@ public class SmelteryLogic extends InventoryLogic
{
tags.setByte("Direction", direction);
tags.setInteger("UseTime", useTime);
tags.setInteger("CurrentLiquid", currentLiquid);
tags.setInteger("MaxLiquid", maxLiquid);
tags.setInteger("Layers", layers);
tags.setIntArray("MeltingTemps", meltingTemps);