This commit is contained in:
mDiyo 2013-02-06 18:19:14 -08:00
parent 4401066e81
commit a8386b634e
78 changed files with 2661 additions and 205 deletions

View File

@ -71,7 +71,7 @@ I also named them "Patterns", the chest a "Pattern Chest". I'm still angry at th
<page type="text">
<text>Tinker's Log #14
Today I learned just how hard it was to shape iron. First you have to dig it out of the earth. A wooden pickaxe will break the ore; this I found out the hard way. Once you do get that ore there isn't much to do with it besides throw it in the furnace. Melting the iron and the stone seems inefficient, but I do need the metal more than I care about the waste.
Today I learned just how hard it was to shape iron. First you have to dig it out of the earth. A wooden pickaxe will shatter the ore; this I found out the hard way. Once you do get that ore there isn't much to do with it besides throw it in the furnace. Melting the iron and the stone seems inefficient, but I do need the metal more than I care about the waste.
I shaped a few of the bars into tools, and they felt strong. Much stronger, in fact, than the ones back at the village. I've named the pickaxe "Krug" after some of the stories Nana used to tell me at night. How I miss her...</text>
</page>

View File

@ -1,9 +1,67 @@
<?xml version="1.0"?>
<book>
<page type="title">
<page type="intro">
<text>Materials and You
A Guide to Tools and Abilities</text>
A Guide to Tools and Abilities
Volume 1
By Skyla</text>
</page>
<page type="contents">
<text>Introduction
Worktables
Tools
Materials
Abilities
Modifiers
Notes</text>
<sidebar>1
2
3
4
5
6</sidebar>
</page>
<page type="text">
<text>Welcome to the first edition of Materials and You: A Guide to Tools and Abilities. Within you will find details on each tool and anything you can make them from. You will also find the key to becoming a great Tool Tinker: changing tools after they're created. Many of the best known tools have changed so much since their inception that they may as well be somethign else.
This book is a magic copy. Whenever the original is updated, this book will automatically copy the source.</text>
</page>
<page type="text">
<title>Worktables</title>
<text>
In general:
- Tools are made from parts
- Parts are created from materials using a pattern
We will create three separate areas for the creation of tools. The first will be for shaping patterns, the second for crafting parts out of materials, and the last will be the main station for finished products.</text>
</page>
<page type="text">
<text>Blank patterns are where the
</text>
</page>
<page type="craftingrecipe">
<title>Blank Wood Pattern</title>
<recipe>woodpattern</recipe>
</page>
<page type="text">
<text>The Stencil Table is where you shape blank patterns into something useful. This is done by punching a hole in precisely the shape you want the end result to look like. Materials can be place in the hole and combined until they resemble the end product.
</text>
</page>
<page type="craftingrecipe">
<title>Stencil Table</title>
<recipe>stenciltable</recipe>
</page>
<page type="text">
<text></text>
</page>
</book>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

View File

