Liquid Smeltery

This commit is contained in:
mDiyo 2013-02-14 10:57:49 -08:00
parent e9bd7f04b9
commit 2e55905911
22 changed files with 684 additions and 487 deletions

View File

@ -145,10 +145,7 @@ Tinker's Log #26:
I have all these tools laying around with little notes on what each one does. Instead of leaving them scattered about, I think I will create one place to store them.</text>
</page>
<text>Tinker's Log #27:
I went exploring and found some new ores today. They're colors I've never seen before, and they don't shatter on impact like iron does. I wonder what I can do with these?</text>
</page>
<page>
<text>Tinker's Log #27:
I went exploring and found some new ores today. They're colors I've never seen before, and they don't shatter on impact like iron does. I wonder what I can do with these?
@ -156,6 +153,7 @@ I went exploring and found some new ores today. They're colors I've never seen b
Tinker's Log #28:
The normal furnace is nice for keeping warm, but it leaves something to be desired for processing metal. I've dug a pit and lined it with some clay, gathered lava nearby, and put ore in the center in an attempt to improve on the design. The results were quite interesting.</text>
</page>
<page>
<text>The more lava I fed into the pit the hotter the material became. Eventually the whole thing liquified. I broke open the side of the pit with a cauldron in an attempt to catch the material, but it went everywhere. There were some remnants left in the pit as well.
Raw ore still has parts of stone in it. There must be a way to remove the excess.</text>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -2,7 +2,6 @@ package tinker.common;
public interface IFacingLogic
{
public boolean canFaceVertical();
public byte getDirection();
public void setDirection(byte direction);
public void setDirection(float yaw, float pitch);
}

View File

@ -103,34 +103,11 @@ public abstract class InventoryBlock extends BlockContainer
IFacingLogic direction = (IFacingLogic) logic;
if (entityliving == null)
{
direction.setDirection((byte)1);
direction.setDirection(0F, 0F);
}
else
{
int facing = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
switch (facing)
{
case 0:
direction.setDirection((byte)2);
break;
case 1:
direction.setDirection((byte)5);
break;
case 2:
direction.setDirection((byte)3);
break;
case 3:
direction.setDirection((byte)4);
break;
}
if (direction.canFaceVertical())
{
//TODO: Vertical facing
}
direction.setDirection(entityliving.rotationYaw * 4F, entityliving.rotationPitch);
}
}
}

View File