@ -44,10 +44,33 @@ public class PHConstruct {
heldItemBlock = config.getBlock("Held Item Block", 1472).getInt(1472);
lavaTank = config.getBlock("Lava Tank", 1473).getInt(1473);
smeltery = config.getBlock("Smeltery", 1474).getInt(1474);
ores = config.getBlock("Ore Block", 1475).getInt(1475);
craftedSoil = config.getBlock("Special Soil", 1476).getInt(1476);
searedBrick = config.getBlock("Seared Brick", 1477).getInt(1477);
axle = config.getBlock("Axle", 1478).getInt(1478);
craftedSoil = config.getBlock("Special Soil", 1476).getInt(1476);
ironFlowing = config.getBlock("Liquid Iron Flowing", 1478).getInt(1478);
ironStill = config.getBlock("Liquid Iron Still", 1479).getInt(1479);
goldFlowing = config.getBlock("Liquid Gold Flowing", 1480).getInt(1480);
goldStill = config.getBlock("Liquid Gold Still", 1481).getInt(1481);
copperFlowing = config.getBlock("Liquid Copper Flowing", 1482).getInt(1482);
copperStill = config.getBlock("Liquid Copper Still", 1483).getInt(1483);
tinFlowing = config.getBlock("Liquid Tin Flowing", 1484).getInt(1484);
tinStill = config.getBlock("Liquid Tin Still", 1485).getInt(1485);
aluminumFlowing = config.getBlock("Liquid Aluminum Flowing", 1486).getInt(1486);
aluminumStill = config.getBlock("Liquid Aluminum Still", 1487).getInt(1487);
cobaltFlowing = config.getBlock("Liquid Cobalt Flowing", 1488).getInt(1488);
cobaltStill = config.getBlock("Liquid Cobalt Still", 1489).getInt(1489);
arditeFlowing = config.getBlock("Liquid Ardite Flowing", 1490).getInt(1490);
arditeStill = config.getBlock("Liquid Ardite Still", 1491).getInt(1491);
bronzeFlowing = config.getBlock("Liquid Bronze Flowing", 1492).getInt(1492);
bronzeStill = config.getBlock("Liquid Bronze Still", 1493).getInt(1493);
brassFlowing = config.getBlock("Liquid Brass Flowing", 1494).getInt(1494);
brassStill = config.getBlock("Liquid Brass Still", 1495).getInt(1495);
manyullynFlowing = config.getBlock("Liquid Manyullyn Flowing", 1496).getInt(1496);
manyullynStill = config.getBlock("Liquid Manyullyn Still", 1497).getInt(1497);
alumiteFlowing = config.getBlock("Liquid Alumite Flowing", 1498).getInt(1498);
alumiteStill = config.getBlock("Liquid Alumite Still", 1499).getInt(1499);
obsidianFlowing = config.getBlock("Liquid Obsidian Flowing", 1500).getInt(1500);
obsidianStill = config.getBlock("Liquid Obsidian Still", 1501).getInt(1501);
manual = config.getItem("Patterns and Misc", "Tinker's Manual", 14018).getInt(14018);
blankPattern = config.getItem("Patterns and Misc", "Blank Patterns", 14019).getInt(14019);
@ -101,6 +124,33 @@ public class PHConstruct {
public static int searedBrick;
public static int axle;
public static int ironFlowing;
public static int ironStill;
public static int goldFlowing;
public static int goldStill;
public static int copperFlowing;
public static int copperStill;
public static int tinFlowing;
public static int tinStill;
public static int aluminumFlowing;
public static int aluminumStill;
public static int cobaltFlowing;
public static int cobaltStill;
public static int arditeFlowing;
public static int arditeStill;
public static int bronzeFlowing;
public static int bronzeStill;
public static int brassFlowing;
public static int brassStill;
public static int manyullynFlowing;
public static int manyullynStill;
public static int alumiteFlowing;
public static int alumiteStill;
public static int obsidianFlowing;
public static int obsidianStill;
//Patterns and misc
public static int blankPattern;
public static int materials;

View File

@ -28,7 +28,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
* @author: mDiyo
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.4.7_1.1.2")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.4.7_1.1.4")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels={"TConstruct"}, packetHandler = tinker.tconstruct.TPacketHandler.class)
public class TConstruct
{

View File

@ -8,39 +8,16 @@ import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tinker.common.IPattern;
import tinker.tconstruct.blocks.EquipBlock;
import tinker.tconstruct.blocks.TConstructBlock;
import tinker.tconstruct.blocks.ToolStationBlock;
import tinker.tconstruct.client.gui.ToolGuiElement;
import tinker.tconstruct.crafting.PatternBuilder;
import tinker.tconstruct.crafting.ToolBuilder;
import tinker.tconstruct.items.CraftingItem;
import tinker.tconstruct.items.Materials;
import tinker.tconstruct.items.Pattern;
import tinker.tconstruct.items.PatternManual;
import tinker.tconstruct.items.ToolPart;
import tinker.tconstruct.items.ToolShard;
import tinker.tconstruct.modifiers.ModBlaze;
import tinker.tconstruct.modifiers.ModBoolean;
import tinker.tconstruct.modifiers.ModDurability;
import tinker.tconstruct.modifiers.ModElectric;
import tinker.tconstruct.modifiers.ModInteger;
import tinker.tconstruct.modifiers.ModLapisBase;
import tinker.tconstruct.modifiers.ModLapisIncrease;
import tinker.tconstruct.modifiers.ModRedstone;
import tinker.tconstruct.modifiers.ModRepair;
import tinker.tconstruct.tools.Axe;
import tinker.tconstruct.tools.BattleSign;
import tinker.tconstruct.tools.Broadsword;
import tinker.tconstruct.tools.FryingPan;
import tinker.tconstruct.tools.Longsword;
import tinker.tconstruct.tools.LumberAxe;
import tinker.tconstruct.tools.Mattock;
import tinker.tconstruct.tools.Pickaxe;
import tinker.tconstruct.tools.Rapier;
import tinker.tconstruct.tools.Shovel;
import tinker.tconstruct.tools.ToolCore;
import tinker.tconstruct.blocks.*;
import tinker.tconstruct.blocks.liquids.*;
import tinker.tconstruct.client.gui.*;
import tinker.tconstruct.crafting.*;
import tinker.tconstruct.items.*;
import tinker.tconstruct.modifiers.*;
import tinker.tconstruct.tools.*;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
@ -97,6 +74,33 @@ public class TContent implements IFuelHandler
public static Block lavaTank;
public static Block craftedSoil;
public static Block searedBrick;
public static Block ironFlowing;
public static Block ironStill;
public static Block goldFlowing;
public static Block goldStill;
public static Block copperFlowing;
public static Block copperStill;
public static Block tinFlowing;
public static Block tinStill;
public static Block aluminumFlowing;
public static Block aluminumStill;
public static Block cobaltFlowing;
public static Block cobaltStill;
public static Block arditeFlowing;
public static Block arditeStill;
public static Block bronzeFlowing;
public static Block bronzeStill;
public static Block brassFlowing;
public static Block brassStill;
public static Block manyullynFlowing;
public static Block manyullynStill;
public static Block alumiteFlowing;
public static Block alumiteStill;
public static Block obsidianFlowing;
public static Block obsidianStill;
//public static Block axle;
//Tool modifiers
@ -105,10 +109,12 @@ public class TContent implements IFuelHandler
public TContent()
{
createEntities();
registerBlocks();
createItems();
addRenderMappings();
registerMaterials();
addToolRecipes();
addSmelteryRecipes();
addCraftingRecipes();
setupToolTabs();
addToolButtons();
@ -118,9 +124,10 @@ public class TContent implements IFuelHandler
void createEntities ()
{
EntityRegistry.registerModEntity(tinker.tconstruct.entity.CartEntity.class, "Small Wagon", 0, TConstruct.instance, 32, 5, true);
EntityRegistry.registerModEntity(tinker.tconstruct.entity.Skyla.class, "Skyla", 1, TConstruct.instance, 32, 5, true);
}
void createItems ()
void registerBlocks()
{
woodCrafter = new ToolStationBlock(PHConstruct.woodCrafter, Material.wood);
GameRegistry.registerBlock(woodCrafter, tinker.tconstruct.blocks.ToolStationItemBlock.class, "ToolStationBlock");
@ -136,13 +143,13 @@ public class TContent implements IFuelHandler
//ores = new TBaseOre(PHTools.ores, 48);
//GameRegistry.registerBlock(ores, tinker.toolconstruct.blocks.TBaseOreItem.class, "TConstruct.ores");
//lavaTank = new LavaTankBlock(PHConstruct.lavaTank);
//GameRegistry.registerBlock(lavaTank, "LavaTank");
//GameRegistry.registerTileEntity(tinker.tconstruct.logic.LavaTankLogic.class, "TConstruct.LavaTank");
lavaTank = new LavaTankBlock(PHConstruct.lavaTank);
GameRegistry.registerBlock(lavaTank, "LavaTank");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.LavaTankLogic.class, "TConstruct.LavaTank");
//smeltery = new SmelteryBlock(PHConstruct.smeltery);
//GameRegistry.registerBlock(smeltery, "Smeltery");
//GameRegistry.registerTileEntity(tinker.tconstruct.logic.SmelteryLogic.class, "TConstruct.Smeltery");
smeltery = new SmelteryBlock(PHConstruct.smeltery);
GameRegistry.registerBlock(smeltery, "Smeltery");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.SmelteryLogic.class, "TConstruct.Smeltery");
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, 96, Material.sand, 3.0F, 2);
craftedSoil.stepSound = Block.soundGravelFootstep;
@ -152,6 +159,58 @@ public class TContent implements IFuelHandler
GameRegistry.registerBlock(searedBrick, tinker.tconstruct.blocks.SearedBrickItemBlock.class, "SearedBrick");
MinecraftForge.setBlockHarvestLevel(searedBrick, 0, "pickaxe", 2);
ironFlowing = new IronFlowing(PHConstruct.ironFlowing).setBlockName("liquid.ironFlow");
GameRegistry.registerBlock(ironFlowing, "Liquid Iron Flowing");
ironStill = new IronStill(PHConstruct.ironStill).setBlockName("liquid.ironStill");
GameRegistry.registerBlock(ironStill, "Liquid Iron Still");
goldFlowing = new GoldStill(PHConstruct.goldFlowing).setBlockName("liquid.goldFlow");
GameRegistry.registerBlock(goldFlowing, "Liquid Gold Flowing");
goldStill = new GoldFlowing(PHConstruct.goldStill).setBlockName("liquid.goldStill");
GameRegistry.registerBlock(goldStill, "Liquid Gold Still");
copperFlowing = new CopperStill(PHConstruct.copperFlowing).setBlockName("liquid.copperFlow");
GameRegistry.registerBlock(copperFlowing, "Liquid copper Flowing");
copperStill = new CopperFlowing(PHConstruct.copperStill).setBlockName("liquid.copperStill");
GameRegistry.registerBlock(copperStill, "Liquid copper Still");
tinFlowing = new TinStill(PHConstruct.tinFlowing).setBlockName("liquid.tinFlow");
GameRegistry.registerBlock(tinFlowing, "Liquid tin Flowing");
tinStill = new TinFlowing(PHConstruct.tinStill).setBlockName("liquid.tinStill");
GameRegistry.registerBlock(tinStill, "Liquid tin Still");
aluminumFlowing = new AluminumStill(PHConstruct.aluminumFlowing).setBlockName("liquid.aluminumFlow");
GameRegistry.registerBlock(aluminumFlowing, "Liquid aluminum Flowing");
aluminumStill = new AluminumFlowing(PHConstruct.aluminumStill).setBlockName("liquid.aluminumStill");
GameRegistry.registerBlock(aluminumStill, "Liquid aluminum Still");
cobaltFlowing = new CobaltStill(PHConstruct.cobaltFlowing).setBlockName("liquid.cobaltFlow");
GameRegistry.registerBlock(cobaltFlowing, "Liquid cobalt Flowing");
cobaltStill = new CobaltFlowing(PHConstruct.cobaltStill).setBlockName("liquid.cobaltStill");
GameRegistry.registerBlock(cobaltStill, "Liquid cobalt Still");
arditeFlowing = new ArditeStill(PHConstruct.arditeFlowing).setBlockName("liquid.arditeFlow");
GameRegistry.registerBlock(arditeFlowing, "Liquid ardite Flowing");
arditeStill = new ArditeFlowing(PHConstruct.arditeStill).setBlockName("liquid.arditeStill");
GameRegistry.registerBlock(arditeStill, "Liquid ardite Still");
bronzeFlowing = new BronzeStill(PHConstruct.bronzeFlowing).setBlockName("liquid.bronzeFlow");
GameRegistry.registerBlock(bronzeFlowing, "Liquid bronze Flowing");
bronzeStill = new BronzeFlowing(PHConstruct.bronzeStill).setBlockName("liquid.bronzeStill");
GameRegistry.registerBlock(bronzeStill, "Liquid bronze Still");
brassFlowing = new BrassStill(PHConstruct.brassFlowing).setBlockName("liquid.brassFlow");
GameRegistry.registerBlock(brassFlowing, "Liquid brass Flowing");
brassStill = new BrassFlowing(PHConstruct.brassStill).setBlockName("liquid.brassStill");
GameRegistry.registerBlock(brassStill, "Liquid brass Still");
manyullynFlowing = new ManyullynStill(PHConstruct.manyullynFlowing).setBlockName("liquid.manyullynFlow");
GameRegistry.registerBlock(manyullynFlowing, "Liquid manyullyn Flowing");
manyullynStill = new ManyullynFlowing(PHConstruct.manyullynStill).setBlockName("liquid.manyullynStill");
GameRegistry.registerBlock(manyullynStill, "Liquid manyullun Still");
alumiteFlowing = new AlumiteStill(PHConstruct.alumiteFlowing).setBlockName("liquid.alumiteFlow");
GameRegistry.registerBlock(alumiteFlowing, "Liquid alumite Flowing");
alumiteStill = new AlumiteFlowing(PHConstruct.alumiteStill).setBlockName("liquid.alumiteStill");
GameRegistry.registerBlock(alumiteStill, "Liquid alumite Still");
obsidianFlowing = new ObsidianStill(PHConstruct.obsidianFlowing).setBlockName("liquid.obsidianFlow");
GameRegistry.registerBlock(obsidianFlowing, "Liquid obsidian Flowing");
obsidianStill = new ObsidianFlowing(PHConstruct.obsidianStill).setBlockName("liquid.obsidianStill");
GameRegistry.registerBlock(obsidianStill, "Liquid obsidian Still");
}
void createItems ()
{
blankPattern = new CraftingItem(PHConstruct.blankPattern, 96, craftingTexture).setItemName("tconstruct.BlankPattern");
materials = new Materials(PHConstruct.materials, 128, craftingTexture).setItemName("tconstruct.Materials");
toolRod = new ToolPart(PHConstruct.toolRod, 0, craftingTexture).setItemName("tconstruct.ToolRod");
@ -238,6 +297,31 @@ public class TContent implements IFuelHandler
TConstructRegistry.addToolMaterial(13, "Copper", 1, 1, 180, 500, 2, 1.15F, 0, 0f);
TConstructRegistry.addToolMaterial(14, "Bronze", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
//Thaumcraft
TConstructRegistry.addToolMaterial(21, "Thaumium", 2, 2, 250, 600, 2, 1.3F, 1, 0f);
//Metallurgy
TConstructRegistry.addToolMaterial(22, "Heptazion", 2, 2, 300, 800, 1, 1.0F, 0, 0f);
TConstructRegistry.addToolMaterial(23, "Damascus Steel", 2, 3, 500, 600, 2, 1.35F, 1, 0f);
TConstructRegistry.addToolMaterial(24, "Angmallen", 2, 2, 300, 800, 2, 0.8F, 0, 0f);
TConstructRegistry.addToolMaterial(25, "Steel", 2, 3, 750, 800, 3, 1.3F, 2, 0f);
TConstructRegistry.addToolMaterial(26, "Promethium", 1, 1, 200, 400, 1, 1.0F, 0, 0.5f);
TConstructRegistry.addToolMaterial(27, "Deep Iron", 1, 2, 250, 600, 2, 1.3F, 1, 0f);
TConstructRegistry.addToolMaterial(28, "Oureclase", 2, 3, 750, 800, 2, 1.2F, 0, 0f);
TConstructRegistry.addToolMaterial(29, "Aredrite", 2, 3, 1000, 400, 2, 1.5F, 0, 1.0f);
TConstructRegistry.addToolMaterial(30, "Astral Silver", 1, 4, 35, 1200, 1, 0.5F, 0, 0f);
TConstructRegistry.addToolMaterial(31, "Carmot", 1, 4, 50, 1200, 1, 0.5F, 0, 0f);
TConstructRegistry.addToolMaterial(32, "Mithril", 2, 4, 1000, 900, 3, 1.25F, 3, 0f);
TConstructRegistry.addToolMaterial(33, "Orichalcum", 2, 5, 1350, 900, 3, 1.25F, 0, 0f);
TConstructRegistry.addToolMaterial(34, "Adamantine", 3, 6, 1550, 1000, 4, 1.5F, 1, 0f);
TConstructRegistry.addToolMaterial(35, "Atlarus", 3, 6, 1750, 1000, 4, 1.6F, 2, 0f);
TConstructRegistry.addToolMaterial(36, "Black Steel", 2, 2, 500, 800, 2, 1.3F, 2, 0f);
TConstructRegistry.addToolMaterial(37, "Quicksilver", 2, 4, 1100, 1400, 3, 1.0F, 1, 0f);
TConstructRegistry.addToolMaterial(38, "Haderoth", 2, 4, 1250, 1200, 3, 1.0F, 2, 0f);
TConstructRegistry.addToolMaterial(39, "Celenegil", 3, 5, 1600, 1400, 3, 1.0F, 2, 0f);
TConstructRegistry.addToolMaterial(40, "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.stone, 2, "Stone", 1);
@ -296,6 +380,11 @@ public class TContent implements IFuelHandler
tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(materials, 1, 8) }, 8, "Necrotic", 1, "\u00a78", "Life Steal"));
}
void addSmelteryRecipes()
{
Smeltery.instance.addSmelting(Block.oreIron.blockID, 0, 35, new ItemStack(Item.ingotIron, 1, 0));
}
void addCraftingRecipes ()
{
/*GameRegistry.addRecipe(new ItemStack(woodCrafter, 1, 0), "c", 'c', Block.workbench);
@ -441,6 +530,7 @@ public class TContent implements IFuelHandler
public static String blockTexture = "/tinkertextures/ConstructBlocks.png";
public static String blankSprite = "/tinkertextures/blanksprite.png";
public static String liquidTexture = "/tinkertextures/LiquidWhite.png";
public static String craftingTexture = "/tinkertextures/materials.png";
public static String patternTexture = "/tinkertextures/tools/patterns.png";

View File

@ -13,6 +13,7 @@ import tinker.common.InventoryBlock;
import tinker.common.InventoryLogic;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.TGuiHandler;
import tinker.tconstruct.logic.SmelteryLogic;
public class SmelteryBlock extends InventoryBlock
@ -100,7 +101,7 @@ public class SmelteryBlock extends InventoryBlock
@Override
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
{
return 3;
return TGuiHandler.smeltery;
}
public void randomDisplayTick (World world, int x, int y, int z, Random random)

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class AluminumFlowing extends LiquidMetalFlowing
{
public AluminumFlowing(int id)
{
super(id);
blockIndexInTexture = 12;
}
@Override
public int stillLiquidId ()
{
return TContent.aluminumStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class AluminumStill extends LiquidMetalStill
{
public AluminumStill(int id)
{
super(id);
blockIndexInTexture = 12;
}
@Override
public int flowingLiquidID ()
{
return TContent.aluminumFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class AlumiteFlowing extends LiquidMetalFlowing
{
public AlumiteFlowing(int id)
{
super(id);
blockIndexInTexture = 64;
}
@Override
public int stillLiquidId ()
{
return TContent.alumiteStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class AlumiteStill extends LiquidMetalStill
{
public AlumiteStill(int id)
{
super(id);
blockIndexInTexture = 64;
}
@Override
public int flowingLiquidID ()
{
return TContent.alumiteFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ArditeFlowing extends LiquidMetalFlowing
{
public ArditeFlowing(int id)
{
super(id);
blockIndexInTexture = 35;
}
@Override
public int stillLiquidId ()
{
return TContent.arditeStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ArditeStill extends LiquidMetalStill
{
public ArditeStill(int id)
{
super(id);
blockIndexInTexture = 35;
}
@Override
public int flowingLiquidID ()
{
return TContent.arditeFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class BrassFlowing extends LiquidMetalFlowing
{
public BrassFlowing(int id)
{
super(id);
blockIndexInTexture = 41;
}
@Override
public int stillLiquidId ()
{
return TContent.brassStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class BrassStill extends LiquidMetalStill
{
public BrassStill(int id)
{
super(id);
blockIndexInTexture = 41;
}
@Override
public int flowingLiquidID ()
{
return TContent.brassFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class BronzeFlowing extends LiquidMetalFlowing
{
public BronzeFlowing(int id)
{
super(id);
blockIndexInTexture = 38;
}
@Override
public int stillLiquidId ()
{
return TContent.bronzeStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class BronzeStill extends LiquidMetalStill
{
public BronzeStill(int id)
{
super(id);
blockIndexInTexture = 38;
}
@Override
public int flowingLiquidID ()
{
return TContent.bronzeFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class CobaltFlowing extends LiquidMetalFlowing
{
public CobaltFlowing(int id)
{
super(id);
blockIndexInTexture = 32;
}
@Override
public int stillLiquidId ()
{
return TContent.cobaltStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class CobaltStill extends LiquidMetalStill
{
public CobaltStill(int id)
{
super(id);
blockIndexInTexture = 32;
}
@Override
public int flowingLiquidID ()
{
return TContent.cobaltFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class CopperFlowing extends LiquidMetalFlowing
{
public CopperFlowing(int id)
{
super(id);
blockIndexInTexture = 6;
}
@Override
public int stillLiquidId ()
{
return TContent.copperStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class CopperStill extends LiquidMetalStill
{
public CopperStill(int id)
{
super(id);
blockIndexInTexture = 6;
}
@Override
public int flowingLiquidID ()
{
return TContent.copperFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class GoldFlowing extends LiquidMetalFlowing
{
public GoldFlowing(int id)
{
super(id);
blockIndexInTexture = 3;
}
@Override
public int stillLiquidId ()
{
return TContent.goldStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class GoldStill extends LiquidMetalStill
{
public GoldStill(int id)
{
super(id);
blockIndexInTexture = 3;
}
@Override
public int flowingLiquidID ()
{
return TContent.goldFlowing.blockID;
}
}

View File

@ -0,0 +1,18 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class IronFlowing extends LiquidMetalFlowing
{
public IronFlowing(int id)
{
super(id);
}
@Override
public int stillLiquidId ()
{
return TContent.ironStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class IronStill extends LiquidMetalStill
{
public IronStill(int id)
{
super(id);
//blockIndexInTexture = 128;
}
@Override
public int flowingLiquidID ()
{
return TContent.ironFlowing.blockID;
}
}

View File

@ -0,0 +1,317 @@
package tinker.tconstruct.blocks.liquids;
import java.util.Random;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.liquidrender.RenderLiquidMetal;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
public abstract class LiquidMetalFlowing extends BlockFluid implements ILiquid
{
int numAdjacentSources = 0;
boolean isOptimalFlowDirection[] = new boolean[4];
int flowCost[] = new int[4];
public LiquidMetalFlowing(int id)
{
super(id, Material.lava);
setHardness(100F);
}
@Override
public int getRenderType ()
{
return RenderLiquidMetal.liquidModel;
}
@Override
public String getTextureFile ()
{
return TContent.liquidTexture;
}
private void updateFlow (World world, int x, int y, int z)
{
int l = world.getBlockMetadata(x, y, z);
world.setBlockAndMetadata(x, y, z, stillLiquidId(), l);
world.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
world.markBlockForUpdate(x, y, z);
}
@Override
public void updateTick (World world, int i, int j, int k, Random random)
{
int l = getFlowDecay(world, i, j, k);
byte byte0 = 1;
boolean flag = true;
if (l > 0)
{
int i1 = -100;
numAdjacentSources = 0;
i1 = getSmallestFlowDecay(world, i - 1, j, k, i1);
i1 = getSmallestFlowDecay(world, i + 1, j, k, i1);
i1 = getSmallestFlowDecay(world, i, j, k - 1, i1);
i1 = getSmallestFlowDecay(world, i, j, k + 1, i1);
int j1 = i1 + byte0;
if (j1 >= 8 || i1 < 0)
{
j1 = -1;
}
if (getFlowDecay(world, i, j + 1, k) >= 0)
{
int l1 = getFlowDecay(world, i, j + 1, k);
if (l1 >= 8)
{
j1 = l1;
}
else
{
j1 = l1 + 8;
}
}
if (j1 != l)
{
l = j1;
if (l < 0)
{
world.setBlockWithNotify(i, j, k, 0);
}
else
{
world.setBlockMetadataWithNotify(i, j, k, l);
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
}
}
else if (flag)
{
updateFlow(world, i, j, k);
}
}
else
{
updateFlow(world, i, j, k);
}
if (liquidCanDisplaceBlock(world, i, j - 1, k))
{
if (l >= 8)
{
world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l);
}
else
{
world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l + 8);
}
}
else if (l >= 0 && (l == 0 || blockBlocksFlow(world, i, j - 1, k)))
{
boolean aflag[] = getOptimalFlowDirections(world, i, j, k);
int k1 = l + byte0;
if (l >= 8)
{
k1 = 1;
}
if (k1 >= 8)
return;
if (aflag[0])
{
flowIntoBlock(world, i - 1, j, k, k1);
}
if (aflag[1])
{
flowIntoBlock(world, i + 1, j, k, k1);
}
if (aflag[2])
{
flowIntoBlock(world, i, j, k - 1, k1);
}
if (aflag[3])
{
flowIntoBlock(world, i, j, k + 1, k1);
}
}
}
private void flowIntoBlock (World world, int i, int j, int k, int l)
{
if (liquidCanDisplaceBlock(world, i, j, k))
{
int i1 = world.getBlockId(i, j, k);
if (i1 > 0)
{
Block.blocksList[i1].dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
}
world.setBlockAndMetadataWithNotify(i, j, k, blockID, l);
}
}
private int calculateFlowCost (World world, int i, int j, int k, int l, int i1)
{
int j1 = 1000;
for (int k1 = 0; k1 < 4; k1++)
{
if (k1 == 0 && i1 == 1 || k1 == 1 && i1 == 0 || k1 == 2 && i1 == 3 || k1 == 3 && i1 == 2)
{
continue;
}
int l1 = i;
int i2 = j;
int j2 = k;
if (k1 == 0)
{
l1--;
}
if (k1 == 1)
{
l1++;
}
if (k1 == 2)
{
j2--;
}
if (k1 == 3)
{
j2++;
}
if (blockBlocksFlow(world, l1, i2, j2) || world.getBlockMaterial(l1, i2, j2) == blockMaterial && world.getBlockMetadata(l1, i2, j2) == 0)
{
continue;
}
if (!blockBlocksFlow(world, l1, i2 - 1, j2))
return l;
if (l >= 4)
{
continue;
}
int k2 = calculateFlowCost(world, l1, i2, j2, l + 1, k1);
if (k2 < j1)
{
j1 = k2;
}
}
return j1;
}
private boolean[] getOptimalFlowDirections (World world, int x, int y, int z)
{
for (int l = 0; l < 4; l++)
{
flowCost[l] = 1000;
int j1 = x;
int i2 = y;
int j2 = z;
if (l == 0)
{
j1--;
}
if (l == 1)
{
j1++;
}
if (l == 2)
{
j2--;
}
if (l == 3)
{
j2++;
}
if (blockBlocksFlow(world, j1, i2, j2) || world.getBlockMaterial(j1, i2, j2) == blockMaterial && world.getBlockMetadata(j1, i2, j2) == 0)
{
continue;
}
if (!blockBlocksFlow(world, j1, i2 - 1, j2))
{
flowCost[l] = 0;
}
else
{
flowCost[l] = calculateFlowCost(world, j1, i2, j2, 1, l);
}
}
int i1 = flowCost[0];
for (int k1 = 1; k1 < 4; k1++)
{
if (flowCost[k1] < i1)
{
i1 = flowCost[k1];
}
}
for (int l1 = 0; l1 < 4; l1++)
{
isOptimalFlowDirection[l1] = flowCost[l1] == i1;
}
return isOptimalFlowDirection;
}
private boolean blockBlocksFlow (World world, int x, int y, int z)
{
int l = world.getBlockId(x, y, z);
if (l == Block.doorWood.blockID || l == Block.doorSteel.blockID || l == Block.signPost.blockID || l == Block.ladder.blockID || l == Block.reed.blockID)
return true;
if (l == 0)
return false;
Material material = Block.blocksList[l].blockMaterial;
return material.isSolid();
}
protected int getSmallestFlowDecay (World world, int i, int j, int k, int l)
{
int i1 = getFlowDecay(world, i, j, k);
if (i1 < 0)
return l;
if (i1 >= 8)
{
i1 = 0;
}
return l >= 0 && i1 >= l ? l : i1;
}
private boolean liquidCanDisplaceBlock (World world, int i, int j, int k)
{
Material material = world.getBlockMaterial(i, j, k);
if (material == blockMaterial)
return false;
else
return !blockBlocksFlow(world, i, j, k);
}
@Override
public void onBlockAdded (World world, int i, int j, int k)
{
super.onBlockAdded(world, i, j, k);
if (world.getBlockId(i, j, k) == blockID)
{
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
}
}
@Override
public int stillLiquidMeta ()
{
return 0;
}
@Override
public boolean isMetaSensitive ()
{
return false;
}
@Override
public boolean isBlockReplaceable (World world, int i, int j, int k)
{
return true;
}
}

View File

@ -0,0 +1,151 @@
package tinker.tconstruct.blocks.liquids;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStationary;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquid;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.client.liquidrender.RenderLiquidMetal;
public abstract class LiquidMetalStill extends BlockStationary implements ILiquid
{
public LiquidMetalStill(int id)
{
super(id, Material.lava);
this.setCreativeTab(TConstruct.blockTab);
}
@Override
public int getRenderType ()
{
return RenderLiquidMetal.liquidModel;
}
@Override
public String getTextureFile()
{
return TContent.liquidTexture;
}
@Override
public int stillLiquidId ()
{
return this.blockID;
}
public abstract int flowingLiquidID();
@Override
public boolean isMetaSensitive ()
{
return false;
}
@Override
public int stillLiquidMeta ()
{
return 0;
}
@Override
public boolean isBlockReplaceable (World world, int i, int j, int k)
{
return true;
}
@Override
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
this.tryToHarden(par1World, par2, par3, par4);
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
{
this.unsetStationary(par1World, par2, par3, par4);
}
}
private void tryToHarden(World par1World, int par2, int par3, int par4)
{
if (par1World.getBlockId(par2, par3, par4) == this.blockID)
{
if (this.blockMaterial == Material.lava)
{
boolean var5 = false;
if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water)
{
var5 = true;
}
if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water)
{
var5 = true;
}
if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water)
{
var5 = true;
}
if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water)
{
var5 = true;
}
if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water)
{
var5 = true;
}
if (var5)
{
/*int var6 = par1World.getBlockMetadata(par2, par3, par4);
if (var6 == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.obsidian.blockID);
}
else if (var6 <= 4)
{
par1World.setBlockWithNotify(par2, par3, par4, Block.cobblestone.blockID);
}*/
this.triggerLavaMixEffects(par1World, par2, par3, par4);
}
}
}
}
/**
* Creates fizzing sound and smoke. Used when lava flows over block or mixes with water.
*/
protected void triggerLavaMixEffects(World par1World, int par2, int par3, int par4)
{
par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F);
for (int var5 = 0; var5 < 8; ++var5)
{
par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D);
}
}
private void unsetStationary(World par1World, int par2, int par3, int par4)
{
System.out.println("unsetStationary");
int var5 = par1World.getBlockMetadata(par2, par3, par4);
par1World.editingBlocks = true;
par1World.setBlockAndMetadata(par2, par3, par4, flowingLiquidID(), var5);
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
par1World.scheduleBlockUpdate(par2, par3, par4, flowingLiquidID(), this.tickRate());
par1World.editingBlocks = false;
}
/*@Override
public int tickRate()
{
return 18;
}*/
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ManyullynFlowing extends LiquidMetalFlowing
{
public ManyullynFlowing(int id)
{
super(id);
blockIndexInTexture = 44;
}
@Override
public int stillLiquidId ()
{
return TContent.manyullynStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ManyullynStill extends LiquidMetalStill
{
public ManyullynStill(int id)
{
super(id);
blockIndexInTexture = 44;
}
@Override
public int flowingLiquidID ()
{
return TContent.manyullynFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ObsidianFlowing extends LiquidMetalFlowing
{
public ObsidianFlowing(int id)
{
super(id);
blockIndexInTexture = 67;
}
@Override
public int stillLiquidId ()
{
return TContent.obsidianStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class ObsidianStill extends LiquidMetalStill
{
public ObsidianStill(int id)
{
super(id);
blockIndexInTexture = 67;
}
@Override
public int flowingLiquidID ()
{
return TContent.obsidianFlowing.blockID;
}
}

View File

@ -0,0 +1,19 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class TinFlowing extends LiquidMetalFlowing
{
public TinFlowing(int id)
{
super(id);
blockIndexInTexture = 9;
}
@Override
public int stillLiquidId ()
{
return TContent.tinStill.blockID;
}
}

View File

@ -0,0 +1,20 @@
package tinker.tconstruct.blocks.liquids;
import tinker.tconstruct.TContent;
public class TinStill extends LiquidMetalStill
{
public TinStill(int id)
{
super(id);
blockIndexInTexture = 9;
}
@Override
public int flowingLiquidID ()
{
return TContent.tinFlowing.blockID;
}
}

View File

@ -161,7 +161,7 @@ public class SuperCustomToolRenderer implements IItemRenderer
GL11.glTranslatef(-1.1875f, 0.25F, 0.45F); //Edited to position properly
renderItemIn2D(var5, var8, var9, var7, var10, 0.0625F);
if (stack != null && stack.hasEffect())
if (stack != null && stack.hasEffect() && !baseSprite && renderPass == 2)
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GL11.glDisable(GL11.GL_LIGHTING);

View File

@ -1,25 +1,24 @@
package tinker.tconstruct.client;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import org.w3c.dom.Document;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import tinker.tconstruct.TConstructRegistry;
import tinker.tconstruct.TProxyCommon;
import tinker.tconstruct.*;
import tinker.tconstruct.client.entityrender.*;
import tinker.tconstruct.client.liquidrender.*;
import tinker.tconstruct.tools.ToolCore;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@ -32,10 +31,38 @@ public class TProxyClient extends TProxyCommon
Minecraft mc = Minecraft.getMinecraft();
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, "/font/default.png", mc.renderEngine, false);
RenderingRegistry.registerBlockHandler(new TableRender());
//RenderingRegistry.registerBlockHandler(new TankRender());
RenderingRegistry.registerBlockHandler(new TankRender());
RenderingRegistry.registerBlockHandler(new FrypanRender());
RenderingRegistry.registerBlockHandler(new RenderLiquidMetal());
//RenderingRegistry.registerBlockHandler(new AxleRender());
RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
renderEngine.registerTextureFX(new LiquidIronFX());
renderEngine.registerTextureFX(new LiquidIronFlowFX());
renderEngine.registerTextureFX(new LiquidGoldFX());
renderEngine.registerTextureFX(new LiquidGoldFlowFX());
renderEngine.registerTextureFX(new LiquidCopperFX());
renderEngine.registerTextureFX(new LiquidCopperFlowFX());
renderEngine.registerTextureFX(new LiquidTinFX());
renderEngine.registerTextureFX(new LiquidTinFlowFX());
renderEngine.registerTextureFX(new LiquidAluminumFX());
renderEngine.registerTextureFX(new LiquidAluminumFlowFX());
renderEngine.registerTextureFX(new LiquidCobaltFX());
renderEngine.registerTextureFX(new LiquidCobaltFlowFX());
renderEngine.registerTextureFX(new LiquidArditeFX());
renderEngine.registerTextureFX(new LiquidArditeFlowFX());
renderEngine.registerTextureFX(new LiquidBronzeFX());
renderEngine.registerTextureFX(new LiquidBronzeFlowFX());
renderEngine.registerTextureFX(new LiquidBrassFX());
renderEngine.registerTextureFX(new LiquidBrassFlowFX());
renderEngine.registerTextureFX(new LiquidManyullynFX());
renderEngine.registerTextureFX(new LiquidManyullynFlowFX());
renderEngine.registerTextureFX(new LiquidAlumiteFX());
renderEngine.registerTextureFX(new LiquidAlumiteFlowFX());
renderEngine.registerTextureFX(new LiquidObsidianFX());
renderEngine.registerTextureFX(new LiquidObsidianFlowFX());
//Tools
MinecraftForgeClient.preloadTexture(TContent.blockTexture);
IItemRenderer render = new SuperCustomToolRenderer();
for (ToolCore tool : TConstructRegistry.tools)
@ -43,14 +70,16 @@ public class TProxyClient extends TProxyCommon
MinecraftForgeClient.registerItemRenderer(tool.itemID, render);
}
//Entities
RenderingRegistry.registerEntityRenderingHandler(tinker.tconstruct.entity.CartEntity.class, new CartRender());
RenderingRegistry.registerEntityRenderingHandler(tinker.tconstruct.entity.Skyla.class, new SkylaRender());
}
/* Ties an internal name to a visible one. */
public void addNames()
{
//LanguageRegistry.addName(TConstructContent.lavaTank, "Lava Tank");
LanguageRegistry.addName(TContent.lavaTank, "Lava Tank");
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructTools", "TConstruct Tools");
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructMaterials", "TConstruct Materials");
LanguageRegistry.instance().addStringLocalization("itemGroup.TConstructBlocks", "TConstruct Blocks");
@ -102,7 +131,7 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName);
}
//LanguageRegistry.addName(TConstructContent.smeltery, "Smeltery");
LanguageRegistry.addName(TContent.smeltery, "Smeltery");
LanguageRegistry.addName(TContent.manualBook, "Tinker's Log");
LanguageRegistry.addName(TContent.blankPattern, "Blank Pattern");
LanguageRegistry.addName(TContent.pickaxe, "Pickaxe");
@ -115,6 +144,32 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.addName(TContent.battlesign, "Battlesign");
LanguageRegistry.addName(TContent.mattock, "Mattock");
LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe");
LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
LanguageRegistry.addName(TContent.ironStill, "Liquid Iron");
LanguageRegistry.addName(TContent.goldFlowing, "Liquid Gold");
LanguageRegistry.addName(TContent.goldStill, "Liquid Gold");
LanguageRegistry.addName(TContent.copperFlowing, "Liquid Copper");
LanguageRegistry.addName(TContent.copperStill, "Liquid Copper");
LanguageRegistry.addName(TContent.tinFlowing, "Liquid Tin");
LanguageRegistry.addName(TContent.tinStill, "Liquid Tin");
LanguageRegistry.addName(TContent.aluminumFlowing, "Liquid Aluminum");
LanguageRegistry.addName(TContent.aluminumStill, "Liquid Aluminum");
LanguageRegistry.addName(TContent.cobaltFlowing, "Liquid Cobalt");
LanguageRegistry.addName(TContent.cobaltStill, "Liquid Cobalt");
LanguageRegistry.addName(TContent.arditeFlowing, "Liquid Ardite");
LanguageRegistry.addName(TContent.arditeStill, "Liquid Ardite");
LanguageRegistry.addName(TContent.bronzeFlowing, "Liquid Bronze");
LanguageRegistry.addName(TContent.bronzeStill, "Liquid Bronze");
LanguageRegistry.addName(TContent.brassFlowing, "Liquid Brass");
LanguageRegistry.addName(TContent.brassStill, "Liquid Brass");
LanguageRegistry.addName(TContent.alumiteFlowing, "Liquid Alumite");
LanguageRegistry.addName(TContent.alumiteStill, "Liquid Alumite");
LanguageRegistry.addName(TContent.manyullynFlowing, "Liquid Manyullyn");
LanguageRegistry.addName(TContent.manyullynStill, "Liquid Manyullyn");
LanguageRegistry.addName(TContent.obsidianFlowing, "Liquid Obsidian");
LanguageRegistry.addName(TContent.obsidianStill, "Liquid Obsidian");
}
@ -174,8 +229,8 @@ public class TProxyClient extends TProxyCommon
{
switch (stack.getItemDamage())
{
case 0: return diary;
case 1: return volume1;
case 1: return diary;
case 0: return volume1;
}
return null;

View File

@ -35,7 +35,7 @@ public class TankRender implements ISimpleBlockRenderingHandler
Block liquidBlock = Block.blocksList[logic.liquid.itemID];
if (liquidBlock != null)
{
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount()/1020f, 0.97);
renderer.setRenderBounds(0.03, 0.03, 0.03, 0.97, logic.getLiquidAmount()/4020f, 0.97);
renderer.renderStandardBlock(liquidBlock, x, y, z);
}
}

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.client;
package tinker.tconstruct.client.entityrender;
import net.minecraft.block.Block;
import net.minecraft.client.model.ModelBase;

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.client;
package tinker.tconstruct.client.entityrender;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.client;
package tinker.tconstruct.client.entityrender;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

View File

@ -0,0 +1,229 @@
package tinker.tconstruct.client.entityrender;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class SkylaModel extends ModelBase
{
ModelRenderer Head;
ModelRenderer Hair;
ModelRenderer Neck;
ModelRenderer Torso;
ModelRenderer Breast;
ModelRenderer RightArm;
ModelRenderer LeftArm;
ModelRenderer RightHand;
ModelRenderer LeftHand;
ModelRenderer RightLeg;
ModelRenderer LeftLeg;
ModelRenderer RightFoot;
ModelRenderer LeftFoot;
ModelRenderer WingBaseRight;
ModelRenderer WingEdgeRight;
ModelRenderer WingInsetRight;
ModelRenderer WingCenterRight;
ModelRenderer WingFlangeRight;
ModelRenderer WingAuxRight;
ModelRenderer WingBaseLeft;
ModelRenderer WingEdgeLeft;
ModelRenderer WingInsetLeft;
ModelRenderer WingCenterLeft;
ModelRenderer WingFlangeLeft;
ModelRenderer WingAuxLeft;
public SkylaModel()
{
textureWidth = 64;
textureHeight = 64;
Head = new ModelRenderer(this, 0, 0);
Head.addBox(-4F, -8F, -4F, 8, 8, 8);
Head.setRotationPoint(0F, -3F, 0F);
setRotation(Head, 0F, 0F, 0F);
Hair = new ModelRenderer(this, 32, 0);
Hair.addBox(-4F, -4F, -4F, 8, 8, 8, 0.5F);
Hair.setRotationPoint(0F, -7F, 0F);
setRotation(Hair, 0F, 0F, 0F);
Neck = new ModelRenderer(this, 0, 0);
Neck.addBox(-1F, 0F, -1F, 2, 1, 2);
Neck.setRotationPoint(0F, -3F, 0F);
setRotation(Neck, 0F, 0F, 0F);
Torso = new ModelRenderer(this, 0, 16);
Torso.addBox(-1.5F, 0F, -1F, 3, 8, 2);
Torso.setRotationPoint(0F, -2F, 0F);
setRotation(Torso, 0F, 0F, 0F);
Breast = new ModelRenderer(this, 0, 4);
Breast.addBox(-1.5F, 0F, 0F, 3, 3, 1);
Breast.setRotationPoint(0F, -1F, -1F);
setRotation(Breast, -0.2617994F, 0F, 0F);
RightArm = new ModelRenderer(this, 14, 16);
RightArm.addBox(-1.5F, -1F, -1F, 2, 7, 2);
RightArm.setRotationPoint(-2F, -1F, 0.1F);
setRotation(RightArm, 0F, 0F, 0F);
LeftArm = new ModelRenderer(this, 22, 16);
LeftArm.addBox(-0.5F, -1F, -1F, 2, 7, 2);
LeftArm.setRotationPoint(2F, -1F, 0.1F);
setRotation(LeftArm, 0F, 0F, 0F);
RightHand = new ModelRenderer(this, 14, 25);
RightHand.addBox(-1F, 0F, -2F, 2, 8, 2);
RightHand.setRotationPoint(-0.5F, 6F, 1.1F);
setRotation(RightHand, 0F, 0F, 0F);
LeftHand = new ModelRenderer(this, 22, 25);
LeftHand.addBox(-1F, 0F, -2F, 2, 8, 2);
LeftHand.setRotationPoint(0.5F, 6F, 1.1F);
setRotation(LeftHand, 0F, 0F, 0F);
LeftArm.addChild(LeftHand);
RightArm.addChild(RightHand);
RightLeg = new ModelRenderer(this, 30, 16);
RightLeg.addBox(-1F, 0F, -1F, 2, 8, 2);
RightLeg.setRotationPoint(-1F, 6F, 0F);
setRotation(RightLeg, 0F, 0F, 0F);
LeftLeg = new ModelRenderer(this, 38, 16);
LeftLeg.addBox(-1F, 0F, -1F, 2, 8, 2);
LeftLeg.setRotationPoint(1F, 6F, 0F);
setRotation(LeftLeg, 0F, 0F, 0F);
RightFoot = new ModelRenderer(this, 30, 26);
RightFoot.addBox(-1F, 0F, 0F, 2, 10, 2);
RightFoot.setRotationPoint(0F, 8F, -1F);
setRotation(RightFoot, 0F, 0F, 0F);
LeftFoot = new ModelRenderer(this, 38, 26);
LeftFoot.addBox(-1F, 0F, 0F, 2, 10, 2);
LeftFoot.setRotationPoint(0F, 8F, -1F);
setRotation(LeftFoot, 0F, 0F, 0F);
LeftLeg.addChild(LeftFoot);
RightLeg.addChild(RightFoot);
//Right Wing
WingBaseRight = new ModelRenderer(this, 0, 36);
WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10);
WingBaseRight.setRotationPoint(-1F, 1F, 0F);
setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F);
WingEdgeRight = new ModelRenderer(this, 0, 48); //Texture position
WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size
WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position
setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians
WingInsetRight = new ModelRenderer(this, 6, 48);
WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2);
WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F);
setRotation(WingInsetRight, 0.3490659F, 0F, 0F);
WingCenterRight = new ModelRenderer(this, 12, 48);
WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2);
WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F);
setRotation(WingCenterRight, 0.1745329F, 0F, 0F);
WingFlangeRight = new ModelRenderer(this, 18, 48);
WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2);
WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F);
setRotation(WingFlangeRight, 0F, 0F, 0F);
WingAuxRight = new ModelRenderer(this, 24, 48);
WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2);
WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F);
setRotation(WingAuxRight, -0.1745329F, 0F, 0F);
WingBaseRight.addChild(WingEdgeRight);
WingBaseRight.addChild(WingInsetRight);
WingBaseRight.addChild(WingCenterRight);
WingBaseRight.addChild(WingFlangeRight);
WingBaseRight.addChild(WingAuxRight);
//Left Wing
WingBaseLeft = new ModelRenderer(this, 42, 36);
WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10);
WingBaseLeft.setRotationPoint(1F, 1F, 0F);
setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F);
WingEdgeLeft = new ModelRenderer(this, 58, 48);
WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2);
WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F);
setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F);
WingInsetLeft = new ModelRenderer(this, 52, 48);
WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2);
WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F);
setRotation(WingInsetLeft, 0.3490659F, 0F, 0F);
WingCenterLeft = new ModelRenderer(this, 46, 48);
WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2);
WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F);
setRotation(WingCenterLeft, 0.1745329F, 0F, 0F);
WingFlangeLeft = new ModelRenderer(this, 40, 48);
WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2);
WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F);
setRotation(WingFlangeLeft, 0F, 0F, 0F);
WingAuxLeft = new ModelRenderer(this, 34, 48);
WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2);
WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F);
setRotation(WingAuxLeft, -0.1745329F, 0F, 0F);
WingBaseLeft.addChild(WingEdgeLeft);
WingBaseLeft.addChild(WingInsetLeft);
WingBaseLeft.addChild(WingCenterLeft);
WingBaseLeft.addChild(WingFlangeLeft);
WingBaseLeft.addChild(WingAuxLeft);
}
public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Head.render(f5);
Hair.render(f5);
Neck.render(f5);
Torso.render(f5);
Breast.render(f5);
RightArm.render(f5);
LeftArm.render(f5);
//RightHand.render(f5);
//LeftHand.render(f5);
RightLeg.render(f5);
LeftLeg.render(f5);
//RightFoot.render(f5);
//LeftFoot.render(f5);
WingBaseRight.render(f5);
//WingEdgeRight.render(f5);
//WingInsetRight.render(f5);
//WingCenterRight.render(f5);
//WingFlangeRight.render(f5);
//WingAuxRight.render(f5);
WingBaseLeft.render(f5);
//WingEdgeLeft.render(f5);
//WingInsetLeft.render(f5);
//WingCenterLeft.render(f5);
//WingFlangeLeft.render(f5);
//WingAuxLeft.render(f5);
}
private void setRotation (ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
}