@ -46,6 +46,7 @@ public class PHConstruct {
smeltery = config.getBlock("Smeltery", 1474).getInt(1474);
searedBrick = config.getBlock("Seared Brick", 1477).getInt(1477);
craftedSoil = config.getBlock("Special Soil", 1476).getInt(1476);
landmine = config.getBlock("Landmine", 1475).getInt(1475);
ironFlowing = config.getBlock("Liquid Iron Flowing", 1478).getInt(1478);
ironStill = config.getBlock("Liquid Iron Still", 1479).getInt(1479);
@ -156,6 +157,10 @@ public class PHConstruct {
public static int searedBrick;
public static int axle;
//Traps
public static int landmine;
//Liquids
public static int ironFlowing;
public static int ironStill;
public static int goldFlowing;

View File

@ -1,47 +1,26 @@
package tinker.tconstruct;
import net.minecraft.block.Block;
import net.minecraft.block.EnumMobType;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import tinker.common.IPattern;
import tinker.tconstruct.blocks.EquipBlock;
import tinker.tconstruct.blocks.SearedBrick;
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.Mattock;
import tinker.tconstruct.tools.Pickaxe;
import tinker.tconstruct.tools.Rapier;
import tinker.tconstruct.tools.Shovel;
import tinker.tconstruct.tools.ToolCore;
import tinker.common.*;
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,7 +76,11 @@ public class TContent implements IFuelHandler
public static Block lavaTank;
public static Block craftedSoil;
public static Block searedBrick;
//Traps
public static Block landmine;
//Liquids
public static Block ironFlowing;
public static Block ironStill;
public static Block goldFlowing;
@ -124,6 +107,7 @@ public class TContent implements IFuelHandler
public static Block obsidianFlowing;
public static Block obsidianStill;
//public static Block axle;
//Tool modifiers
@ -152,8 +136,9 @@ public class TContent implements IFuelHandler
void registerBlocks()
{
//Tool Station
woodCrafter = new ToolStationBlock(PHConstruct.woodCrafter, Material.wood);
GameRegistry.registerBlock(woodCrafter, tinker.tconstruct.blocks.ToolStationItemBlock.class, "ToolStationBlock");
GameRegistry.registerBlock(woodCrafter, tinker.tconstruct.items.ToolStationItemBlock.class, "ToolStationBlock");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.ToolStationLogic.class, "ToolStation");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.PartCrafterLogic.class, "PartCrafter");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.PatternChestLogic.class, "PatternHolder");
@ -162,24 +147,22 @@ public class TContent implements IFuelHandler
heldItemBlock = new EquipBlock(PHConstruct.heldItemBlock, Material.wood);
GameRegistry.registerBlock(heldItemBlock, "HeldItemBlock");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.FrypanLogic.class, "FrypanLogic");
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, 96, Material.sand, 3.0F, 2);
craftedSoil.stepSound = Block.soundGravelFootstep;
GameRegistry.registerBlock(craftedSoil, tinker.tconstruct.items.CraftedSoilItemBlock.class, "CraftedSoil");
//ores = new TBaseOre(PHTools.ores, 48);
//GameRegistry.registerBlock(ores, tinker.toolconstruct.blocks.TBaseOreItem.class, "TConstruct.ores");
/*lavaTank = new LavaTankBlock(PHConstruct.lavaTank);
//Smeltery
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");*/
craftedSoil = new TConstructBlock(PHConstruct.craftedSoil, 96, Material.sand, 3.0F, 2);
craftedSoil.stepSound = Block.soundGravelFootstep;
GameRegistry.registerBlock(craftedSoil, tinker.tconstruct.blocks.CraftedSoilItemBlock.class, "CraftedSoil");
GameRegistry.registerTileEntity(tinker.tconstruct.logic.SmelteryLogic.class, "TConstruct.Smeltery");
searedBrick = new SearedBrick(PHConstruct.searedBrick, 80, Material.iron, 10.0F, 6);
GameRegistry.registerBlock(searedBrick, tinker.tconstruct.blocks.SearedBrickItemBlock.class, "SearedBrick");
GameRegistry.registerBlock(searedBrick, tinker.tconstruct.items.SearedBrickItemBlock.class, "SearedBrick");
MinecraftForge.setBlockHarvestLevel(searedBrick, 0, "pickaxe", 2);
MinecraftForge.setBlockHarvestLevel(searedBrick, 1, "pickaxe", 4);
MinecraftForge.setBlockHarvestLevel(searedBrick, 2, "pickaxe", 4);
@ -187,7 +170,8 @@ public class TContent implements IFuelHandler
MinecraftForge.setBlockHarvestLevel(searedBrick, 4, "pickaxe", 1);
MinecraftForge.setBlockHarvestLevel(searedBrick, 5, "pickaxe", 1);
/*ironFlowing = new IronFlowing(PHConstruct.ironFlowing).setBlockName("liquid.ironFlow");
//Liquids
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");
@ -234,7 +218,11 @@ public class TContent implements IFuelHandler
obsidianFlowing = new ObsidianFlowing(PHConstruct.obsidianFlowing).setBlockName("liquid.obsidianFlow");
GameRegistry.registerBlock(obsidianFlowing, "Liquid obsidian Flowing");
obsidianStill = new ObsidianStill(PHConstruct.obsidianStill).setBlockName("liquid.obsidianStill");
GameRegistry.registerBlock(obsidianStill, "Liquid obsidian Still");*/
GameRegistry.registerBlock(obsidianStill, "Liquid obsidian Still");
//Traps
landmine = new Landmine(PHConstruct.landmine, 0, EnumMobType.mobs, Material.cactus).setBlockName("landmine");
GameRegistry.registerBlock(landmine, "landmine");
}
void createItems ()
@ -410,7 +398,7 @@ public class TContent implements IFuelHandler
void addSmelteryRecipes()
{
//Smeltery.instance.addSmelting(Block.oreIron.blockID, 0, 450, new ItemStack(ironStill, 1, 0));
Smeltery.instance.addLiquidMelting(Block.oreIron.blockID, 0, 450, new LiquidStack(ironStill.blockID, 250, 0));
}
void addCraftingRecipes ()

View File

@ -1,89 +0,0 @@
package tinker.tconstruct.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import tinker.tconstruct.client.AxleRender;
public class Axle extends Block
{
public Axle(int id, Material material)
{
super(id, material);
this.setHardness(0.3f);
this.setBlockBounds(0, 0, 0, 1, 0.25f, 1);
//this.setCreativeTab(ToolConstruct.materialTab);
}
/*public String getTextureFile()
{
return "/tinkertextures/ConstructBlocks.png";
}*/
public int getBlockTextureFromSideAndMetadata (int side, int meta)
{
//return 22 + meta*6 + side;
return 18;
}
@Override
public boolean renderAsNormalBlock ()
{
return false;
}
@Override
public boolean isOpaqueCube ()
{
return false;
}
@Override
public int getRenderType ()
{
return AxleRender.axleModelID;
}
@Override
public int idDropped (int par1, Random par2Random, int par3)
{
return 0;
}
/*public TileEntity createNewTileEntity (World world, int metadata)
{
return new FrypanLogic();
}*/
/*public void randomDisplayTick (World world, int x, int y, int z, Random random)
{
if (isActive(world, x, y, z))
{
float f = (float) x + 0.5F;
float f1 = (float) y + 0.25F + (random.nextFloat() * 6F) / 16F;
float f2 = (float) z + 0.5F;
float f4 = random.nextFloat() * 0.6F - 0.3F;
world.spawnParticle("smoke", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
}
}
public int getLightValue (IBlockAccess world, int x, int y, int z)
{
return !isActive(world, x, y, z) ? 0 : 9;
}
@Override
public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer)
{
return TConstructGuiHandler.frypanID;
}
@Override
public Object getModInstance ()
{
return TConstruct.instance;
}*/
}

View File