View File

@ -0,0 +1,164 @@
package tinker.tconstruct.client.entityrender;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import tinker.tconstruct.entity.Skyla;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class SkylaRender extends RenderLiving
{
/** The creeper model. */
private ModelBase creeperModel = new SkylaModel();
public SkylaRender()
{
super(new SkylaModel(), 0.5F);
}
/**
* Updates creeper scale in prerender callback
*/
protected void updateCreeperScale(Skyla par1EntityCreeper, float par2)
{
float var4 = par1EntityCreeper.getCreeperFlashIntensity(par2);
float var5 = 1.0F + MathHelper.sin(var4 * 100.0F) * var4 * 0.01F;
if (var4 < 0.0F)
{
var4 = 0.0F;
}
if (var4 > 1.0F)
{
var4 = 1.0F;
}
var4 *= var4;
var4 *= var4;
float var6 = (1.0F + var4 * 0.4F) * var5;
float var7 = (1.0F + var4 * 0.1F) / var5;
GL11.glScalef(var6, var7, var6);
}
/**
* Updates color multiplier based on creeper state called by getColorMultiplier
*/
protected int updateCreeperColorMultiplier(Skyla par1EntityCreeper, float par2, float par3)
{
float var5 = par1EntityCreeper.getCreeperFlashIntensity(par3);
if ((int)(var5 * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int var6 = (int)(var5 * 0.2F * 255.0F);
if (var6 < 0)
{
var6 = 0;
}
if (var6 > 255)
{
var6 = 255;
}
short var7 = 255;
short var8 = 255;
short var9 = 255;
return var6 << 24 | var7 << 16 | var8 << 8 | var9;
}
}
/**
* A method used to render a creeper's powered form as a pass model.
*/
protected int renderCreeperPassModel(Skyla par1EntityCreeper, int par2, float par3)
{
if (par1EntityCreeper.getPowered())
{
if (par1EntityCreeper.getHasActivePotion())
{
GL11.glDepthMask(false);
}
else
{
GL11.glDepthMask(true);
}
if (par2 == 1)
{
float var4 = (float)par1EntityCreeper.ticksExisted + par3;
this.loadTexture("/armor/power.png");
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float var5 = var4 * 0.01F;
float var6 = var4 * 0.01F;
GL11.glTranslatef(var5, var6, 0.0F);
this.setRenderPassModel(this.creeperModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float var7 = 0.5F;
GL11.glColor4f(var7, var7, var7, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
return 1;
}
if (par2 == 2)
{
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
}
}
return -1;
}
protected int func_77061_b(Skyla par1EntityCreeper, int par2, float par3)
{
return -1;
}
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityLiving par1EntityLiving, float par2)
{
this.updateCreeperScale((Skyla)par1EntityLiving, par2);
}
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
protected int getColorMultiplier(EntityLiving par1EntityLiving, float par2, float par3)
{
return this.updateCreeperColorMultiplier((Skyla)par1EntityLiving, par2, par3);
}
/**
* Queries whether should render the specified pass or not.
*/
protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
{
return this.renderCreeperPassModel((Skyla)par1EntityLiving, par2, par3);
}
protected int inheritRenderPass(EntityLiving par1EntityLiving, int par2, float par3)
{
return this.func_77061_b((Skyla)par1EntityLiving, par2, par3);
}
}

View File

@ -35,9 +35,6 @@ public class GuiManual extends GuiScreen
String textLeft;
String textRight;
private final int textHash = "text".hashCode();
private final int titleHash = "title".hashCode();
public GuiManual(ItemStack stack, Document doc)
{
this.itemstackBook = stack;
@ -106,7 +103,10 @@ public class GuiManual extends GuiScreen
Element element = (Element) node;
//System.out.println("TypeL: "+eElement.getAttribute("type"));
pageLeftType = element.getAttribute("type");
textLeft = element.getElementsByTagName("text").item(0).getTextContent();
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textLeft = nodes.item(0).getTextContent();
//textLeft = element.getElementsByTagName("text").item(0).getTextContent();
}
node = nList.item(currentPage+1);
@ -114,7 +114,9 @@ public class GuiManual extends GuiScreen
{
Element element = (Element) node;
pageRightType = element.getAttribute("type");
textRight = element.getElementsByTagName("text").item(0).getTextContent();
NodeList nodes = element.getElementsByTagName("text");
if (nodes != null)
textRight = nodes.item(0).getTextContent();
}
else
{
@ -143,7 +145,7 @@ public class GuiManual extends GuiScreen
{
if (pageLeftType.equals("text"))
drawTextPage(textLeft, localWidth + 80, localHeight + 32);
else if (pageLeftType.equals("title"))
else if (pageLeftType.equals("intro"))
drawTitlePage(textLeft, localWidth + 80, localHeight + 32);
}
if (textRight != null)

View File

@ -31,6 +31,8 @@ public class SmelteryGui extends GuiContainer
fontRenderer.drawString("Temp: " + logic.getInternalTemperature(), xSize + 6, 6, 0xffffff);
for (int iter = 0; iter < 9; iter++)
fontRenderer.drawString("Slot "+iter+" temp: " + logic.getTempForSlot(iter), xSize + 6, 15+iter*9, 0xffffff);
for (int iter = 0; iter < 9; iter++)
fontRenderer.drawString("Slot "+iter+" mTemp: " + logic.meltingTemps[iter], xSize + 6, 100+iter*9, 0xffffff);
}
protected void drawGuiContainerBackgroundLayer (float f, int i, int j)

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidAluminumFX extends TextureLiquidStillFX
{
public LiquidAluminumFX()
{
super(140, 255, 70, 150, 70, 150, TContent.aluminumStill.blockIndexInTexture, TContent.aluminumStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidAluminumFlowFX extends TextureLiquidFlowingFX
{
public LiquidAluminumFlowFX()
{
super(140, 255, 70, 150, 70, 150, TContent.aluminumFlowing.blockIndexInTexture+1, TContent.aluminumFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidAlumiteFX extends TextureLiquidStillFX
{
public LiquidAlumiteFX()
{
super(0, 255, 0, 255, 0, 255, TContent.alumiteStill.blockIndexInTexture, TContent.alumiteStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidAlumiteFlowFX extends TextureLiquidFlowingFX
{
public LiquidAlumiteFlowFX()
{
super(0, 255, 0, 255, 0, 255, TContent.alumiteFlowing.blockIndexInTexture+1, TContent.alumiteFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidArditeFX extends TextureLiquidStillFX
{
public LiquidArditeFX()
{
super(0, 180, 0, 140, 0, 50, TContent.arditeStill.blockIndexInTexture, TContent.arditeStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidArditeFlowFX extends TextureLiquidFlowingFX
{
public LiquidArditeFlowFX()
{
super(0, 180, 0, 140, 0, 50, TContent.arditeFlowing.blockIndexInTexture+1, TContent.arditeFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidBrassFX extends TextureLiquidStillFX
{
public LiquidBrassFX()
{
super(200, 255, 200, 255, 40, 80, TContent.brassStill.blockIndexInTexture, TContent.brassStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidBrassFlowFX extends TextureLiquidFlowingFX
{
public LiquidBrassFlowFX()
{
super(200, 255, 200, 255, 40, 80, TContent.brassFlowing.blockIndexInTexture+1, TContent.brassFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidBronzeFX extends TextureLiquidStillFX
{
public LiquidBronzeFX()
{
super(140, 220, 70, 220, 10, 40, TContent.bronzeStill.blockIndexInTexture, TContent.arditeStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidBronzeFlowFX extends TextureLiquidFlowingFX
{
public LiquidBronzeFlowFX()
{
super(140, 220, 70, 220, 10, 40, TContent.bronzeFlowing.blockIndexInTexture+1, TContent.arditeFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidCobaltFX extends TextureLiquidStillFX
{
public LiquidCobaltFX()
{
super(0, 30, 30, 100, 100, 250, TContent.cobaltStill.blockIndexInTexture, TContent.cobaltStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidCobaltFlowFX extends TextureLiquidFlowingFX
{
public LiquidCobaltFlowFX()
{
super(0, 30, 30, 100, 100, 250, TContent.cobaltFlowing.blockIndexInTexture+1, TContent.cobaltFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidCopperFX extends TextureLiquidStillFX
{
public LiquidCopperFX()
{
super(180, 255, 100, 255, 10, 40, TContent.copperStill.blockIndexInTexture, TContent.copperStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidCopperFlowFX extends TextureLiquidFlowingFX
{
public LiquidCopperFlowFX()
{
super(180, 255, 100, 255, 10, 40, TContent.copperFlowing.blockIndexInTexture+1, TContent.copperFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidGoldFX extends TextureLiquidStillFX
{
public LiquidGoldFX()
{
super(180, 255, 180, 255, 10, 40, TContent.goldStill.blockIndexInTexture, TContent.goldStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidGoldFlowFX extends TextureLiquidFlowingFX
{
public LiquidGoldFlowFX()
{
super(180, 255, 180, 255, 10, 40, TContent.goldFlowing.blockIndexInTexture+1, TContent.goldFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidIronFX extends TextureLiquidStillFX
{
public LiquidIronFX()
{
super(10, 250, 10, 100, 10, 50, TContent.ironStill.blockIndexInTexture, TContent.ironStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidIronFlowFX extends TextureLiquidFlowingFX
{
public LiquidIronFlowFX()
{
super(10, 250, 10, 100, 10, 50, TContent.ironFlowing.blockIndexInTexture+1, TContent.ironFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidManyullynFX extends TextureLiquidStillFX
{
public LiquidManyullynFX()
{
super(150, 250, 50, 120, 150, 250, TContent.manyullynStill.blockIndexInTexture, TContent.manyullynStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidManyullynFlowFX extends TextureLiquidFlowingFX
{
public LiquidManyullynFlowFX()
{
super(150, 250, 50, 120, 150, 250, TContent.manyullynFlowing.blockIndexInTexture+1, TContent.manyullynFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidObsidianFX extends TextureLiquidStillFX
{
public LiquidObsidianFX()
{
super(50, 200, 0, 40, 50, 200, TContent.obsidianStill.blockIndexInTexture, TContent.obsidianStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidObsidianFlowFX extends TextureLiquidFlowingFX
{
public LiquidObsidianFlowFX()
{
super(50, 200, 0, 40, 50, 200, TContent.obsidianFlowing.blockIndexInTexture+1, TContent.obsidianFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidTinFX extends TextureLiquidStillFX
{
public LiquidTinFX()
{
super(150, 250, 150, 250, 150, 250, TContent.tinStill.blockIndexInTexture, TContent.tinStill.getTextureFile());
}
}

View File

@ -0,0 +1,11 @@
package tinker.tconstruct.client.liquidrender;
import tinker.tconstruct.TContent;
public class LiquidTinFlowFX extends TextureLiquidFlowingFX
{
public LiquidTinFlowFX()
{
super(150, 250, 150, 250, 150, 250, TContent.tinFlowing.blockIndexInTexture+1, TContent.tinFlowing.getTextureFile());
}
}

View File

@ -0,0 +1,41 @@
package tinker.tconstruct.client.liquidrender;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class RenderLiquidMetal implements ISimpleBlockRenderingHandler
{
public static int liquidModel = RenderingRegistry.getNextAvailableRenderId();
@Override
public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer)
{
//You shouldn't have this
}
@Override
public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
renderer.renderBlockFluids(block, x, y, z);
return true;
}
@Override
public boolean shouldRender3DInInventory ()
{
return false;
}
@Override
public int getRenderId ()
{
return liquidModel;
}
}

View File

@ -0,0 +1,132 @@
package tinker.tconstruct.client.liquidrender;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderEngine;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLTextureFX;
public class TextureLiquidFlowingFX extends FMLTextureFX
{
private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax;
private final String texture;
public TextureLiquidFlowingFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex, String texture)
{
super(spriteIndex);
this.redMin = redMin;
this.redMax = redMax;
this.greenMin = greenMin;
this.greenMax = greenMax;
this.blueMin = blueMin;
this.blueMax = blueMax;
this.texture = texture;
tileSize = 2;
}
@Override
protected void setup ()
{
super.setup();
red = new float[tileSizeSquare];
blue = new float[tileSizeSquare];
green = new float[tileSizeSquare];
alpha = new float[tileSizeSquare];
animFrame = 0;
}
@Override
public void bindImage (RenderEngine renderengine)
{
GL11.glBindTexture(3553, renderengine.getTexture(texture));
}
@Override
public void onTick ()
{
animFrame++;
for (int i = 0; i < tileSizeBase; i++)
{
for (int k = 0; k < tileSizeBase; k++)
{
float f = 0.0F;
for (int j1 = k - 2; j1 <= k; j1++)
{
int k1 = i & tileSizeMask;
int i2 = j1 & tileSizeMask;
f += red[k1 + i2 * tileSizeBase];
}
blue[i + k * tileSizeBase] = f / 3.2F + green[i + k * tileSizeBase] * 0.8F;
}
}
for (int j = 0; j < tileSizeBase; j++)
{
for (int l = 0; l < tileSizeBase; l++)
{
green[j + l * tileSizeBase] += alpha[j + l * tileSizeBase] * 0.05F;
if (green[j + l * tileSizeBase] < 0.0F)
{
green[j + l * tileSizeBase] = 0.0F;
}
alpha[j + l * tileSizeBase] -= 0.3F;
if (Math.random() < 0.20000000000000001D)
{
alpha[j + l * tileSizeBase] = 0.5F;
}
}
}
float af[] = blue;
blue = red;
red = af;
for (int i1 = 0; i1 < tileSizeSquare; i1++)
{
float f1 = red[i1 - animFrame * tileSizeBase & tileSizeSquareMask];
if (f1 > 1.0F)
{
f1 = 1.0F;
}
if (f1 < 0.0F)
{
f1 = 0.0F;
}
float f2 = f1 * f1;
/*int r = (int) (10F + f2 * 22F);
int g = (int) (50F + f2 * 64F);
int b = 255;*/
int r = (int) (redMin + f2 * (redMax - redMin));
int g = (int) (greenMin + f2 * (greenMax - greenMin));
int b = (int) (blueMin + f2 * (blueMax - blueMin));
if (anaglyphEnabled)
{
int redTemp = (r * 30 + g * 59 + b * 11) / 100;
int greenTemp = (r * 30 + g * 70) / 100;
int blueTemp = (r * 30 + b * 70) / 100;
r = redTemp;
g = greenTemp;
b = blueTemp;
}
imageData[i1 * 4 + 0] = (byte) r;
imageData[i1 * 4 + 1] = (byte) g;
imageData[i1 * 4 + 2] = (byte) b;
imageData[i1 * 4 + 3] = /*(byte)l2*/(byte) 255;
//imageData[i1 * 4 + 0] = (byte) l1;
//imageData[i1 * 4 + 1] = (byte) l1;
//imageData[i1 * 4 + 2] = (byte) l1;
//imageData[i1 * 4 + 3] = /* (byte)l2 */(byte) 255;
}
}
protected float red[];
protected float blue[];
protected float green[];
protected float alpha[];
private int animFrame;
}

View File

@ -0,0 +1,134 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package tinker.tconstruct.client.liquidrender;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraftforge.client.ForgeHooksClient;
import cpw.mods.fml.client.FMLTextureFX;
public class TextureLiquidStillFX extends FMLTextureFX
{
private final int redMin, redMax, greenMin, greenMax, blueMin, blueMax;
private final String texture;
public TextureLiquidStillFX(int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax, int spriteIndex, String texture)
{
super(spriteIndex);
this.redMin = redMin;
this.redMax = redMax;
this.greenMin = greenMin;
this.greenMax = greenMax;
this.blueMin = blueMin;
this.blueMax = blueMax;
this.texture = texture;
setup();
}
@Override
public void setup ()
{
super.setup();
red = new float[tileSizeSquare];
green = new float[tileSizeSquare];
blue = new float[tileSizeSquare];
alpha = new float[tileSizeSquare];
}
@Override
public void bindImage (RenderEngine renderengine)
{
ForgeHooksClient.bindTexture(texture, 0);
}
@Override
public void onTick ()
{
for (int i = 0; i < tileSizeBase; ++i)
{
for (int j = 0; j < tileSizeBase; ++j)
{
float var3 = 0.0F;
for (int k = i - 1; k <= i + 1; ++k)
{
int r = k & tileSizeMask;
int g = j & tileSizeMask;
var3 += this.red[r + g * tileSizeBase];
}
this.green[i + j * tileSizeBase] = var3 / 3.3F + this.blue[i + j * tileSizeBase] * 0.8F;
}
}
for (int i = 0; i < tileSizeBase; ++i)
{
for (int j = 0; j < tileSizeBase; ++j)
{
this.blue[i + j * tileSizeBase] += this.alpha[i + j * tileSizeBase] * 0.05F;
if (this.blue[i + j * tileSizeBase] < 0.0F)
{
this.blue[i + j * tileSizeBase] = 0.0F;
}
this.alpha[i + j * tileSizeBase] -= 0.1F;
if (Math.random() < 0.05D)
{
this.alpha[i + j * tileSizeBase] = 0.5F;
}
}
}
float af[] = green;
green = red;
red = af;
for (int i1 = 0; i1 < tileSizeSquare; i1++)
{
float f1 = red[i1];
if (f1 > 1.0F)
{
f1 = 1.0F;
}
if (f1 < 0.0F)
{
f1 = 0.0F;
}
float f2 = f1 * f1;
int r = (int) (redMin + f2 * (redMax - redMin));
int g = (int) (greenMin + f2 * (greenMax - greenMin));
int b = (int) (blueMin + f2 * (blueMax - blueMin));
if (anaglyphEnabled)
{
int i3 = (r * 30 + g * 59 + b * 11) / 100;
int j3 = (r * 30 + g * 70) / 100;
int k3 = (r * 30 + b * 70) / 100;
r = i3;
g = j3;
b = k3;
}
imageData[i1 * 4 + 0] = (byte) r;
imageData[i1 * 4 + 1] = (byte) g;
imageData[i1 * 4 + 2] = (byte) b;
imageData[i1 * 4 + 3] = (byte) 255;
}
}
protected float red[];
protected float green[];
protected float blue[];
protected float alpha[];
}

View File

@ -31,9 +31,14 @@ public class Smeltery
public static Integer getSmeltingTemperature(ItemStack item)
{
if (item == null)
return null;
return 0;
return instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage()));
Integer temp = instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (temp == null)
return 0;
else
return temp;
//return instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage()));
}
public static Integer getSmeltingTemperature(int blockID)
@ -61,7 +66,10 @@ public class Smeltery
if (item == null)
return null;
return (ItemStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())).copy();
ItemStack stack = (ItemStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (stack == null)
return null;
return stack.copy();
}
public static ItemStack getSmeltingResult(int blockID)
@ -76,6 +84,9 @@ public class Smeltery
*/
public static ItemStack getSmeltingResult(int blockID, int metadata)
{
return (ItemStack) instance.smeltingList.get(Arrays.asList(blockID, metadata)).copy();
ItemStack stack = (ItemStack) instance.smeltingList.get(Arrays.asList(blockID, metadata));
if (stack == null)
return null;
return stack.copy();
}
}

View File

@ -0,0 +1,264 @@
package tinker.tconstruct.entity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAICreeperSwell;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class Skyla extends EntityMob
{
/**
* Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go
* weird)
*/
private int lastActiveTime;
/**
* The amount of time since the creeper was close enough to the player to ignite
*/
private int timeSinceIgnited;
private int fuseTime = 30;
/** Explosion radius for this creeper. */
private int explosionRadius = 10;
public Skyla(World par1World)
{
super(par1World);
System.out.println("Hello!");
this.texture = "/tinkertextures/mob/skyla.png";
this.tasks.addTask(1, new EntityAISwimming(this));
//this.tasks.addTask(2, new EntityAICreeperSwell(this));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 0.25F, 0.3F));
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 0.25F, false));
this.tasks.addTask(5, new EntityAIWander(this, 0.2F));
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
}
/**
* Returns true if the newer Entity AI code should be run
*/
public boolean isAIEnabled()
{
return true;
}
public int func_82143_as()
{
return this.getAttackTarget() == null ? 3 : 3 + (this.health - 1);
}
/**
* Called when the mob is falling. Calculates and applies fall damage.
*/
protected void fall(float par1)
{
super.fall(par1);
this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + par1 * 1.5F);
if (this.timeSinceIgnited > this.fuseTime - 5)
{
this.timeSinceIgnited = this.fuseTime - 5;
}
}
public int getMaxHealth()
{
return 20;
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1));
this.dataWatcher.addObject(17, Byte.valueOf((byte)0));
}
/**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
if (this.dataWatcher.getWatchableObjectByte(17) == 1)
{
par1NBTTagCompound.setBoolean("powered", true);
}
par1NBTTagCompound.setShort("Fuse", (short)this.fuseTime);
par1NBTTagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readEntityFromNBT(par1NBTTagCompound);
this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1NBTTagCompound.getBoolean("powered") ? 1 : 0)));
if (par1NBTTagCompound.hasKey("Fuse"))
{
this.fuseTime = par1NBTTagCompound.getShort("Fuse");
}
if (par1NBTTagCompound.hasKey("ExplosionRadius"))
{
this.explosionRadius = par1NBTTagCompound.getByte("ExplosionRadius");
}
}
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
if (this.isEntityAlive())
{
this.lastActiveTime = this.timeSinceIgnited;
int var1 = this.getCreeperState();
if (var1 > 0 && this.timeSinceIgnited == 0)
{
this.playSound("random.fuse", 1.0F, 0.5F);
}
this.timeSinceIgnited += var1;
if (this.timeSinceIgnited < 0)
{
this.timeSinceIgnited = 0;
}
if (this.timeSinceIgnited >= this.fuseTime)
{
this.timeSinceIgnited = this.fuseTime;
if (!this.worldObj.isRemote)
{
boolean var2 = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
if (this.getPowered())
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), var2);
}
else
{
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, var2);
}
this.setDead();
}
}
}
super.onUpdate();
}
/**
* Returns the sound this mob makes when it is hurt.
*/
protected String getHurtSound()
{
return "mob.creeper.say";
}
/**
* Returns the sound this mob makes on death.
*/
protected String getDeathSound()
{
return "mob.creeper.death";
}
/**
* Called when the mob's health reaches 0.
*/
public void onDeath(DamageSource par1DamageSource)
{
super.onDeath(par1DamageSource);
if (par1DamageSource.getEntity() instanceof EntitySkeleton)
{
int var2 = Item.record13.itemID + this.rand.nextInt(Item.recordWait.itemID - Item.record13.itemID + 1);
this.dropItem(var2, 1);
}
}
public boolean attackEntityAsMob(Entity par1Entity)
{
return true;
}
/**
* Returns true if the creeper is powered by a lightning bolt.
*/
public boolean getPowered()
{
return this.dataWatcher.getWatchableObjectByte(17) == 1;
}
@SideOnly(Side.CLIENT)
/**
* Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited.
*/
public float getCreeperFlashIntensity(float par1)
{
return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2);
}
/**
* Returns the item ID for the item the mob drops on death.
*/
protected int getDropItemId()
{
return Item.gunpowder.itemID;
}
/**
* Returns the current state of creeper, -1 is idle, 1 is 'in fuse'
*/
public int getCreeperState()
{
return this.dataWatcher.getWatchableObjectByte(16);
}
/**
* Sets the state of creeper, -1 to idle and 1 to be 'in fuse'
*/
public void setCreeperState(int par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte)par1));
}
/**
* Called when a lightning bolt hits the entity.
*/
public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)
{
super.onStruckByLightning(par1EntityLightningBolt);
this.dataWatcher.updateObject(17, Byte.valueOf((byte)1));
}
}

View File

@ -97,10 +97,12 @@ public class Pattern extends CraftingItem
public ItemStack getPatternOutput (ItemStack stack, MaterialSet set)
{
int type = stack.getItemDamage();
if (type != 0 && type < TContent.patternOutputs.length - 1)
if (type != 0 && type < TContent.patternOutputs.length + 1)
{
System.out.println("Returning type");
return new ItemStack(TContent.patternOutputs[type - 1], 1, set.materialID);
}
System.out.println("Returning null");
return null;
}
}

View File

@ -22,7 +22,7 @@ public class LavaTankLogic extends TileEntity
public LavaTankLogic()
{
tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME);
max = LiquidContainerRegistry.BUCKET_VOLUME;
max = LiquidContainerRegistry.BUCKET_VOLUME*4;
}
@Override

View File

@ -3,7 +3,7 @@ package tinker.tconstruct.logic;
import net.minecraft.block.Block;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
@ -23,8 +23,7 @@ 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
{
boolean validStructure;
byte direction;
@ -34,14 +33,19 @@ public class SmelteryLogic extends InventoryLogic
public int fuelGague;
int[] tankCoords;
int[] bottomTemps;
public int[] meltingTemps;
int tick;
public SmelteryLogic()
{
super(9);
bottomTemps = new int[9];
meltingTemps = new int[9];
for (int i = 0; i < 9; i++)
{
bottomTemps[i] = 20;
meltingTemps[i] = 0;
}
}
/* Misc */
@ -58,31 +62,31 @@ public class SmelteryLogic extends InventoryLogic
}
@Override
public byte getDirection()
public byte getDirection ()
{
return direction;
}
@Override
public void setDirection(byte dir)
public void setDirection (byte dir)
{
direction = dir;
}
@Override
public boolean getActive()
public boolean getActive ()
{
return validStructure;
}
@Override
public void setActive(boolean flag)
public void setActive (boolean flag)
{
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
public boolean canFaceVertical()
public boolean canFaceVertical ()
{
return false;
}
@ -105,6 +109,7 @@ public class SmelteryLogic extends InventoryLogic
/* Updating */
public void updateEntity ()
{
//System.out.println("tick");
tick++;
if (tick % 4 == 0)
updateTemperatures();
@ -125,10 +130,10 @@ public class SmelteryLogic extends InventoryLogic
TileEntity tank = worldObj.getBlockTileEntity(tankCoords[0], tankCoords[1], tankCoords[2]);
if (tank instanceof ILiquidTank)
{
LiquidStack liquid = ((ILiquidTank)tank).drain(10, true);
LiquidStack liquid = ((ILiquidTank) tank).drain(10, true);
if (liquid != null)
{
System.out.println("Drained "+liquid.amount);
//System.out.println("Drained " + liquid.amount);
useTime += liquid.amount;
}
}
@ -136,18 +141,32 @@ public class SmelteryLogic extends InventoryLogic
}
}
void updateTemperatures()
void updateTemperatures ()
{
for (int i = 0; i < 9; i++)
{
if (this.isStackInSlot(i) && bottomTemps[i] < internalTemp)
bottomTemps[i] += 1;
if (meltingTemps[i] > 20 && this.isStackInSlot(i))
{
if (bottomTemps[i] < internalTemp && bottomTemps[i] < meltingTemps[i])
bottomTemps[i] += 1;
else if (meltingTemps[i] >= bottomTemps[i])
{
ItemStack result = getResultFor(inventory[i]);
if (result != null)
{
inventory[i] = result;
setWorldToInventory();
}
}
}
else
bottomTemps[i] = 20;
}
}
void updateFuelGague()
void updateFuelGague ()
{
if (tankCoords == null || tankCoords.length < 3)
return;
@ -159,8 +178,8 @@ public class SmelteryLogic extends InventoryLogic
}
if (tank instanceof ILiquidTank)
{
LiquidStack liquid = ((ILiquidTank)tank).getLiquid();
int capacity = ((ILiquidTank)tank).getCapacity();
LiquidStack liquid = ((ILiquidTank) tank).getLiquid();
int capacity = ((ILiquidTank) tank).getCapacity();
if (liquid != null)
fuelGague = liquid.amount * 52 / capacity;
else
@ -170,11 +189,7 @@ public class SmelteryLogic extends InventoryLogic
public ItemStack getResultFor (ItemStack stack)
{
ItemStack result = Smeltery.instance.getSmeltingResult(stack);
if (result != null)
return result;
return null;
return Smeltery.instance.getSmeltingResult(stack);
}
/* Inventory */
@ -184,126 +199,133 @@ public class SmelteryLogic extends InventoryLogic
}
@Override
public void setInventorySlotContents(int slot, ItemStack itemstack)
{
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
super.setInventorySlotContents(slot, itemstack);
setWorldToInventory();
}
}
@Override
public ItemStack decrStackSize(int slot, int quantity)
{
public ItemStack decrStackSize (int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
setWorldToInventory();
return stack;
}
}
/* World-inventory matching */
void matchInventoryToWorld()
void matchInventoryToWorld ()
{
switch(getDirection())
switch (getDirection())
{
case 2: // +z
grabWorldBlocks(xCoord, yCoord, zCoord+2);
grabWorldBlocks(xCoord, yCoord, zCoord + 2);
break;
case 3: // -z
grabWorldBlocks(xCoord, yCoord, zCoord-2);
grabWorldBlocks(xCoord, yCoord, zCoord - 2);
break;
case 4: // +x
grabWorldBlocks(xCoord+2, yCoord, zCoord);
grabWorldBlocks(xCoord + 2, yCoord, zCoord);
break;
case 5: // -x
grabWorldBlocks(xCoord-2, yCoord, zCoord);
grabWorldBlocks(xCoord - 2, yCoord, zCoord);
break;
}
}
void setWorldToInventory()
void setWorldToInventory ()
{
switch(getDirection())
switch (getDirection())
{
case 2: // +z
setWorldToInventory(xCoord, yCoord, zCoord+2);
setWorldToInventory(xCoord, yCoord, zCoord + 2);
break;
case 3: // -z
setWorldToInventory(xCoord, yCoord, zCoord-2);
setWorldToInventory(xCoord, yCoord, zCoord - 2);
break;
case 4: // +x
setWorldToInventory(xCoord+2, yCoord, zCoord);
setWorldToInventory(xCoord + 2, yCoord, zCoord);
break;
case 5: // -x
setWorldToInventory(xCoord-2, yCoord, zCoord);
setWorldToInventory(xCoord - 2, yCoord, zCoord);
break;
}
}
public void grabWorldBlocks(int x, int y, int z)
public void grabWorldBlocks (int x, int y, int z)
{
for (int xPos = 0; xPos <= 2; xPos++)
{
for (int zPos = 0; zPos <= 2; zPos++)
{
int bID = worldObj.getBlockId(xPos+x-1, y, zPos+z-1);
int bID = worldObj.getBlockId(xPos + x - 1, y, zPos + z - 1);
int md = worldObj.getBlockMetadata(xPos + x - 1, y, zPos + z - 1);
ItemStack stack = inventory[xPos+zPos*3];
if (bID == 0)
inventory[xPos+zPos*3] = null;
else if (stack == null || stack.itemID != bID)
inventory[xPos+zPos*3] = new ItemStack(bID, 1, worldObj.getBlockMetadata(xPos+x-1, y, zPos+z-1));
}
}
}
public void setWorldToInventory(int x, int y, int z)
{
for (int xPos = 0; xPos <= 2; xPos++)
{
for (int zPos = 0; zPos <= 2; zPos++)
{
ItemStack stack = inventory[xPos+zPos*3];
ItemStack stack = inventory[xPos + zPos * 3];
if (stack == null)
worldObj.setBlockWithNotify(xPos+x-1, y, zPos+z-1, 0);
else if (stack.itemID < Block.blocksList.length && Block.blocksList[stack.itemID] != null)
worldObj.setBlockAndMetadataWithNotify(xPos+x-1, y, zPos+z-1, stack.itemID, stack.getItemDamage());
{
if (bID == 0)
inventory[xPos + zPos * 3] = null;
else if (stack == null || (stack.itemID != bID && stack.getItemDamage() != md))
inventory[xPos + zPos * 3] = new ItemStack(bID, 1, md);
}
}
}
}
public void checkValidPlacement()
public void setWorldToInventory (int x, int y, int z)
{
switch(getDirection())
for (int xPos = 0; xPos <= 2; xPos++)
{
for (int zPos = 0; zPos <= 2; zPos++)
{
ItemStack stack = inventory[xPos + zPos * 3];
if (stack == null)
worldObj.setBlockWithNotify(xPos + x - 1, y, zPos + z - 1, 0);
else if (stack.getItem() instanceof ItemBlock && Block.blocksList[stack.itemID] != null)
{
worldObj.setBlockAndMetadataWithNotify(xPos + x - 1, y, zPos + z - 1, stack.itemID, stack.getItemDamage());
meltingTemps[xPos + zPos * 3] = Smeltery.instance.getSmeltingTemperature(stack);
}
}
}
}
public void checkValidPlacement ()
{
switch (getDirection())
{
case 2: // +z
checkValidStructure(xCoord, yCoord, zCoord+2);
checkValidStructure(xCoord, yCoord, zCoord + 2);
break;
case 3: // -z
checkValidStructure(xCoord, yCoord, zCoord-2);
checkValidStructure(xCoord, yCoord, zCoord - 2);
break;
case 4: // +x
checkValidStructure(xCoord+2, yCoord, zCoord);
checkValidStructure(xCoord + 2, yCoord, zCoord);
break;
case 5: // -x
checkValidStructure(xCoord-2, yCoord, zCoord);
checkValidStructure(xCoord - 2, yCoord, zCoord);
break;
}
}
public void checkValidStructure(int x, int y, int z)
public void checkValidStructure (int x, int y, int z)
{
int numBricks = 0;
boolean lavaTank = false;
//Check outer layer
for (int xPos = x-1; xPos <= x+1; xPos++)
for (int xPos = x - 1; xPos <= x + 1; xPos++)
{
int southID = worldObj.getBlockId(xPos, y, z-2);
int northID = worldObj.getBlockId(xPos, y, z+2);
int southID = worldObj.getBlockId(xPos, y, z - 2);
int northID = worldObj.getBlockId(xPos, y, z + 2);
if (southID == TContent.searedBrick.blockID)
numBricks++;
else if (southID == TContent.lavaTank.blockID)
{
tankCoords = new int[] {xPos, y, z-2};
tankCoords = new int[] { xPos, y, z - 2 };
lavaTank = true;
}
@ -311,19 +333,19 @@ public class SmelteryLogic extends InventoryLogic
numBricks++;
else if (northID == TContent.lavaTank.blockID)
{
tankCoords = new int[] {xPos, y, z+2};
tankCoords = new int[] { xPos, y, z + 2 };
lavaTank = true;
}
}
for (int zPos = z-1; zPos <= z+1; zPos++)
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
int westID = worldObj.getBlockId(x-2, y, zPos);
int eastID = worldObj.getBlockId(x+2, y, zPos);
int westID = worldObj.getBlockId(x - 2, y, zPos);
int eastID = worldObj.getBlockId(x + 2, y, zPos);
if (westID == TContent.searedBrick.blockID)
numBricks++;
else if (westID == TContent.lavaTank.blockID)
{
tankCoords = new int[] {x-2, y, zPos};
tankCoords = new int[] { x - 2, y, zPos };
lavaTank = true;
}
@ -331,17 +353,17 @@ public class SmelteryLogic extends InventoryLogic
numBricks++;
else if (eastID == TContent.lavaTank.blockID)
{
tankCoords = new int[] {x+2, y, zPos};
tankCoords = new int[] { x + 2, y, zPos };
lavaTank = true;
}
}
//Check floor
for (int xPos = x-1; xPos <= x+1; xPos++)
for (int xPos = x - 1; xPos <= x + 1; xPos++)
{
for (int zPos = z-1; zPos <= z+1; zPos++)
for (int zPos = z - 1; zPos <= z + 1; zPos++)
{
if (worldObj.getBlockId(xPos, y-1, zPos) == TContent.searedBrick.blockID)
if (worldObj.getBlockId(xPos, y - 1, zPos) == TContent.searedBrick.blockID)
numBricks++;
}
}
@ -360,26 +382,26 @@ public class SmelteryLogic extends InventoryLogic
/* NBT */
@Override
public void readFromNBT(NBTTagCompound tags)
{
super.readFromNBT(tags);
validStructure = tags.getBoolean("ValidStructure");
direction = tags.getByte("Direction");
useTime = tags.getInteger("UseTime");
internalTemp = tags.getInteger("Temp");
tankCoords = tags.getIntArray("TankCoords");
}
public void readFromNBT (NBTTagCompound tags)
{
super.readFromNBT(tags);
validStructure = tags.getBoolean("ValidStructure");
direction = tags.getByte("Direction");
useTime = tags.getInteger("UseTime");
internalTemp = tags.getInteger("Temp");
tankCoords = tags.getIntArray("TankCoords");
}
@Override
public void writeToNBT(NBTTagCompound tags)
{
super.writeToNBT(tags);
tags.setBoolean("ValidStructure", validStructure);
tags.setByte("Direction", direction);
tags.setInteger("UseTime", useTime);
tags.setInteger("Temp", internalTemp);
tags.setIntArray("TankCoords", tankCoords);
}
public void writeToNBT (NBTTagCompound tags)
{
super.writeToNBT(tags);
tags.setBoolean("ValidStructure", validStructure);
tags.setByte("Direction", direction);
tags.setInteger("UseTime", useTime);
tags.setInteger("Temp", internalTemp);
tags.setIntArray("TankCoords", tankCoords);
}
/* Packets */
@Override