@ -0,0 +1,276 @@
package tinker.tconstruct.blocks;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import tinker.tconstruct.TConstruct;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFence;
import net.minecraft.block.EnumMobType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class Landmine extends Block
{
/** The mob type that can trigger this pressure plate. */
private EnumMobType triggerMobType;
public Landmine(int par1, int par2, EnumMobType par3EnumMobType, Material par4Material)
{
super(par1, par2, par4Material);
this.triggerMobType = EnumMobType.mobs;
this.setCreativeTab(TConstruct.blockTab);
this.setTickRandomly(true);
float var5 = 0.0625F;
this.setBlockBounds(var5, 0.0F, var5, 1.0F - var5, 0.03125F, 1.0F - var5);
}
/**
* How many world ticks before ticking
*/
public int tickRate()
{
return 20;
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
return null;
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
return true;
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4));
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
boolean var6 = false;
if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)))
{
var6 = true;
}
if (var6)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (!par1World.isRemote)
{
if (par1World.getBlockMetadata(par2, par3, par4) != 0)
{
this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4);
}
}
}
/**
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
*/
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
if (!par1World.isRemote)
{
if (par1World.getBlockMetadata(par2, par3, par4) != 1)
{
this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4);
}
}
}
/**
* Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa.
*/
private void setStateIfMobInteractsWithPlate(World world, int posX, int posY, int posZ)
{
boolean var5 = world.getBlockMetadata(posX, posY, posZ) == 1;
boolean var6 = false;
float var7 = 0.125F;
List var8 = null;
if (this.triggerMobType == EnumMobType.everything)
{
var8 = world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (this.triggerMobType == EnumMobType.mobs)
{
var8 = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (this.triggerMobType == EnumMobType.players)
{
var8 = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().addOrModifyAABBInPool((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7)));
}
if (!var8.isEmpty())
{
Iterator var9 = var8.iterator();
while (var9.hasNext())
{
Entity var10 = (Entity)var9.next();
if (!var10.doesEntityNotTriggerPressurePlate())
{
var6 = true;
break;
}
}
}
if (var6 && !var5)
{
world.setBlockWithNotify(posX, posY, posZ, 0);
world.createExplosion((Entity)null, posX, posY, posZ, 2.0F, true);
/*par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1);
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID);
par1World.markBlockRangeForRenderUpdate(posX, posY, posZ, posX, posY, posZ);
par1World.playSoundEffect((double)posX + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F, 0.6F);*/
}
/*if (!var6 && var5)
{
par1World.setBlockMetadataWithNotify(posX, posY, posZ, 0);
par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID);
par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID);
par1World.markBlockRangeForRenderUpdate(posX, posY, posZ, posX, posY, posZ);
par1World.playSoundEffect((double)posX + 0.5D, (double)posY + 0.1D, (double)posZ + 0.5D, "random.click", 0.3F, 0.5F);
}
if (var6)
{
par1World.scheduleBlockUpdate(posX, posY, posZ, this.blockID, this.tickRate());
}*/
}
/**
* ejects contained items into the world, and notifies neighbours of an update, as appropriate
*/
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
{
if (par6 > 0)
{
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
boolean var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 1;
float var6 = 0.0625F;
if (var5)
{
this.setBlockBounds(var6, 0.0F, var6, 1.0F - var6, 0.03125F, 1.0F - var6);
}
else
{
this.setBlockBounds(var6, 0.0F, var6, 1.0F - var6, 0.0625F, 1.0F - var6);
}
}
/**
* Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube
* returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X,
* Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
*/
public boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) > 0;
}
/**
* Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z,
* side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
*/
public boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
return par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 0 ? false : par5 == 1;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
/**
* Sets the block's bounds for rendering it as an item
*/
public void setBlockBoundsForItemRender()
{
float var1 = 0.5F;
float var2 = 0.125F;
float var3 = 0.5F;
this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3);
}
/**
* Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility
* and stop pistons
*/
public int getMobilityFlag()
{
return 1;
}
}

View File

@ -1,52 +0,0 @@
package tinker.tconstruct.blocks;
import java.util.List;
import java.util.Random;
import tinker.tconstruct.TConstruct;
import tinker.tconstruct.TContent;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class TBaseOre extends Block
{
public TBaseOre(int id, int tex)
{
super(id, tex, Material.rock);
enableStats = false;
setCreativeTab(TConstruct.blockTab);
}
public int damageDropped(int meta)
{
return meta;
}
/*@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return TConstructContent.ores.blockID;
}*/
public int getBlockTextureFromSideAndMetadata(int side, int meta)
{
return blockIndexInTexture + meta;
}
public String getTextureFile()
{
return TContent.blockTexture;
}
@Override
public void getSubBlocks(int id, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 2; iter++)
{
list.add(new ItemStack(id, 1, iter));
}
}
}

View File

@ -1,31 +0,0 @@
package tinker.tconstruct.blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class TBaseOreItem extends ItemBlock
{
public static final String blockType[] =
{
"cobalt", "ardite"
};
public TBaseOreItem(int i)
{
super(i);
setMaxDamage(0);
setHasSubtypes(true);
}
@Override
public int getMetadata(int md)
{
return md;
}
public String getItemNameIS(ItemStack itemstack)
{
int arrayPos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, 1);
return new StringBuilder().append("block.tconstruct").append(blockType[arrayPos]).toString();
}
}

View File

@ -5,6 +5,7 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
@ -34,6 +35,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
if (logic.validStructure)
{
int posX = logic.centerPos.x - 1, posY = logic.centerPos.y, posZ = logic.centerPos.z - 1;
//Melting
for (int i = 0; i < 9; i++)
{
if (logic.isStackInSlot(i))
@ -43,6 +45,14 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler
renderer.renderStandardBlock(invBlock, posX + i % 3, posY, posZ + i / 3);
}
}
//Liquids
for (LiquidStack liquid : logic.moltenMetal)
{
Block invBlock = Block.blocksList[liquid.itemID];
ForgeHooksClient.bindTexture(invBlock.getTextureFile(), 0);
renderer.renderStandardBlock(invBlock, posX, posY, posZ);
}
}
}
return false;

View File

@ -37,7 +37,7 @@ public class TProxyClient extends TProxyCommon
RenderingRegistry.registerBlockHandler(new RenderLiquidMetal());
//RenderingRegistry.registerBlockHandler(new AxleRender());
/*RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
RenderEngine renderEngine = FMLClientHandler.instance().getClient().renderEngine;
renderEngine.registerTextureFX(new LiquidIronFX());
renderEngine.registerTextureFX(new LiquidIronFlowFX());
renderEngine.registerTextureFX(new LiquidGoldFX());
@ -61,7 +61,7 @@ public class TProxyClient extends TProxyCommon
renderEngine.registerTextureFX(new LiquidAlumiteFX());
renderEngine.registerTextureFX(new LiquidAlumiteFlowFX());
renderEngine.registerTextureFX(new LiquidObsidianFX());
renderEngine.registerTextureFX(new LiquidObsidianFlowFX());*/
renderEngine.registerTextureFX(new LiquidObsidianFlowFX());
//Tools
MinecraftForgeClient.preloadTexture(TContent.blockTexture);
@ -80,7 +80,7 @@ public class TProxyClient extends TProxyCommon
/* Ties an internal name to a visible one. */
public void addNames()
{
//LanguageRegistry.addName(TContent.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");
@ -138,7 +138,7 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName);
}
//LanguageRegistry.addName(TContent.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");
@ -152,7 +152,7 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.addName(TContent.mattock, "Mattock");
//LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe");
/*LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
LanguageRegistry.addName(TContent.ironFlowing, "Liquid Iron");
LanguageRegistry.addName(TContent.ironStill, "Liquid Iron");
LanguageRegistry.addName(TContent.goldFlowing, "Liquid Gold");
LanguageRegistry.addName(TContent.goldStill, "Liquid Gold");
@ -176,7 +176,7 @@ public class TProxyClient extends TProxyCommon
LanguageRegistry.addName(TContent.manyullynFlowing, "Liquid Manyullyn");
LanguageRegistry.addName(TContent.manyullynStill, "Liquid Manyullyn");
LanguageRegistry.addName(TContent.obsidianFlowing, "Liquid Obsidian");
LanguageRegistry.addName(TContent.obsidianStill, "Liquid Obsidian");*/
LanguageRegistry.addName(TContent.obsidianStill, "Liquid Obsidian");
}

View File

@ -11,14 +11,19 @@ public class SkylaModel extends ModelBase
ModelRenderer Hair;
ModelRenderer Neck;
ModelRenderer Torso;
ModelRendererTurbo Skirt;
ModelRenderer Breast;
ModelRenderer RightArm;
ModelRenderer LeftArm;
ModelRenderer RightBand;
ModelRendererTurbo RightSleeve;
ModelRenderer RightHand;
ModelRenderer LeftArm;
ModelRenderer LeftBand;
ModelRendererTurbo LeftSleeve;
ModelRenderer LeftHand;
ModelRenderer RightLeg;
ModelRenderer LeftLeg;
ModelRenderer RightFoot;
ModelRenderer LeftLeg;
ModelRenderer LeftFoot;
ModelRenderer WingBaseRight;
ModelRenderer WingEdgeRight;
@ -43,141 +48,175 @@ public class SkylaModel extends ModelBase
//Head.addCylinder(0, 0, 0, 8, 16, 24, 0, ModelRendererTurbo.MR_BOTTOM);
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);
Neck.setRotationPoint(0F, -1F, 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);
Breast.setRotationPoint(0F, 1F, -1F);
setRotation(Breast, -0.2617994F, 0F, 0F);
Torso.addChild(Neck);
Torso.addChild(Breast);
Skirt = new ModelRendererTurbo(this, 22, 42, textureWidth, textureHeight);
Skirt.addTrapezoid(-3F, 0F, -2F, 6, 4, 4, 0, -0.5f, 4);
Skirt.setRotationPoint(0F, 5F, 0F);
setRotation(Skirt, 0F, 0F, 0F);
RightArm = new ModelRenderer(this, 14, 16);
RightArm.addBox(-1.5F, -1F, -1F, 2, 7, 2);
RightArm.setRotationPoint(-2F, -1F, 0.1F);
RightArm.addBox(-1F, -1F, -1F, 2, 7, 2);
RightArm.setRotationPoint(-2.5F, -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);
RightBand = new ModelRenderer(this, 10, 25);
RightBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3);
RightBand.setRotationPoint(0F, 0F, 0.1F);
setRotation(RightBand, 0F, 0F, 0F);
RightSleeve = new ModelRendererTurbo(this, 10, 30, textureWidth, textureHeight);
RightSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4);
RightSleeve.setRotationPoint(0F, 6F, 1.0F);
setRotation(RightSleeve, 0F, 0F, 0F);
RightHand = new ModelRenderer(this, 12, 39);
RightHand.addBox(-1F, 0F, -1F, 2, 2, 2);
RightHand.setRotationPoint(0F, 12F, 0F);
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(RightBand);
RightArm.addChild(RightSleeve);
RightArm.addChild(RightHand);
RightLeg = new ModelRenderer(this, 30, 16);
LeftArm = new ModelRenderer(this, 22, 16);
LeftArm.addBox(-1F, -1F, -1F, 2, 7, 2);
LeftArm.setRotationPoint(2.5F, -1F, 0.1F);
setRotation(LeftArm, 0F, 0F, 0F);
LeftBand = new ModelRenderer(this, 22, 25);
LeftBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3);
LeftBand.setRotationPoint(0F, 0F, 0.1F);
setRotation(LeftBand, 0F, 0F, 0F);
LeftSleeve = new ModelRendererTurbo(this, 22, 30, textureWidth, textureHeight);
LeftSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4);
//LeftSleeve.addBox(-1.5F, 0F, -2.5F, 3, 6, 3);
LeftSleeve.setRotationPoint(0F, 6F, 1.0F);
setRotation(LeftSleeve, 0F, 0F, 0F);
LeftHand = new ModelRenderer(this, 20, 39);
LeftHand.addBox(-1F, 0F, -1F, 2, 2, 2);
LeftHand.setRotationPoint(0F, 12F, 0F);
setRotation(LeftHand, 0F, 0F, 0F);
LeftArm.addChild(LeftBand);
LeftArm.addChild(LeftSleeve);
LeftArm.addChild(LeftHand);
RightLeg = new ModelRenderer(this, 34, 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);
RightFoot = new ModelRenderer(this, 34, 28);
RightFoot.addBox(-1F, 0F, 0F, 2, 8, 2);
RightFoot.setRotationPoint(0F, 8F, -1F);
setRotation(RightFoot, 0F, 0F, 0F);
LeftLeg = new ModelRenderer(this, 42, 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 = new ModelRenderer(this, 42, 28);
LeftFoot.addBox(-1F, 0F, 0F, 2, 8, 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 = new ModelRenderer(this, 0, 41);
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 = new ModelRenderer(this, 0, 53); //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 = new ModelRenderer(this, 6, 53);
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 = new ModelRenderer(this, 12, 53);
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 = new ModelRenderer(this, 18, 53);
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 = new ModelRenderer(this, 24, 53);
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 = new ModelRenderer(this, 42, 41);
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 = new ModelRenderer(this, 58, 53);
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 = new ModelRenderer(this, 52, 53);
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 = new ModelRenderer(this, 46, 53);
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 = new ModelRenderer(this, 40, 53);
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 = new ModelRenderer(this, 34, 53);
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);
@ -191,9 +230,10 @@ public class SkylaModel extends ModelBase
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
Head.render(f5);
Hair.render(f5);
Neck.render(f5);
//Neck.render(f5);
Torso.render(f5);
Breast.render(f5);
//Breast.render(f5);
Skirt.render(f5);
RightArm.render(f5);
LeftArm.render(f5);
RightLeg.render(f5);

View File

@ -1,9 +1,11 @@
package tinker.tconstruct.client.gui;
import net.minecraft.block.Block;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
@ -45,8 +47,19 @@ public class SmelteryGui extends GuiContainer
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
if (logic.fuelGague > 0)
{
ForgeHooksClient.bindTexture(Block.lavaStill.getTextureFile(), 0);
int index = Block.lavaStill.getBlockTextureFromSideAndMetadata(0, 0);
int texX = index % 16 * 16;
int texY = index / 16 * 16;
int fuel = logic.getScaledFuelGague(52);
drawTexturedModalRect(cornerX + 146, (cornerY + 67) - fuel, 176, 52 - fuel, 14, fuel + 2);
int count = 0;
while (fuel > 0)
{
int size = fuel >= 16 ? 16 : fuel;
fuel -= size;
drawTexturedModalRect(cornerX + 146, (cornerY + 67) - size - 16*count, texX, texY+16-size, 9, size);
count++;
}
}
// Draw description

View File

@ -343,32 +343,32 @@ public class ModelRendererTurbo extends ModelRenderer
*/
public void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir)
{
float f4 = x + (float)w;
float f5 = y + (float)h;
float f6 = z + (float)d;
float width = x + (float)w;
float height = y + (float)h;
float depth = z + (float)d;
x -= scale;
y -= scale;
z -= scale;
f4 += scale;
f5 += scale;
f6 += scale;
width += scale;
height += scale;
depth += scale;
int m = (mirror ? -1 : 1);
if(mirror)
{
float f7 = f4;
f4 = x;
float f7 = width;
width = x;
x = f7;
}
float[] v = {x, y, z};
float[] v1 = {f4, y, z};
float[] v2 = {f4, f5, z};
float[] v3 = {x, f5, z};
float[] v4 = {x, y, f6};
float[] v5 = {f4, y, f6};
float[] v6 = {f4, f5, f6};
float[] v7 = {x, f5, f6};
float[] v1 = {width, y, z};
float[] v2 = {width, height, z};
float[] v3 = {x, height, z};
float[] v4 = {x, y, depth};
float[] v5 = {width, y, depth};
float[] v6 = {width, height, depth};
float[] v7 = {x, height, depth};
switch(dir)
{
@ -437,6 +437,117 @@ public class ModelRendererTurbo extends ModelRenderer
addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d);
}
/**
* Adds a trapezoid-like shape. It's achieved by expanding the shape on one side.
* You can use the static variables <code>MR_RIGHT</code>, <code>MR_LEFT</code>,
* <code>MR_FRONT</code>, <code>MR_BACK</code>, <code>MR_TOP</code> and
* <code>MR_BOTTOM</code>.
* @param x the starting x-position
* @param y the starting y-position
* @param z the starting z-position
* @param w the width (over the x-direction)
* @param h the height (over the y-direction)
* @param d the depth (over the z-direction)
* @param scale the "scale" of the box. It only increases the size in each direction by that many.
* @param bottomScale the "scale" of the bottom
* @param dir the side the scaling is applied to
*/
/*public void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir)
{
float width = x + (float)w;
float height = y + (float)h;
float depth = z + (float)d;
x -= scale;
y -= scale;
z -= scale;
width += scale;
height += scale;
depth += scale;
int m = (mirror ? -1 : 1);
if(mirror)
{
float f7 = width;
width = x;
x = f7;
}
float[] v = {x, y, z};
float[] v1 = {width, y, z};
float[] v2 = {width, height, z};
float[] v3 = {x, height, z};
float[] v4 = {x, y, depth};
float[] v5 = {width, y, depth};
float[] v6 = {width, height, depth};
float[] v7 = {x, height, depth};
switch(dir)
{
case MR_RIGHT:
v[1] -= bottomScale;
v[2] -= bottomScale;
v3[1] += bottomScale;
v3[2] -= bottomScale;
v4[1] -= bottomScale;
v4[2] += bottomScale;
v7[1] += bottomScale;
v7[2] += bottomScale;
break;
case MR_LEFT:
v1[1] -= bottomScale;
v1[2] -= bottomScale;
v2[1] += bottomScale;
v2[2] -= bottomScale;
v5[1] -= bottomScale;
v5[2] += bottomScale;
v6[1] += bottomScale;
v6[2] += bottomScale;
break;
case MR_FRONT:
v[0] -= m * bottomScale;
v[1] -= bottomScale;
v1[0] += m * bottomScale;
v1[1] -= bottomScale;
v2[0] += m * bottomScale;
v2[1] += bottomScale;
v3[0] -= m * bottomScale;
v3[1] += bottomScale;
break;
case MR_BACK:
v4[0] -= m * bottomScale;
v4[1] -= bottomScale;
v5[0] += m * bottomScale;
v5[1] -= bottomScale;
v6[0] += m * bottomScale;
v6[1] += bottomScale;
v7[0] -= m * bottomScale;
v7[1] += bottomScale;
break;
case MR_TOP:
v[0] -= m * bottomScale;
v[2] -= bottomScale;
v1[0] += m * bottomScale;
v1[2] -= bottomScale;
v4[0] -= m * bottomScale;
v4[2] += bottomScale;
v5[0] += m * bottomScale;
v5[2] += bottomScale;
break;
case MR_BOTTOM:
v2[0] += m * bottomScale;
v2[2] -= bottomScale;
v3[0] -= m * bottomScale;
v3[2] -= bottomScale;
v6[0] += m * bottomScale;
v6[2] += bottomScale;
v7[0] -= m * bottomScale;
v7[2] += bottomScale;
break;
}
addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d);
}*/
/**
* Creates a shape from a 2D vector shape.
* @param x the starting x position

View File

@ -1,14 +1,18 @@
package tinker.tconstruct.crafting;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/** Melting and hacking, churn and burn */
public class Smeltery
{
public static Smeltery instance = new Smeltery();
private HashMap<List<Integer>, ItemStack> smeltingList = new HashMap<List<Integer>, ItemStack>();
private HashMap<List<Integer>, LiquidStack> smeltingList = new HashMap<List<Integer>, LiquidStack>();
private HashMap<List<Integer>, Integer> temperatureList = new HashMap<List<Integer>, Integer>();
/** Adds a mapping between an input and an itemstack
@ -17,7 +21,7 @@ public class Smeltery
* @param metadata Damage or use
* @param itemstack
*/
public static void addSmelting(int itemID, int metadata, int temperature, ItemStack itemstack)
public static void addLiquidMelting(int itemID, int metadata, int temperature, LiquidStack itemstack)
{
instance.smeltingList.put(Arrays.asList(itemID, metadata), itemstack);
instance.temperatureList.put(Arrays.asList(itemID, metadata), temperature);
@ -61,18 +65,18 @@ public class Smeltery
* @param item The Source ItemStack
* @return The result ItemStack
*/
public static ItemStack getSmeltingResult(ItemStack item)
public static LiquidStack getSmeltingResult(ItemStack item)
{
if (item == null)
return null;
ItemStack stack = (ItemStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (stack == null)
return null;
return stack.copy();
}
public static ItemStack getSmeltingResult(int blockID)
public static LiquidStack getSmeltingResult(int blockID)
{
return getSmeltingResult(blockID, 0);
}
@ -82,9 +86,9 @@ public class Smeltery
* @param item The Source ItemStack
* @return The result ItemStack
*/
public static ItemStack getSmeltingResult(int blockID, int metadata)
public static LiquidStack getSmeltingResult(int blockID, int metadata)
{
ItemStack stack = (ItemStack) instance.smeltingList.get(Arrays.asList(blockID, metadata));
LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(blockID, metadata));
if (stack == null)
return null;
return stack.copy();

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.blocks;
package tinker.tconstruct.items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.blocks;
package tinker.tconstruct.items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

View File

@ -1,4 +1,4 @@
package tinker.tconstruct.blocks;
package tinker.tconstruct.items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

View File

@ -1,15 +1,16 @@
package tinker.tconstruct.logic;
import net.minecraft.block.Block;
import java.util.ArrayList;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.LiquidStack;
@ -41,6 +42,10 @@ public class SmelteryLogic extends InventoryLogic
public int[] activeTemps;
public int[] meltingTemps;
int tick;
public ArrayList<LiquidStack> moltenMetal = new ArrayList<LiquidStack>();
int maxLiquid = 10000;
int slag;
public SmelteryLogic()
{
@ -74,9 +79,29 @@ public class SmelteryLogic extends InventoryLogic
}
@Override
public void setDirection (byte dir)
public void setDirection (float yaw, float pitch)
{
direction = dir;
int facing = MathHelper.floor_double((double)(yaw / 360) + 0.5D) & 3;
switch (facing)
{
case 0:
direction = 2;
break;
case 1:
direction = 5;
break;
case 2:
direction = 3;
break;
case 3:
direction = 4;
break;
}
//direction = dir;
}
@Override
@ -91,12 +116,6 @@ public class SmelteryLogic extends InventoryLogic
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
@Override
public boolean canFaceVertical ()
{
return false;
}
public int getScaledFuelGague (int scale)
{
return (fuelGague * scale) / 52;
@ -157,10 +176,12 @@ public class SmelteryLogic extends InventoryLogic
activeTemps[i] += 1;
else if (meltingTemps[i] >= activeTemps[i])
{
ItemStack result = getResultFor(inventory[i]);
LiquidStack result = getResultFor(inventory[i]);
if (result != null)
{
inventory[i] = result;
inventory[i] = null;
addMoltenMetal(result);
onInventoryChanged();
//setWorldToInventory();
}
}
@ -172,6 +193,26 @@ public class SmelteryLogic extends InventoryLogic
}
}
void addMoltenMetal(LiquidStack liquid)
{
if (moltenMetal.size() == 0)
moltenMetal.add(liquid);
else
{
boolean added = false;
for (LiquidStack l : moltenMetal)
{
if (l.itemID == liquid.itemID && l.itemMeta == liquid.itemMeta)
{
l.amount += liquid.amount;
added = true;
}
}
if (!added)
moltenMetal.add(liquid);
}
}
void updateTemperatures()
{
for (int i = 0; i < 9; i++)
@ -201,7 +242,7 @@ public class SmelteryLogic extends InventoryLogic
}
}
public ItemStack getResultFor (ItemStack stack)
public LiquidStack getResultFor (ItemStack stack)
{
return Smeltery.instance.getSmeltingResult(stack);
}
@ -219,102 +260,6 @@ public class SmelteryLogic extends InventoryLogic
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
/*@Override
public void setInventorySlotContents (int slot, ItemStack itemstack)
{
super.setInventorySlotContents(slot, itemstack);
setWorldToInventory();
}
@Override
public ItemStack decrStackSize (int slot, int quantity)
{
ItemStack stack = super.decrStackSize(slot, quantity);
setWorldToInventory();
return stack;
}*/
/* World-inventory matching */
/*void matchInventoryToWorld ()
{
switch (getDirection())
{
case 2: // +z
grabWorldBlocks(xCoord, yCoord, zCoord + 2);
break;
case 3: // -z
grabWorldBlocks(xCoord, yCoord, zCoord - 2);
break;
case 4: // +x
grabWorldBlocks(xCoord + 2, yCoord, zCoord);
break;
case 5: // -x
grabWorldBlocks(xCoord - 2, yCoord, zCoord);
break;
}
}*/
/*void setWorldToInventory ()
{
switch (getDirection())
{
case 2: // +z
setWorldToInventory(xCoord, yCoord, zCoord + 2);
break;
case 3: // -z
setWorldToInventory(xCoord, yCoord, zCoord - 2);
break;
case 4: // +x
setWorldToInventory(xCoord + 2, yCoord, zCoord);
break;
case 5: // -x
setWorldToInventory(xCoord - 2, yCoord, zCoord);
break;
}
}*/
/*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 md = worldObj.getBlockMetadata(xPos + x - 1, y, zPos + z - 1);
ItemStack stack = inventory[xPos + zPos * 3];
if (stack == null)
{
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 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];
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);
if (meltingTemps[xPos + zPos * 3] < bottomTemps[xPos + zPos * 3])
bottomTemps[xPos + zPos * 3] = meltingTemps[xPos + zPos * 3];
}
}
}
}*/
public void checkValidPlacement ()
{
switch (getDirection())

View File

@ -26,6 +26,8 @@ public class ManhattanOreGenerator extends WorldGenerator
private boolean generateLines;
private boolean checkGenMinable;
List<Integer[]> possibleMoves = new ArrayList<Integer[]>();
public ManhattanOreGenerator(int id, int meta, int minSize, int maxSize, int dense, boolean lines, boolean replaceGenMinable, Object... replacableIDs)
{
minableBlockId = id;
@ -40,6 +42,29 @@ public class ManhattanOreGenerator extends WorldGenerator
{
replaceableBlocks.add((Integer) i);
}
initPossibleMoves();
}
void initPossibleMoves()
{
possibleMoves.add(new Integer[] {1, 0, 0});
possibleMoves.add(new Integer[] {0, 1, 0});
possibleMoves.add(new Integer[] {0, 0, 1});
possibleMoves.add(new Integer[] {-1, 0, 0});
possibleMoves.add(new Integer[] {0, -1, 0});
possibleMoves.add(new Integer[] {0, 0, -1});
possibleMoves.add(new Integer[] {1, 1, 0});
possibleMoves.add(new Integer[] {-1, 1, 0});
possibleMoves.add(new Integer[] {1, -1, 0});
possibleMoves.add(new Integer[] {-1, -1, 0});
possibleMoves.add(new Integer[] {1, 0, 1});
possibleMoves.add(new Integer[] {-1, 0, 1});
possibleMoves.add(new Integer[] {1, 0, -1});
possibleMoves.add(new Integer[] {-1, 0, -1});
possibleMoves.add(new Integer[] {0, 1, 1});
possibleMoves.add(new Integer[] {0, -1, 1});
possibleMoves.add(new Integer[] {0, 1, -1});
possibleMoves.add(new Integer[] {0, -1, -1});
}
public boolean spawnOre(World world, Integer[] coords)
@ -74,38 +99,16 @@ public class ManhattanOreGenerator extends WorldGenerator
@Override
public int compare(Integer[] arg0, Integer[] arg1) {
return (arg0[0] - arg1[0]) + (arg0[1] - arg1[1]) + (arg0[2] - arg1[2]);
}
}
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//List<Integer[]> spawnedCoords = new ArrayList<Integer[]>();
SortedList<Integer[]> sortedList = new SortedList<Integer[]>(new CompareCoordinates());
spawnOre(world, x, y, z);
sortedList.add(new Integer[] {x, y, z});
List<Integer[]> possibleMoves = new ArrayList<Integer[]>();
possibleMoves.add(new Integer[] {1, 0, 0});
possibleMoves.add(new Integer[] {0, 1, 0});
possibleMoves.add(new Integer[] {0, 0, 1});
possibleMoves.add(new Integer[] {-1, 0, 0});
possibleMoves.add(new Integer[] {0, -1, 0});
possibleMoves.add(new Integer[] {0, 0, -1});
possibleMoves.add(new Integer[] {1, 1, 0});
possibleMoves.add(new Integer[] {-1, 1, 0});
possibleMoves.add(new Integer[] {1, -1, 0});
possibleMoves.add(new Integer[] {-1, -1, 0});
possibleMoves.add(new Integer[] {1, 0, 1});
possibleMoves.add(new Integer[] {-1, 0, 1});
possibleMoves.add(new Integer[] {1, 0, -1});
possibleMoves.add(new Integer[] {-1, 0, -1});
possibleMoves.add(new Integer[] {0, 1, 1});
possibleMoves.add(new Integer[] {0, -1, 1});
possibleMoves.add(new Integer[] {0, 1, -1});
possibleMoves.add(new Integer[] {0, -1, -1});
sortedList.add(new Integer[] {x, y, z});
int trueSize = 1;
int randomSize = this.numberOfBlocks + random.nextInt(this.sizeVariance);
@ -117,7 +120,7 @@ public class ManhattanOreGenerator extends WorldGenerator
int pickedOre = (int) (((random.nextFloat()*random.nextFloat())) * sortedList.size());
if (!generateLines)
pickedOre = sortedList.size()-1; //Comment this line to create groups instead of lines
pickedOre = sortedList.size()-1;
Integer[] coords = sortedList.get(pickedOre);
Integer[] finalCoords = {coords[0], coords[1], coords[2]};
@ -135,11 +138,11 @@ public class ManhattanOreGenerator extends WorldGenerator
cpm.remove(pick);
} while(sortedList.contains(finalCoords));
if(random.nextInt(100) < density)
{
//if(random.nextInt(100) < density)
//{
spawnOre(world, finalCoords);
trueSize++;
}
//}
sortedList.add(finalCoords);
}