remove 1.4.2 archive, Changed Boiler, FireBox

Boiler is now its own block, and will later have upgraded version
FireBox is now its own Block, and will have a liquid burning version,
bio fuel version, and a lava buffer that can transfer more heat from
lava without damaging the boiler
I also made changes for the IReadOut interface from basic pipes
This commit is contained in:
Rseifert 2012-12-07 12:49:50 -05:00
parent ab2afa98cd
commit 72b65ab025
121 changed files with 762 additions and 8443 deletions

View file

@ -1,221 +0,0 @@
package basicpipes;
import java.io.File;
import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Configuration;
import universalelectricity.prefab.network.PacketManager;
import basicpipes.LTanks.ItemTank;
import basicpipes.LTanks.TileEntityLTank;
import basicpipes.conductors.BlockPipe;
import basicpipes.conductors.BlockRod;
import basicpipes.conductors.ItemGuage;
import basicpipes.conductors.ItemParts;
import basicpipes.conductors.ItemPipe;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.conductors.TileEntityRod;
import basicpipes.machines.BlockMachine;
import basicpipes.machines.BlockValve;
import basicpipes.machines.TileEntityPump;
import basicpipes.pipes.api.Liquid;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "basicPipes", name = "Basic Pipes", version = "1.9", dependencies = "after:UniversalElectricity")
@NetworkMod(channels = { "Pipes" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketManager.class)
public class BasicPipesMain {
public BasicPipesMain instance;
@SidedProxy(clientSide = "basicpipes.PipeClientProxy", serverSide = "basicpipes.PipeProxy")
public static PipeProxy proxy;
static Configuration config = new Configuration((new File(
cpw.mods.fml.common.Loader.instance().getConfigDir(),
"/UniversalElectricity/BasicPipes.cfg")));
public static int pipeID = configurationProperties();
private static int partID;
private static int ppipeID;
public static int machineID;
private static int toolID;
private static int tankID;
public static int valveID;
public static int rodID;
public static Block pipe = new BlockPipe(pipeID).setBlockName("pipe");
public static Block machine = new BlockMachine(machineID)
.setBlockName("pump");
public static Block valve = new BlockValve(valveID).setBlockName("valve");
public static Block rod = new BlockRod(rodID);
public static Item parts = new ItemParts(partID);
public static Item itemPipes = new ItemPipe(ppipeID);
public static Item itemTank = new ItemTank(tankID);
public static Item gauge = new ItemGuage(toolID);
public static String channel = "Pipes";
public static String textureFile = "/textures";
public static boolean ueLoaded = false;
public static int configurationProperties() {
config.load();
pipeID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"PipeBlock", 155).value);
machineID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"machineBlock", 156).value);
valveID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"ValveBlock", 157).value);
rodID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"gearBlock", 158).value);
partID = Integer.parseInt(config.get(Configuration.CATEGORY_ITEM,
"parts", 23022).value);
ppipeID = Integer.parseInt(config.get(Configuration.CATEGORY_ITEM,
"pipes", 23023).value);
toolID = Integer.parseInt(config.get(Configuration.CATEGORY_ITEM,
"ToolID", 23024).value);
tankID = Integer.parseInt(config.get(Configuration.CATEGORY_ITEM,
"tankID", 23025).value);
config.save();
return pipeID;
}
@PreInit
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit();
GameRegistry.registerBlock(pipe);
GameRegistry.registerBlock(rod);
GameRegistry.registerBlock(machine,
basicpipes.machines.ItemMachine.class);
}
@Init
public void load(FMLInitializationEvent evt) {
// register
proxy.init();
GameRegistry.registerTileEntity(TileEntityPipe.class, "pipe");
GameRegistry.registerTileEntity(TileEntityPump.class, "pump");
GameRegistry.registerTileEntity(TileEntityRod.class, "rod");
GameRegistry.registerTileEntity(TileEntityLTank.class, "ltank");
// Names and lang stuff
// Pipe Names
for (int i = 0; i < Liquid.values().length; i++) {
LanguageRegistry.addName((new ItemStack(itemPipes, 1, i)),
Liquid.getLiquid(i).lName + " Pipe");
}
for (int i = 0; i < Liquid.values().length; i++) {
LanguageRegistry.addName((new ItemStack(itemTank, 1, i)),
Liquid.getLiquid(i).lName + " Tank");
}
// Pump
LanguageRegistry.addName((new ItemStack(machine, 1, 0)), "WaterPump");
LanguageRegistry.addName((new ItemStack(machine, 1, 4)),
"WaterCondensor");
LanguageRegistry.addName((new ItemStack(rod, 1)), "MechRod");
// Tools
LanguageRegistry.addName((new ItemStack(gauge, 1, 0)), "PipeGuage");
// Parts
LanguageRegistry.addName((new ItemStack(parts, 1, 0)), "BronzeTube");
LanguageRegistry.addName((new ItemStack(parts, 1, 1)), "IronTube");
LanguageRegistry.addName((new ItemStack(parts, 1, 2)), "ObsidianTube");
LanguageRegistry.addName((new ItemStack(parts, 1, 3)), "NetherTube");
LanguageRegistry.addName((new ItemStack(parts, 1, 4)), "LeatherSeal");
LanguageRegistry.addName((new ItemStack(parts, 1, 5)), "SlimeSeal");
LanguageRegistry.addName((new ItemStack(parts, 1, 6)), "BronzeTank");
LanguageRegistry.addName((new ItemStack(parts, 1, 7)), "Valve");
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit();
GameRegistry.addRecipe(new ItemStack(this.gauge, 1, 0), new Object[] {
"TVT"," T ", 'V', new ItemStack(parts,1,7), 'T',new ItemStack(parts,1,1) });
//iron tube
GameRegistry.addRecipe(new ItemStack(parts, 2, 1), new Object[] {
"@@@", '@', Item.ingotIron });
//obby tube
GameRegistry.addRecipe(new ItemStack(parts, 2, 2), new Object[] {
"@@@", '@', Block.obsidian });
//nether tube
GameRegistry
.addRecipe(new ItemStack(parts, 2, 3),
new Object[] { "N@N", 'N', Block.netherrack, '@',
new ItemStack(parts, 2, 2) });
//seal
GameRegistry.addRecipe(new ItemStack(parts, 2, 4), new Object[] { "@@",
"@@", '@', Item.leather });
//slime steal
GameRegistry.addShapelessRecipe(new ItemStack(parts, 1, 5),
new Object[] { new ItemStack(parts, 1, 4),
new ItemStack(Item.slimeBall, 1) });// stick seal
// crafting pipes
// {"black", "red", "green", "brown", "blue", "purple", "cyan",
// "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta",
// "orange", "white"};
GameRegistry.addRecipe(new ItemStack(rod, 1), new Object[] { "I@I",
'I', Item.ingotIron, '@', new ItemStack(parts, 1, 1) });
// water
GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 1),
new Object[] { new ItemStack(parts, 1, 1),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 4) });
// lava TODO change to use obby pipe and nether items
GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 2),
new Object[] { new ItemStack(parts, 1, 2),
new ItemStack(Item.dyePowder, 1, 1) });
// oil
GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 3),
new Object[] { new ItemStack(parts, 1, 1),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 0) });
// fuel
GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 4),
new Object[] { new ItemStack(parts, 1, 1),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 11) });
GameRegistry.addRecipe(new ItemStack(parts, 1, 7), new Object[] {
"T@T", 'T', new ItemStack(parts, 1, 1), '@', Block.lever });// valve
GameRegistry.addRecipe(new ItemStack(parts, 1, 6), new Object[] {
" @ ", "@ @", " @ ", '@', Item.ingotIron });// tank
GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 0),
new Object[] { new ItemStack(parts, 1, 6),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 15) });
GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 1),
new Object[] { new ItemStack(parts, 1, 6),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 4) });
// lava TODO change to use obby pipe and nether items
GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 2),
new Object[] { new ItemStack(parts, 1, 6), Block.obsidian,
Block.obsidian, Block.obsidian, Block.obsidian });
// oil
GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 3),
new Object[] { new ItemStack(parts, 1, 6),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 0) });
// fuel
GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 4),
new Object[] { new ItemStack(parts, 1, 6),
new ItemStack(parts, 1, 4),
new ItemStack(Item.dyePowder, 1, 11) });
GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 0),
new Object[] { new ItemStack(parts, 1, 1),
new ItemStack(parts, 1, 4) });
GameRegistry.addRecipe(new ItemStack(machine, 1, 0), new Object[] {
"@T@", "BPB", "@P@", '@', new ItemStack(Item.ingotIron, 2),
'B', new ItemStack(parts, 1, 7), 'P',
new ItemStack(Block.pistonBase), 'T',
new ItemStack(parts, 1, 6) });
}
}

View file

@ -1,130 +0,0 @@
package basicpipes.LTanks;
import java.util.List;
import basicpipes.BasicPipesMain;
import basicpipes.pipes.api.Liquid;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
public class ItemTank extends Item
{
int index = 64;//64 + 2 rows alloted to pipes
private int spawnID;
public ItemTank(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setIconIndex(10);
this.setItemName("tank");
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public int getIconFromDamage(int par1)
{
return par1+index;
}
@Override
public String getItemNameIS(ItemStack itemstack)
{
return itemstack.getItemDamage() < Liquid.values().length ? Liquid.getLiquid(itemstack.getItemDamage()).lName+" Tank" : "unknown";
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for(int i = 0; i < Liquid.values().length; i++)
{
par3List.add(new ItemStack(this, 1, i));
}
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "Pipes";
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int blockID = par3World.getBlockId(par4, par5, par6);
spawnID = BasicPipesMain.machineID;
if (blockID == Block.snow.blockID)
{
par7 = 1;
}
else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (BasicPipesMain.pipe.canPlaceBlockAt(par3World,par4,par5,par6))
{
Block var9 = Block.blocksList[this.spawnID];
par3World.editingBlocks = true;
if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, var9.blockID,5))
{
if (par3World.getBlockId(par4, par5, par6) == var9.blockID)
{
Block.blocksList[this.spawnID].onBlockAdded(par3World, par4, par5, par6);
Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer);
TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6);
if(blockEntity instanceof TileEntityLTank)
{
TileEntityLTank pipeEntity = (TileEntityLTank) blockEntity;
Liquid dm = Liquid.getLiquid(par1ItemStack.getItemDamage());
pipeEntity.setType(dm);
}
}
--par1ItemStack.stackSize;
par3World.editingBlocks = false;
return true;
}
}
par3World.editingBlocks = false;
return false;
}
}

View file

@ -1,210 +0,0 @@
package basicpipes.LTanks;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.Packet;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.Vector3;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager;
import basicpipes.BasicPipesMain;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.IStorageTank;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityLTank extends TileEntity implements IStorageTank,ILiquidProducer,IPacketReceiver{
public TileEntity[] cc = {null,null,null,null,null,null};
public Liquid type = Liquid.DEFUALT;
public int LStored = 0;
public int pLStored = 0;
public int LMax = 4;
private int count = 0;
private int count2 = 0;
private boolean firstUpdate = true;
public void updateEntity()
{
if(++count >= 5)
{
count = 0;
this.cc = MHelper.getSourounding(worldObj,xCoord, yCoord, zCoord);
if(!worldObj.isRemote)
{
MHelper.shareLiquid(worldObj,xCoord, yCoord, zCoord,this.LStored,this.getLiquidCapacity(type), type);
if(firstUpdate ||(this.LStored != pLStored)|| count2 >= 100)
{
count2 = 0;
firstUpdate = false;
Packet packet = PacketManager.getPacket(BasicPipesMain.channel, this, new Object[]{type.ordinal(),LStored});
PacketManager.sendPacketToClients(packet, worldObj, Vector3.get(this), 20);
}
this.pLStored = this.LStored;
}
}
}
public void writeToNBT(NBTTagCompound nbt)
{
super.writeToNBT(nbt);
nbt.setInteger("Vol", this.LStored);
nbt.setInteger("type", this.type.ordinal());
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
this.LStored = nbt.getInteger("Vol");
this.type = Liquid.getLiquid(nbt.getInteger("type"));
}
//--------------------
//Liquid stuff
//------------------------------------
@Override
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side)
{
if(type == this.type)
{
if(this.LStored < this.getLiquidCapacity(this.type))
{
int rejectedVolume = Math.max((this.getStoredLiquid(type) + vol) - this.LMax, 0);
this.LStored = Math.min(Math.max((LStored + vol - rejectedVolume),0),this.LMax);
return rejectedVolume;
}else
{
TileEntity te = null;
if(this.type.isGas)
{
worldObj.getBlockTileEntity(xCoord, yCoord+1, zCoord);
}else
{
worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord);
}
if( te instanceof IStorageTank)
{
return ((IStorageTank)te).onReceiveLiquid(type, vol, ForgeDirection.UNKNOWN);
}
}
}
return vol;
}
@Override
public boolean canRecieveLiquid(Liquid type, ForgeDirection side) {
if(type == this.type)
{
if(this.type.isGas && side == ForgeDirection.UP)
{
return false;
}
if(!this.type.isGas && side == ForgeDirection.DOWN)
{
return false;
}
return true;
}
return false;
}
@Override
public int getStoredLiquid(Liquid type) {
if(type == this.type)
{
return LStored;
}
return 0;
}
@Override
public int getLiquidCapacity(Liquid type) {
if(type == this.type)
{
return LMax;
}
return 0;
}
public Liquid getType() {
// TODO Auto-generated method stub
return type;
}
@Override
public int onProduceLiquid(Liquid type, int vol, ForgeDirection side) {
if(type == this.type && this.LStored > 1 && vol > 0)
{
//TODO correct / do math for
LStored--;
return 1;
}
return 0;
}
@Override
public boolean canProduceLiquid(Liquid type, ForgeDirection side) {
if(type == this.type)
{
if(this.type.isGas && side == ForgeDirection.UP)
{
return true;
}
if(!this.type.isGas && side == ForgeDirection.DOWN)
{
return true;
}
}
return false;
}
@Override
public boolean canProducePresure(Liquid type, ForgeDirection side) {
if(type == this.type)
{
if(this.type.isGas && side == ForgeDirection.DOWN)
{
return true;
}
if(!this.type.isGas && side == ForgeDirection.UP)
{
return true;
}
}
return false;
}
@Override
public int presureOutput(Liquid type, ForgeDirection side) {
if(type == this.type)
{
return this.type.defaultPresure;
}
return 0;
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput data) {
try
{
this.type = Liquid.getLiquid(data.readInt());
this.LStored = data.readInt();
}catch(Exception e)
{
e.printStackTrace();
System.out.print("Fail reading data for Storage tank \n");
}
}
public void setType(Liquid dm) {
this.type = dm;
}
}

View file

@ -1,56 +0,0 @@
package basicpipes;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.conductors.TileEntityRod;
import basicpipes.machines.TileEntityPump;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
public class PipeProxy implements IGuiHandler
{
public void preInit()
{
}
public void init()
{
}
public void postInit()
{
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity != null)
{
switch(ID)
{
}
}
return null;
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity != null)
{
switch(ID)
{
}
}
return null;
}
}

View file

@ -1,90 +0,0 @@
package basicpipes.conductors;
import java.util.Random;
import basicpipes.BasicPipesMain;
import basicpipes.pipes.api.ILiquidConsumer;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.Liquid;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.EntityItem;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import net.minecraftforge.common.ForgeDirection;
public class BlockPipe extends BlockContainer
{
public BlockPipe(int id)
{
super(id, Material.iron);
this.setBlockName("Pipe");
this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F);
this.setHardness(1f);
this.setResistance(3f);
}
public boolean isOpaqueCube(){return false;}
public boolean renderAsNormalBlock(){return false;}
public int getRenderType(){return -1;}
public int idDropped(int par1, Random par2Random, int par3){return 0;}
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
super.onBlockAdded(world, x, y, z);
}
/**
* 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
*/
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{
super.onNeighborBlockChange(world, x, y, z, blockID);
}
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
int var5 = par1World.getBlockId(par2, par3, par4);
return var5 == 0 || blocksList[var5].blockMaterial.isGroundCover();
}
@Override
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
{
return true;
}
@Override
public TileEntity createNewTileEntity(World var1) {
// TODO Auto-generated method stub
return new TileEntityPipe();
}
@Override
public void breakBlock(World world, int x, int y, int z,int par5, int par6)
{
super.breakBlock(world, x, y, z, par5, par6);
TileEntity ent = world.getBlockTileEntity(x, y, z);
Random furnaceRand = new Random();
if(ent instanceof TileEntityPipe)
{
TileEntityPipe pipe = (TileEntityPipe) ent;
int meta = pipe.type.ordinal();
float var8 = furnaceRand.nextFloat() * 0.8F + 0.1F;
float var9 = furnaceRand.nextFloat() * 0.8F + 0.1F;
float var10 = furnaceRand.nextFloat() * 0.8F + 0.1F;
EntityItem var12 = new EntityItem(world, (double)((float)x + var8), (double)((float)y + var9),
(double)((float)z + var10), new ItemStack(BasicPipesMain.itemPipes, 1, meta));
float var13 = 0.05F;
var12.motionX = (double)((float)furnaceRand.nextGaussian() * var13);
var12.motionY = (double)((float)furnaceRand.nextGaussian() * var13 + 0.2F);
var12.motionZ = (double)((float)furnaceRand.nextGaussian() * var13);
world.spawnEntityInWorld(var12);
}
}
}

View file

@ -1,83 +0,0 @@
package basicpipes.conductors;
import basicpipes.ItemRenderHelper;
import steampower.TileEntityMachine;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Material;
import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import net.minecraftforge.common.ForgeDirection;
public class BlockRod extends universalelectricity.prefab.BlockMachine {
public BlockRod(int par1) {
super("MechanicRod", par1, Material.iron);
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public int damageDropped(int metadata)
{
return 0;
}
@Override
public void onBlockPlacedBy(World world,int i,int j,int k, EntityLiving player)
{
int angle= MathHelper.floor_double((player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int meta = 0;
ForgeDirection idr;
int dZ = 0;
int dX = 0;
switch(angle)
{
case 0: meta = 2;dZ--;break;
case 1: meta = 5;dX--;break;
case 2: meta = 3;dZ++;break;
case 3: meta = 4;dX++;break;
}
world.setBlockAndMetadataWithUpdate(i, j, k,blockID, meta, true);
}
@Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
int meta = world.getBlockMetadata(x, y, z);
if(meta >= 5)
{
world.setBlockMetadataWithNotify(x, y, z, 0);
}
else
{
world.setBlockMetadataWithNotify(x,y,z,meta+1);
}
return true;
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityRod();
}
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;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return ItemRenderHelper.renderID;
}
}

View file

@ -1,114 +0,0 @@
package basicpipes.conductors;
import java.util.List;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import basicpipes.BasicPipesMain;
import basicpipes.LTanks.TileEntityLTank;
import basicpipes.pipes.api.IMechanical;
import basicpipes.pipes.api.Liquid;
public class ItemGuage extends Item
{
private int spawnID;
public ItemGuage(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setIconIndex(10);
this.setItemName("guage");
this.setCreativeTab(CreativeTabs.tabTools);
this.setMaxStackSize(1);
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(this, 1, 0));
}
@Override
public int getIconFromDamage(int par1)
{
switch(par1)
{
case 0: return 24;
}
return this.iconIndex;
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "guage";
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
if(!par3World.isRemote)
{
if(itemStack.getItemDamage() == 0)
{
TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6);
if(blockEntity instanceof TileEntityPipe)
{
TileEntityPipe pipeEntity = (TileEntityPipe) blockEntity;
Liquid type = pipeEntity.getType();
int steam = pipeEntity.getStoredLiquid(type);
int pressure = pipeEntity.presure;
String typeName = type.lName;
String print = "Error";
print = typeName +" " + steam +" @ "+pressure+"PSI";
player.sendChatToPlayer(print);
return true;
}
if(blockEntity instanceof TileEntityLTank)
{
TileEntityLTank pipeEntity = (TileEntityLTank) blockEntity;
Liquid type = pipeEntity.getType();
int steam = pipeEntity.getStoredLiquid(type);
String typeName = type.lName;
String print = "Error";
print = typeName +" " + steam;
player.sendChatToPlayer(print);
return true;
}
if(blockEntity instanceof IMechanical)
{
IMechanical rod = (IMechanical) blockEntity;
int steam = rod.getForce();
int pressure = rod.getAnimationPos();
String print = "Error";
print = " " + steam +"N "+pressure*45+"degrees";
player.sendChatToPlayer(print);
return true;
}
}
}
return false;
}
public String getItemNameIS(ItemStack par1ItemStack)
{
int var3 = par1ItemStack.getItemDamage();
switch(var3)
{
case 0: return "PipeGuage";
}
return this.getItemName();
}
}

View file

@ -1,62 +0,0 @@
package basicpipes.conductors;
import java.util.ArrayList;
import java.util.List;
import basicpipes.BasicPipesMain;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;
public class ItemParts extends Item{
String[] names = new String[]{"BronzeTube","IronTube","ObbyTube","NetherTube","Seal","StickSeal","BronzeTank","Valve",};
int[] iconID = new int[] {0 ,1 ,2 ,3 ,16 ,17 ,18 ,19};//TODO check these
public ItemParts(int par1)
{
super(par1);
this.setItemName("Parts");
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(64);
this.setCreativeTab(CreativeTabs.tabMaterials);
}
@Override
public int getIconFromDamage(int par1)
{
if(par1 < iconID.length)
{
return iconID[par1];
}
return par1;
}
@Override
public String getItemNameIS(ItemStack itemstack)
{
return names[itemstack.getItemDamage()];
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for(int i = 0; i < names.length; i++)
{
par3List.add(new ItemStack(this, 1, i));
}
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "parts";
}
}

View file

@ -1,130 +0,0 @@
package basicpipes.conductors;
import java.util.List;
import basicpipes.BasicPipesMain;
import basicpipes.pipes.api.Liquid;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
public class ItemPipe extends Item
{
int index = 32;//32 + 4 rows alloted to pipes
private int spawnID;
public ItemPipe(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setIconIndex(10);
this.setItemName("pipe");
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public int getIconFromDamage(int par1)
{
return par1+index;
}
@Override
public String getItemNameIS(ItemStack itemstack)
{
return itemstack.getItemDamage() < Liquid.values().length ? Liquid.getLiquid(itemstack.getItemDamage()).lName+" Pipe" : "Empty Pipe";
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for(int i = 0; i < Liquid.values().length; i++)
{
par3List.add(new ItemStack(this, 1, i));
}
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "Pipes";
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int blockID = par3World.getBlockId(par4, par5, par6);
spawnID = BasicPipesMain.pipeID;
if (blockID == Block.snow.blockID)
{
par7 = 1;
}
else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (BasicPipesMain.pipe.canPlaceBlockAt(par3World,par4,par5,par6))
{
Block var9 = Block.blocksList[this.spawnID];
par3World.editingBlocks = true;
if (par3World.setBlockWithNotify(par4, par5, par6, var9.blockID))
{
if (par3World.getBlockId(par4, par5, par6) == var9.blockID)
{
Block.blocksList[this.spawnID].onBlockAdded(par3World, par4, par5, par6);
Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer);
TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6);
if(blockEntity instanceof TileEntityPipe)
{
TileEntityPipe pipeEntity = (TileEntityPipe) blockEntity;
Liquid dm = Liquid.getLiquid(par1ItemStack.getItemDamage());
pipeEntity.setType(dm);
}
}
--par1ItemStack.stackSize;
par3World.editingBlocks = false;
return true;
}
}
par3World.editingBlocks = false;
return false;
}
}

View file

@ -1,210 +0,0 @@
package basicpipes.conductors;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.Packet;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.Vector3;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager;
import basicpipes.pipes.api.ILiquidConsumer;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityPipe extends TileEntity implements ILiquidConsumer,
IPacketReceiver {
protected Liquid type = Liquid.DEFUALT;
public int capacity = 2;
public int presure = 0;
public int connectedUnits = 0;
public int liquidStored = 0;
private int count = 0;
private int count2 = 0;
protected boolean firstUpdate = true;
public TileEntity[] connectedBlocks = { null, null, null, null, null, null };
public int getPressure() {
return this.presure;
}
@Override
public void updateEntity() {
int highestPressure = 0;
if (++count >= 5) {
this.connectedBlocks = MHelper.getSourounding(worldObj, xCoord,
yCoord, zCoord);
for (int i = 0; i < 6; i++) {
if (connectedBlocks[i] instanceof ILiquidConsumer
&& ((ILiquidConsumer) connectedBlocks[i])
.canRecieveLiquid(this.type, ForgeDirection
.getOrientation(i).getOpposite())) {
this.connectedUnits++;
if (connectedBlocks[i] instanceof TileEntityPipe) {
if (((TileEntityPipe) connectedBlocks[i]).getPressure() > highestPressure) {
highestPressure = ((TileEntityPipe) connectedBlocks[i])
.getPressure();
}
}
} else if (connectedBlocks[i] instanceof ILiquidProducer
&& ((ILiquidProducer) connectedBlocks[i])
.canProduceLiquid(this.type, ForgeDirection
.getOrientation(i).getOpposite())) {
this.connectedUnits++;
if (((ILiquidProducer) connectedBlocks[i])
.canProducePresure(this.type,
ForgeDirection.getOrientation(i))
&& ((ILiquidProducer) connectedBlocks[i])
.presureOutput(this.type, ForgeDirection
.getOrientation(i).getOpposite()) > highestPressure) {
highestPressure = ((ILiquidProducer) connectedBlocks[i])
.presureOutput(this.type,
ForgeDirection.getOrientation(i));
}
} else {
connectedBlocks[i] = null;
}
}
if (!worldObj.isRemote) {
if (firstUpdate || count2++ >= 10) {
count2 = 0;
firstUpdate = false;
Packet packet = PacketManager.getPacket("Pipes", this,
new Object[] { this.type.ordinal() });
PacketManager.sendPacketToClients(packet, worldObj,
Vector3.get(this), 60);
}
this.presure = highestPressure - 1;
for (int i = 0; i < 6; i++) {
if (connectedBlocks[i] instanceof ILiquidProducer) {
int vol = ((ILiquidProducer) connectedBlocks[i])
.onProduceLiquid(this.type, this.capacity
- this.liquidStored, ForgeDirection
.getOrientation(i).getOpposite());
this.liquidStored = Math.min(this.liquidStored + vol,
this.capacity);
}
if (connectedBlocks[i] instanceof ILiquidConsumer
&& this.liquidStored > 0 && this.presure > 0) {
if (connectedBlocks[i] instanceof TileEntityPipe) {
this.liquidStored--;
int vol = ((ILiquidConsumer) connectedBlocks[i])
.onReceiveLiquid(this.type, Math.max(
this.liquidStored, 1),
ForgeDirection.getOrientation(i)
.getOpposite());
this.liquidStored += vol;
} else {
this.liquidStored = ((ILiquidConsumer) connectedBlocks[i])
.onReceiveLiquid(this.type,
this.liquidStored, ForgeDirection
.getOrientation(i)
.getOpposite());
}
}
}
}
}
}
// ---------------
// liquid stuff
// ---------------
@Override
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side) {
if (type == this.type) {
int rejectedVolume = Math.max((this.getStoredLiquid(type) + vol)
- this.capacity, 0);
this.liquidStored = Math.min(
Math.max((liquidStored + vol - rejectedVolume), 0),
this.capacity);
return rejectedVolume;
}
return vol;
}
/**
* @return Return the stored volume in this pipe.
*/
@Override
public int getStoredLiquid(Liquid type) {
if (type == this.type) {
return this.liquidStored;
}
return 0;
}
@Override
public int getLiquidCapacity(Liquid type) {
if (type == this.type) {
return this.capacity;
}
return 0;
}
// find wether or not this side of X block can recieve X liquid type. Also
// use to determine connection of a pipe
@Override
public boolean canRecieveLiquid(Liquid type, ForgeDirection side) {
if (type == this.type) {
return true;
}
return false;
}
// returns liquid type
public Liquid getType() {
return this.type;
}
// used by the item to set the liquid type on spawn
public void setType(Liquid rType) {
this.type = rType;
}
// ---------------------
// data
// --------------------
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput data) {
try {
int type = data.readInt();
if (worldObj.isRemote) {
this.type = Liquid.getLiquid(type);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound) {
super.readFromNBT(par1NBTTagCompound);
this.liquidStored = par1NBTTagCompound.getInteger("liquid");
this.type = Liquid.getLiquid(par1NBTTagCompound.getInteger("type"));
}
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("liquid", this.liquidStored);
par1NBTTagCompound.setInteger("type", this.type.ordinal());
}
}

View file

@ -1,137 +0,0 @@
package basicpipes.conductors;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import steampower.SteamPowerMain;
import universalelectricity.core.Vector3;
import universalelectricity.prefab.network.IPacketReceiver;
import universalelectricity.prefab.network.PacketManager;
import basicpipes.pipes.api.IMechanical;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityRod extends TileEntity implements IPacketReceiver,IMechanical {
public int pos = 0;
private int force = 0;
private int pForce = 0;
public int aForce = 0;
public int forceMax = 1000;
private int tickCount = 0;
private int posCount = 0;
private ForgeDirection frontDir;
private ForgeDirection backDir;
private TileEntity bb;
private TileEntity ff;
@Override
public void updateEntity()
{
super.updateEntity();
if(tickCount++ >=10)
{ tickCount = 0;
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
frontDir = ForgeDirection.getOrientation(meta);
backDir = ForgeDirection.getOrientation(meta).getOpposite();
bb = worldObj.getBlockTileEntity(xCoord+backDir.offsetX, yCoord, zCoord+backDir.offsetZ);
ff = worldObj.getBlockTileEntity(xCoord+frontDir.offsetX, yCoord, zCoord+frontDir.offsetZ);
if(force > 0)
{
int posCountA = (forceMax/force) & 10;
if(posCount++ >= posCountA)
{
pos ++;if(pos > 7){pos = 0;};
}
}
if(bb instanceof TileEntityRod)
{
this.pos = ((IMechanical)bb).getAnimationPos();
}
if(!worldObj.isRemote)
{
if(ff instanceof IMechanical)
{
if(((IMechanical) ff).canInputSide(backDir))
{
((IMechanical) ff).applyForce(aForce);
}
}
if(bb instanceof IMechanical)
{
if(((IMechanical) bb).canOutputSide(frontDir))
{
this.force = ((IMechanical) bb).getForce();
}
}else
{
this.force -=Math.max(force/10, 0);
}
aForce = Math.max(force - 10,0);
if(this.force != this.pForce)
{
Packet packet = PacketManager.getPacket(SteamPowerMain.channel,this, new Object[]{force});
PacketManager.sendPacketToClients(packet, worldObj, Vector3.get(this), 40);
}
this.pForce = this.force;
}
}
}
@Override
public int getForceSide(ForgeDirection side) {
return aForce;
}
@Override
public boolean canOutputSide(ForgeDirection side) {
if(side == frontDir)
{
return true;
}
return false;
}
@Override
public boolean canInputSide(ForgeDirection side) {
if(side == backDir)
{
return true;
}
return false;
}
@Override
public int applyForce(int force) {
this.force = force;
return force;
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput data) {
try
{
this.force = data.readInt();
}catch(Exception e)
{
e.printStackTrace();
System.out.print("MechRodDataFailure \n");
}
}
@Override
public int getAnimationPos() {
return this.pos;
}
@Override
public int getForce() {
// TODO Auto-generated method stub
return this.force;
}
}

View file

@ -1,79 +0,0 @@
package basicpipes.machines;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import basicpipes.BasicPipesMain;
import basicpipes.ItemRenderHelper;
import basicpipes.LTanks.TileEntityLTank;
public class BlockMachine extends BlockContainer
{
public BlockMachine(int id)
{
super(id, Material.iron);
this.setBlockName("Machine");
this.setCreativeTab(CreativeTabs.tabBlock);
this.setRequiresSelfNotify();
this.blockIndexInTexture = 26;
this.setHardness(1f);
this.setResistance(3f);
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return ItemRenderHelper.renderID;
}
public int damageDropped(int meta)
{
if(meta < 4)
{
return 0;
}
return meta;
}
@Override
public TileEntity createNewTileEntity(World var1,int meta) {
// TODO Auto-generated method stub
if(meta < 4)
{
return new TileEntityPump();
}
if(meta == 4)
{
return new TileEntityCondenser();
}
if(meta == 5)
{
return new TileEntityLTank();
}
return null;
}
@Override
public TileEntity createNewTileEntity(World var1) {
// TODO Auto-generated method stub
return null;
}
@Override
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
}

View file

@ -1,179 +0,0 @@
package basicpipes.machines;
import java.util.Random;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import basicpipes.BasicPipesMain;
public class BlockValve extends universalelectricity.prefab.BlockMachine
{
public BlockValve(int id)
{
super("Valve", id, Material.iron);
this.setBlockName("Valve");
this.setCreativeTab(CreativeTabs.tabRedstone);
this.setRequiresSelfNotify();
this.blockIndexInTexture = 26;
}
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player)
{
TileEntity te = world.getBlockTileEntity(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if(te instanceof TileEntityValve)
{
TileEntityValve valve = (TileEntityValve) te;
if(meta < 8)
{
if(!valve.on){
valve.on = true;
}else{
valve.on = false;
}
}
}
return false;
}
//rotation valve around y axis
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer player)
{
int meta = world.getBlockMetadata(x, y, z);
if(meta < 4)
{
if(meta == 3)
{
world.setBlockMetadataWithNotify(x, y, z, 0);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, meta+1);
}
return true;
}
if(meta > 3 && meta < 8)
{
if(meta == 7)
{
world.setBlockMetadataWithNotify(x, y, z, 4);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, meta+1);
}
return true;
}
if(meta > 7 && meta < 12)
{
if(meta == 11)
{
world.setBlockMetadataWithNotify(x, y, z, 8);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, meta+1);
}
return true;
}
if(meta > 11 && meta < 16)
{
if(meta == 15)
{
world.setBlockMetadataWithNotify(x, y, z, 12);
}
else
{
world.setBlockMetadataWithNotify(x, y, z, meta+1);
}
return true;
}
return false;
}
//one shift click inverts pipe to face up
public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer player)
{
int meta = world.getBlockMetadata(x, y, z);
if(meta < 4)
{
world.setBlockMetadataWithNotify(x, y, z, meta+4);
return true;
}
if(meta > 3 && meta < 8)
{
world.setBlockMetadataWithNotify(x, y, z, meta-4);
return true;
}
if(meta > 7 && meta < 12)
{
world.setBlockMetadataWithNotify(x, y, z, meta+4);
return true;
}
if(meta > 11 && meta < 16)
{
world.setBlockMetadataWithNotify(x, y, z, meta-4);
return true;
}
return false;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return -1;
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return this.blockID;
}
public int damageDropped(int meta)
{
if(meta < 8)
{
return 0;
}
if(meta < 16 && meta > 7)
{
return 4;
}
return 0;
}
//Per tick
public int conductorCapacity()
{
return 1;
}
@Override
public TileEntity createNewTileEntity(World var1) {
// TODO Auto-generated method stub
return new TileEntityValve();
}
@Override
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
}

View file

@ -1,124 +0,0 @@
package basicpipes.machines;
import java.util.List;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import basicpipes.BasicPipesMain;
public class ItemMachine extends ItemBlock
{
int index = 26;
private int spawnID;
public ItemMachine(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setIconIndex(10);
this.setItemName("Machine");
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public int getIconFromDamage(int par1)
{
return par1+index;
}
@Override
public String getItemNameIS(ItemStack itemstack)
{
return itemstack.getItemDamage() == 0 ? "Pump" :"Conderser";//itemstack.getItemDamage() == 4 ? "Condenser":"Unknown";
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(this, 1, 0));
//par3List.add(new ItemStack(this, 1, 4));
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "Machines";
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int blockID = par3World.getBlockId(par4, par5, par6);
spawnID = BasicPipesMain.machineID;
if (blockID == Block.snow.blockID)
{
par7 = 1;
}
else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (BasicPipesMain.pipe.canPlaceBlockAt(par3World,par4,par5,par6))
{
Block var9 = Block.blocksList[this.spawnID];
par3World.editingBlocks = true;
int angle = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, var9.blockID,angle+itemStack.getItemDamage()))
{
if (par3World.getBlockId(par4, par5, par6) == var9.blockID)
{
Block.blocksList[this.spawnID].onBlockAdded(par3World, par4, par5, par6);
Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, player);
TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6);
}
--itemStack.stackSize;
par3World.editingBlocks = false;
return true;
}
}
par3World.editingBlocks = false;
return false;
}
}

View file

@ -1,126 +0,0 @@
package basicpipes.machines;
import java.util.List;
import basicpipes.BasicPipesMain;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
public class ItemValve extends ItemBlock
{
int index = 26;
private int spawnID;
public ItemValve(int id)
{
super(id);
this.setMaxDamage(0);
this.setHasSubtypes(true);
this.setIconIndex(10);
this.setItemName("Machine");
this.setCreativeTab(CreativeTabs.tabRedstone);
}
@Override
public int getIconFromDamage(int par1)
{
return par1+index;
}
@Override
public String getItemNameIS(ItemStack itemstack)
{
return itemstack.getItemDamage() == 0 ? "Pump" :"Conderser";//itemstack.getItemDamage() == 4 ? "Condenser":"Unknown";
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(this, 1, 0));
par3List.add(new ItemStack(this, 1, 4));
}
public String getTextureFile() {
return BasicPipesMain.textureFile+"/Items.png";
}
@Override
public String getItemName()
{
return "Machines";
}
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int blockID = par3World.getBlockId(par4, par5, par6);
spawnID = BasicPipesMain.valveID;
if (blockID == Block.snow.blockID)
{
par7 = 1;
}
else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (BasicPipesMain.pipe.canPlaceBlockAt(par3World,par4,par5,par6))
{
Block var9 = Block.blocksList[this.spawnID];
par3World.editingBlocks = true;
int angle = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, var9.blockID,angle+itemStack.getItemDamage()))
{
if (par3World.getBlockId(par4, par5, par6) == var9.blockID)
{
Block.blocksList[this.spawnID].onBlockAdded(par3World, par4, par5, par6);
Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, player);
TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6);
}
--itemStack.stackSize;
par3World.editingBlocks = false;
return true;
}
}
par3World.editingBlocks = false;
return false;
}
}

View file

@ -1,110 +0,0 @@
package basicpipes.machines;
import universalelectricity.implement.IElectricityReceiver;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.Liquid;
public class TileEntityCondenser extends TileEntity implements ILiquidProducer, IElectricityReceiver {
int tickCount = 0;
int waterStored = 0;
int energyStored = 0;
@Override
public int onProduceLiquid(Liquid type,int maxVol, ForgeDirection side) {
if(type == Liquid.WATER)
{
int tradeW = Math.min(maxVol, waterStored);
waterStored -= tradeW;
return tradeW;
}
return 0;
}
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("energyStored", (int)this.energyStored);
par1NBTTagCompound.setInteger("waterStored", (int)this.waterStored);
}
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.energyStored = par1NBTTagCompound.getInteger("energyStored");
this.waterStored = par1NBTTagCompound.getInteger("waterStored");
}
public void updateEntity()
{
if(energyStored > 100 && waterStored < 3)
{
energyStored -= 100;
waterStored += 1;
}
}
@Override
public boolean canProduceLiquid(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return true;
}
return false;
}
@Override
public void onDisable(int duration) {
// TODO Auto-generated method stub
}
@Override
public boolean isDisabled() {
// TODO Auto-generated method stub
return false;
}
@Override
public double wattRequest() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canReceiveFromSide(ForgeDirection side) {
// TODO Auto-generated method stub
return false;
}
@Override
public int presureOutput(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return 32;
}
return 0;
}
@Override
public boolean canProducePresure(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return true;
}
return false;
}
@Override
public boolean canConnect(ForgeDirection side) {
// TODO Auto-generated method stub
return true;
}
@Override
public double getVoltage() {
// TODO Auto-generated method stub
return 120;
}
@Override
public void onReceive(TileEntity sender, double amps, double voltage,
ForgeDirection side) {
// TODO Auto-generated method stub
}
}

View file

@ -1,140 +0,0 @@
package basicpipes.machines;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.implement.IElectricityReceiver;
import universalelectricity.prefab.TileEntityElectricityReceiver;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
public class TileEntityPump extends TileEntityElectricityReceiver implements ILiquidProducer,IElectricityReceiver {
int dCount = 0;
float eStored = 0;
float eMax = 2000;
int lStored = 0;
int wMax = 10;
public Liquid type = Liquid.DEFUALT;
public TileEntity[] sList = {null,null,null,null,null,null};
private int count = 0;
@Override
public void onDisable(int duration) {
dCount = duration;
}
@Override
public boolean isDisabled() {
if(dCount <= 0)
{
return false;
}
return true;
}
@Override
public void updateEntity() {
super.updateEntity();
if(count++ >= 40)
{
count = 0;
sList = MHelper.getSourounding(worldObj,xCoord, yCoord, zCoord);
int bBlock = worldObj.getBlockId(xCoord, yCoord -1, zCoord);
Liquid bellow = Liquid.getLiquidByBlock(bBlock);
if(bellow != null && this.lStored <= 0)
{
this.type = bellow;
}
//eStored+=200;
if(!worldObj.isRemote)
{
if(bBlock == type.Still && this.eStored >= 200 && this.lStored < this.wMax)
{
eStored -= 200;
lStored += 1;
worldObj.setBlockAndMetadataWithNotify(xCoord, yCoord-1, zCoord, 0, 0);
}
}
}
}
@Override
public boolean canReceiveFromSide(ForgeDirection side) {
if(side != ForgeDirection.DOWN)
{
return true;
}
return false;
}
@Override
public int onProduceLiquid(Liquid type, int maxVol, ForgeDirection side) {
if(type == this.type && lStored > 0)
{
lStored -= 1;
return 1;
}
return 0;
}
@Override
public boolean canProduceLiquid(Liquid type, ForgeDirection side) {
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
int facing = 0;
switch(meta)
{
case 0: facing = 2;break;
case 1: facing = 5;break;
case 2: facing = 3;break;
case 3: facing = 4;break;
}
if(type == this.type && side != ForgeDirection.DOWN && side != ForgeDirection.UP && side != ForgeDirection.getOrientation(facing).getOpposite())
{
return true;
}
return false;
}
@Override
public int presureOutput(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return 32;
}else
if(type == Liquid.LAVA)
{
return 10;
}else
if(type == this.type)
{
return 50;
}
return 0;
}
@Override
public boolean canProducePresure(Liquid type, ForgeDirection side) {
if(type == this.type)
{
return true;
}
return false;
}
@Override
public void onReceive(TileEntity sender, double watts, double voltage,
ForgeDirection side) {
if (wattRequest() > 0 && canConnect(side))
{
float rejectedElectricity = (float) Math.max((this.eStored + watts) - this.eMax, 0.0);
this.eStored = (float) Math.max(this.eStored + watts - rejectedElectricity, 0.0);
}
}
@Override
public double wattRequest() {
return Math.max(eMax - eStored,0);
}
}

View file

@ -1,109 +0,0 @@
package basicpipes.machines;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.pipes.api.ILiquidConsumer;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
public class TileEntityValve extends TileEntity implements ILiquidConsumer {
Liquid type = Liquid.DEFUALT;
int liquidStored = 0;
int lMax = 1;
int tickCount = 0;
TileEntity[] connected = {null,null,null,null,null,null};
boolean on = false;
@Override
public void updateEntity()
{
tickCount++;
if(tickCount >= 10)
{
int deltaX = 0;
int deltaZ = 0;
int deltaY = 0;
int facing = 0;
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if(meta == 0 && meta == 8)
{
facing = 2;
}
if(meta == 1 && meta == 9)
{
facing = 5;
}
if(meta == 2 && meta == 10)
{
facing = 3;
}
if(meta == 3 && meta == 11)
{
facing = 4;
}
if((meta > 3 && meta < 8)&&(meta> 11 && meta < 16))
{
facing = 0;
}
switch(facing)
{
case 0: deltaY++;break;
case 1: deltaY--;break;
case 2: deltaZ--;break;
case 5: deltaZ++;break;
case 3: deltaX--;break;
case 4: deltaX++;break;
}
connected = MHelper.getSourounding(worldObj,xCoord, yCoord, zCoord);
for(int i = 0;i<6;i++)
{
if(!(connected[i] instanceof TileEntityPipe))
{
connected[i] = null;
}
}
if(!worldObj.isRemote)
{
//TODO send packet
}
tickCount = 0;
}
}
@Override
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side) {
if(this.type == Liquid.DEFUALT)
{
this.type = type;
}
return vol;
}
@Override
public boolean canRecieveLiquid(Liquid type, ForgeDirection forgeDirection) {
if(type == this.type)
{
return true;
}
return false;
}
@Override
public int getStoredLiquid(Liquid type) {
if(type == this.type)
{
return liquidStored;
}
return 0;
}
@Override
public int getLiquidCapacity(Liquid type) {
if(type == this.type)
{
return lMax;
}
return 0;
}
}

View file

@ -1,21 +0,0 @@
[
{
"modid": "basicPipes",
"name": "Basic Pipes",
"description": "Simple liquid pumping & storage system for UE based mods. Can pump several types of common liquids including water,lava,oil,and Fuel.",
"version": "1.9",
"mcversion": "1.3.2",
"url": "http://www.minecraftforge.net/forum/index.php/topic,604.0.html",
"updateUrl": "",
"authors": [
"DarkGuardsman"
],
"credits": "Created by Darkguardsman; Vector/network code from Calclavia; Some Textures thanks to Atrain;",
"logoFile": "",
"screenshots": [
],
"parent":"",
"dependencies": ["UE"
]
}
]

View file

@ -1,26 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
public class Beam {
//might need a more complex system for this later but for now this will work
public int intensity; //Beam intensity level
public boolean light; //Can prodcue light, might use this later
public ForgeDirection movDir; //Used to find the beams current direction
public Beam()
{
this(0,false,ForgeDirection.UNKNOWN);
}
Beam(int i, boolean light, ForgeDirection dir)
{
intensity = i;
this.light = light;
movDir = dir;
}
public static int getBeamLevel(Beam beam)
{
return beam.intensity;
}
}

View file

@ -1,26 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
public interface IBeamProducer {
/**
* onProduceLiquid
* block.
* @param type - the type of liquid
* @param regInt - requested beam intensity
* @param side - The side
* @return New Beam - Return a vol of liquid type that is produced
*/
public int createNewBeam(int type, int reqInt, ForgeDirection side);
/**
* canProduceLiquid
* block.
* @param type - the type of liquid
* @param side - The side
* @return boolean - True if can, false if can't produce liquid of type or on that side
* Also used for connection rules of pipes'
*/
public boolean canCreateBeam(int type, ForgeDirection side);
}

View file

@ -1,16 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
public interface IHeatProducer
{
/**
* onProduceElectricity is called when a conductor is connected to the producer block in which the conductor will demand power from the producer
* block.
* @param jouls - The maximum jouls can be transfered
* @param up - The side of block in which the conductor is on
* @return jouls - Return jouls to consumer
*/
public float onProduceHeat(float jouls, ForgeDirection up);
}

View file

@ -1,39 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
/**
* Based off of Calclavia's old wire API
* @author DarkGuardsman
*
*/
public interface ILiquidConsumer
{
/**
* onRecieveLiquid
* @param vol - The amount this block received.
* @param side - The side of the block in which the liquid came from.
* @parm type - The type of liquid being received
* @return vol - The amount liquid that can't be recieved
*/
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side);
/**
* You can use this to check if a pipe can connect to this liquid consumer to properly render the graphics
* @param forgeDirection - The side in which the volume is coming from.
* @parm type - The type of liquid
* @return Returns true or false if this consumer can receive a volume at this given tick or moment.
*/
public boolean canRecieveLiquid(Liquid type, ForgeDirection forgeDirection);
/**
* @return Return the stored liquid of type in this consumer.
*/
public int getStoredLiquid(Liquid type);
/**
* @return Return the maximum amount of stored liquid this consumer can get.
*/
public int getLiquidCapacity(Liquid type);
}

View file

@ -1,38 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
/**
* Based off of Calclavia's old wire API
* @author DarkGuardsman
*
*/
public interface ILiquidProducer
{
/**
* onProduceLiquid
* block.
* @param type - the type of liquid
* @param maxvol - The maximum vol or requested volume
* @param side - The side
* @return vol - Return a vol of liquid type that is produced
*/
public int onProduceLiquid(Liquid type, int maxVol, ForgeDirection side);
/**
* canProduceLiquid
* block.
* @param type - the type of liquid
* @param side - The side
* @return boolean - True if can, false if can't produce liquid of type or on that side
* Also used for connection rules of pipes'
*/
public boolean canProduceLiquid(Liquid type, ForgeDirection side);
public boolean canProducePresure(Liquid type, ForgeDirection side);
/**
*
* @param type - liquid type
* @param side - side this of presure
* @return pressure that is used to output liquid on
*/
public int presureOutput(Liquid type, ForgeDirection side);
}

View file

@ -1,36 +0,0 @@
package basicpipes.pipes.api;
import net.minecraftforge.common.ForgeDirection;
// mechanical
public interface IMechanical {
/**
*
* @param side the rpm is coming from
* @return rpm that the block is running at
*/
public int getForceSide(ForgeDirection side);
public int getForce();
/**
*
* @param side
* @return if mechanical force can be outputed from this side
*/
public boolean canOutputSide(ForgeDirection side);
/**
*
* @param side
* @return if mechanical force can be inputed from this side
*/
public boolean canInputSide(ForgeDirection side);
/**
*
* @param RPM being applied to this machine
* @return the rpm after the load has been applied
*/
public int applyForce(int force);
/**
* not required but is handy to get animation position of some mechanical block
* @return int between 0 -7
*/
public int getAnimationPos();
}

View file

@ -1,5 +0,0 @@
package basicpipes.pipes.api;
public interface IStorageTank extends ILiquidConsumer {
}

View file

@ -1,64 +0,0 @@
package basicpipes.pipes.api;
import net.minecraft.src.Block;
/**
* System too easily reference a liquid type and its info
* @author Rseifert
*
*/
public enum Liquid {
// -1 == null || unused
STEAM("Steam",false,true,-1,-1,100),
WATER("Water",false,false,Block.waterStill.blockID,Block.waterMoving.blockID,32),
LAVA("Lava",false,false,Block.lavaStill.blockID,Block.lavaMoving.blockID,20),
OIL("Oil",true,false,-1,-1,32),//BasicComponents.oilStill.blockID,BasicComponents.oilMoving.blockID),
Fuel("Fuel",true,false,-1,-1,40),
Air("Air",false,true,0,-1,100),
Methain("Methain",true,true,-1,-1,100),
BioFuel("BioFuel",true,false,-1,-1,40),
Coolent("Coolent",false,false,-1,-1,40),
NukeWaste("NukeWaste",false,false,-1,-1,20),
Ether("Ether",false,false,-1,-1,100),
DEFUALT("Empty",false,false,-1,-1,0);
public final boolean flamable;//can it catch on fire, not used but might be
public final boolean isGas;//is it a gas, used to find if it floats
public final int Still;//if there is a block of still liquid linked to this
public final int Moving;//if there is a block of moving liquid linked to this
public final String lName;//Default name for the liquid
public final int defaultPresure;//default pressure output of the liquid
private Liquid(String name,boolean flame,boolean gas,int block, int Moving,int dPressure)
{
this.flamable = flame;
this.isGas = gas;
this.Still = block;
this.Moving = Moving;
this.lName = name;
this.defaultPresure = dPressure;
}
/**
* Only use this if you are converting from the old system
* Or have a special need for it
* @param id of liquid
* @return Liquid Object
*/
public static Liquid getLiquid(int id)
{
if (id >= 0 && id < Liquid.values().length)
{
return Liquid.values()[id];
}
return DEFUALT;
}
public static Liquid getLiquidByBlock(int bBlock) {
for(int i = 0; i < Liquid.values().length;i++)
{
Liquid selected = Liquid.getLiquid(i);
if(bBlock == selected.Still)
{
return selected;
}
}
return Liquid.DEFUALT;
}
}

View file

@ -1,125 +0,0 @@
package basicpipes.pipes.api;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import net.minecraftforge.common.ForgeDirection;
public class MHelper {
/**
* you will have to tell your TileEntity to trade up if liquid or down if gas. I suggest having your onRecieveLiquid
* pump liquid one block up if you block is full.
* @param entity - entity at center of search
* @return an Array containing TileEntities around the TileEntity
*/
public static TileEntity[] getSourounding(World world, int x, int y, int z)
{
TileEntity[] list = new TileEntity[]{null,null,null,null,null,null};
for(int i =0; i< 6;i++)
{
ForgeDirection d = ForgeDirection.getOrientation(i);
TileEntity aEntity = world.getBlockTileEntity(x+d.offsetX, y+d.offsetY, z+d.offsetZ);
if(aEntity instanceof TileEntity)
{
list[i] = aEntity;
}
}
return list;
}
/**
* Used to help trade liquid without having to do too much work
* @param blockEntity - tile entity trading the liquid
* @param type - liquid type being traded
* @param vol - the volume to be traded
* @return the remaining untraded liquid
*/
public static int shareLiquid(World world, int x, int y, int z,int vol,int max, Liquid type)
{
TileEntity ent = world.getBlockTileEntity(x, y, z);
int currentVol = vol;
int tCount = 1;
boolean rise = type.isGas;
if(currentVol <= 0)
{
return 0;
}
ForgeDirection st = ForgeDirection.getOrientation(rise ? 1 : 0);
TileEntity first = world.getBlockTileEntity(x+st.offsetX, y+st.offsetY, z+st.offsetZ);
//trades to the first, bottom for liquid, top for gas
if(first instanceof IStorageTank && currentVol > 0 && ((IStorageTank) first).getStoredLiquid(type) < ((IStorageTank) first).getLiquidCapacity(type))
{
currentVol = ((ILiquidConsumer) first).onReceiveLiquid(type, currentVol, st);
}
int vAve = currentVol;
TileEntity[] TeA = MHelper.getSourounding(world,x,y,z);
for(int i = 2; i < 6; i++)
{
if(TeA[i] instanceof IStorageTank)
{
vAve += ((IStorageTank)TeA[i]).getStoredLiquid(type);
tCount++;
}
}
vAve = (int)(vAve/tCount);
//trades to side if anything is left
for(int i = 2; i < 6;i++)
{
ForgeDirection side = ForgeDirection.getOrientation(i);
TileEntity sSide = world.getBlockTileEntity(x+side.offsetX, y+side.offsetY, z+side.offsetZ);
if(currentVol <= 0 || currentVol <= vAve)
{
break;
}
if(sSide instanceof IStorageTank &&((IStorageTank) sSide).getStoredLiquid(type) < vAve)
{
int tA = vAve -Math.max((vAve - currentVol), 0);
currentVol = ((ILiquidConsumer) sSide).onReceiveLiquid(type, tA, st) -tA + currentVol;
}
}
//trades to the opposite of the first if anything is left
/**
* need to find a way to solve it just trading back the ammount on next cycle
if(currentVol > 0)
{
TileEntity last = world.getBlockTileEntity(x+st.getOpposite().offsetX, y+st.getOpposite().offsetY, z+st.getOpposite().offsetZ);
if(last instanceof IStorageTank && currentVol == max)
{
currentVol = ((ILiquidConsumer) last).onReceiveLiquid(type, max/10, st.getOpposite()) + currentVol -(max/10);
}
}
*/
return Math.max(currentVol,0);
}
/**
*
* @param entity - entity in question
* @return 1-4 if corner 0 if not a corner
* you have to figure out which is which depending on what your using this for
* 1 should be north east 2 south east
*/
public static int corner(TileEntity entity)
{
TileEntity[] en = getSourounding(entity.worldObj, entity.xCoord,entity.yCoord,entity.zCoord);
if(en[4] != null && en[2] != null && en[5] == null && en[3] == null)
{
return 3;
}
if(en[2] != null && en[5] != null && en[3] == null && en[4] == null)
{
return 4;
}
if(en[5] != null && en[3] != null && en[4] == null && en[2] == null)
{
return 1;
}
if(en[3] != null && en[4] != null && en[2] == null && en[5] == null)
{
return 2;
}
return 0;
}
}

View file

@ -1,17 +0,0 @@
[
{
"modid": "mcp",
"name": "Minecraft Coder Pack",
"description": "Modding toolkit to decompile and deobfuscate the Minecraft client and server files.",
"version": "7.19",
"mcversion": "1.4.2",
"logoFile": "/mcp.png",
"url": "http://mcp.ocean-labs.de/",
"updateUrl": "",
"authors": ["Searge", "ProfMobius", "IngisKahn", "Fesh0r", "ZeuX", "R4wk", "Others"],
"credits": "Made by the MCP team",
"parent": "",
"screenshots": [],
"dependencies": []
}
]

View file

@ -1,239 +0,0 @@
package steampower;
import java.util.Random;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.MathHelper;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import steampower.boiler.TileEntityBoiler;
import steampower.burner.TileEntityFireBox;
public class BlockMachine extends universalelectricity.prefab.BlockMachine
{
private Random mRandom = new Random();
private static boolean keepFurnaceInventory = true;
public BlockMachine(int par1)
{
super("machine", par1, Material.iron);
this.setRequiresSelfNotify();
this.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(1f);
this.setResistance(3f);
}
@Override
public int damageDropped(int metadata)
{
return metadata;
}
@Override
public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random)
{
TileEntity tileEntity = par1World.getBlockTileEntity(x, y, z);
if(tileEntity instanceof TileEntityFireBox)
{
if(((TileEntityFireBox)tileEntity).generateRate > 0)
{
int var6 = ((TileEntityFireBox) tileEntity).getDirection();
float var7 = (float)x + 0.5F;
float var8 = (float)y + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
float var9 = (float)z + 0.5F;
float var10 = 0.52F;
float var11 = par5Random.nextFloat() * 0.6F - 0.3F;
if (var6 == 4)
{
par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 2)
{
par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 1)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
}
else if (var6 == 3)
{
par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
}
}
}
}
@Override
public boolean onUseWrench(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
TileEntityMachine tileEntity = (TileEntityMachine)par1World.getBlockTileEntity(par2, par3, par4);
//Reorient the block
switch(tileEntity.getDirection())
{
case 1: tileEntity.setDirection(2); break;
case 2: tileEntity.setDirection(3); break;
case 3: tileEntity.setDirection(4); break;
case 4: tileEntity.setDirection(1); break;
}
return true;
}
/**
* Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the
* block.
*/
@Override
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
else
{
TileEntity blockEntity = (TileEntity)par1World.getBlockTileEntity(x, y, z);
if (blockEntity != null)
{
if(blockEntity instanceof TileEntityBoiler)
{
TileEntity var6 = (TileEntityBoiler)par1World.getBlockTileEntity(x, y, z);
par5EntityPlayer.openGui(SteamPowerMain.instance, 1, par1World, x, y, z);
}
if(blockEntity instanceof TileEntityFireBox)
{
TileEntity var6 = (TileEntityFireBox)par1World.getBlockTileEntity(x, y, z);
par5EntityPlayer.openGui(SteamPowerMain.instance, 0, par1World, x, y, z);
}
}
return true;
}
}
@Override
public TileEntity createNewTileEntity(World var1,int meta)
{
switch(meta)
{
case 1: return new TileEntityBoiler();
case 2: return new TileEntityFireBox();
case 3: return new TileEntityFireBox();
case 4: return new TileEntityFireBox();
case 5: return new TileEntityFireBox();
}
return null;
}
/**
* Called when the block is placed in the world.
*/
@Override
public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLiving par5EntityLiving)
{
int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int metadata = par1World.getBlockMetadata(x, y, z);
TileEntityMachine tileEntity = (TileEntityMachine)par1World.getBlockTileEntity(x, y, z);
switch (angle)
{
case 0: tileEntity.setDirection(1); break;
case 1: tileEntity.setDirection(2); break;
case 2: tileEntity.setDirection(3); break;
case 3: tileEntity.setDirection(4); break;
}
}
/**
* Called whenever the block is removed.
*/
@Override
public void breakBlock(World par1World, int par2, int par3, int par4,int par5, int par6){
if (!keepFurnaceInventory)
{
TileEntityMachine var5 = null;
TileEntity entityBox = par1World.getBlockTileEntity(par2, par3, par4);
if(entityBox instanceof TileEntityFireBox)
{
var5 = (TileEntityFireBox)entityBox;
}
else if(entityBox instanceof TileEntityBoiler)
{
var5 = (TileEntityBoiler)entityBox;
}
if (var5 != null)
{
for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6)
{
ItemStack var7 = var5.getStackInSlot(var6);
if (var7 != null)
{
float var8 = this.mRandom.nextFloat() * 0.8F + 0.1F;
float var9 = this.mRandom.nextFloat() * 0.8F + 0.1F;
float var10 = this.mRandom.nextFloat() * 0.8F + 0.1F;
while (var7.stackSize > 0)
{
int var11 = this.mRandom.nextInt(21) + 10;
if (var11 > var7.stackSize)
{
var11 = var7.stackSize;
}
var7.stackSize -= var11;
EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage()));
if (var7.hasTagCompound())
{
var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy());
}
float var13 = 0.05F;
var12.motionX = (double)((float)this.mRandom.nextGaussian() * var13);
var12.motionY = (double)((float)this.mRandom.nextGaussian() * var13 + 0.2F);
var12.motionZ = (double)((float)this.mRandom.nextGaussian() * var13);
par1World.spawnEntityInWorld(var12);
}
}
}
}
}
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
@Override
public String getTextureFile()
{
return "/EUIClient/textures/blocks/blocks.png";
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int getRenderType()
{
return ItemRenderHelperS.renderID;
}
}

View file

@ -1,47 +0,0 @@
package steampower;
import net.minecraft.src.Container;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Slot;
import net.minecraft.src.TileEntity;
public class ContainerFake extends Container
{
private IInventory tileEntity;
public ContainerFake(InventoryPlayer par1InventoryPlayer, IInventory tileEntity)
{
this.tileEntity = tileEntity;
// this.addSlotToContainer(new Slot(tileEntity, 0, 33, 34));
int var3;
for (var3 = 0; var3 < 3; ++var3)
{
for (int var4 = 0; var4 < 9; ++var4)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
}
}
for (var3 = 0; var3 < 9; ++var3)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
}
}
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
}
/**
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
public ItemStack transferStackInSlot(int par1)
{
return null;
}
}

View file

@ -1,65 +0,0 @@
package steampower;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.src.*;
public class ItemMachine extends ItemBlock {
public ItemMachine(int id) {
super(id);
setMaxDamage(0);
setHasSubtypes(true);
this.setIconIndex(21);
this.setCreativeTab(CreativeTabs.tabBlock);
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(this, 1, 1));
par3List.add(new ItemStack(this, 1, 2));
}
@Override
public String getTextureFile() {
// TODO Auto-generated method stub
return SteamPowerMain.textureFile+"Items.png";
}
@Override
public int getIconFromDamage(int par1)
{
switch(par1)
{
case 1: return 23;
case 2: return 22;
case 15: return 25;
}
return this.iconIndex+par1;
}
@Override
public int getMetadata(int metadata)
{
return metadata;
}
@Override
public String getItemName()
{
return "Machine";
}
@Override
public String getItemNameIS(ItemStack par1ItemStack)
{
int var3 = par1ItemStack.getItemDamage();
switch(var3)
{
case 0: return "CoalProcessor";
case 1: return "Boiler";
case 2: return "FireBox";
case 3: return "SteamGen";
case 15: return "EnergyNuller";
}
return this.getItemName();
}
}

View file

@ -1,153 +0,0 @@
package steampower;
import java.io.File;
import net.minecraft.src.Block;
import net.minecraft.src.CraftingManager;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.ShapedOreRecipe;
import steampower.turbine.BlockGenerator;
import steampower.turbine.BlockSteamPiston;
import steampower.turbine.ItemEngine;
import steampower.turbine.TileEntitytopGen;
import universalelectricity.prefab.network.PacketManager;
import basicpipes.BasicPipesMain;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "SteamPower", name = "Steam Power", version = "1.9", dependencies = "after:basicPipes")
@NetworkMod(channels = { "SPpack" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketManager.class)
public class SteamPowerMain {
static Configuration config = new Configuration((new File(
cpw.mods.fml.common.Loader.instance().getConfigDir(),
"/UniversalElectricity/SteamPower.cfg")));
private static int BlockID = configurationProperties();
public static int EngineItemID;
public static int EngineID;
public static int genID;
public static int genOutput;
public static int steamOutBoiler;
public static int pipeLoss;
public static int boilerHeat;
public static int fireOutput;
public static final String channel = "SPpack";
public static Block machine = new BlockMachine(BlockID)
.setBlockName("machine");
public static Block engine = new BlockSteamPiston(EngineID)
.setBlockName("SteamEngien");
public static Block gen = new BlockGenerator(genID).setBlockName("ElecGen");
public static Item itemEngine = new ItemEngine(EngineItemID)
.setItemName("SteamEngine");
public static SteamPowerMain instance;
@SidedProxy(clientSide = "steampower.SteamClientProxy", serverSide = "steampower.SteamProxy")
public static SteamProxy proxy;
public static String textureFile = "/textures/";
public static int configurationProperties() {
config.load();
BlockID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"MachinesID", 3030).value);
EngineItemID = Integer.parseInt(config.get(Configuration.CATEGORY_ITEM,
"EngineItem", 30308).value);
EngineID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"SteamEngineID", 3031).value);
genID = Integer.parseInt(config.get(Configuration.CATEGORY_BLOCK,
"ElecGenID", 3032).value);
genOutput = Integer.parseInt(config.get(Configuration.CATEGORY_GENERAL,
"genOutputWattsmax", 1000).value);
steamOutBoiler = Integer.parseInt(config.get(
Configuration.CATEGORY_GENERAL, "steamOutPerCycle", 10).value);
boilerHeat = Integer.parseInt(config.get(
Configuration.CATEGORY_GENERAL, "boilerInKJNeed", 4500).value);
fireOutput = Integer.parseInt(config.get(
Configuration.CATEGORY_GENERAL, "fireBoxOutKJMax", 250).value);
config.save();
return BlockID;
}
@PreInit
public void preInit(FMLPreInitializationEvent event) {
instance = this;
NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
proxy.preInit();
GameRegistry.registerBlock(machine, ItemMachine.class);
GameRegistry.registerBlock(engine);
GameRegistry.registerBlock(gen);
}
@Init
public void load(FMLInitializationEvent evt) {
proxy.init();
GameRegistry.registerTileEntity(TileEntitytopGen.class, "gentop");
// Names...............
LanguageRegistry.addName((new ItemStack(machine, 1, 1)), "Boiler");
LanguageRegistry.addName((new ItemStack(gen, 1, 0)), "Generator");
LanguageRegistry.addName((new ItemStack(machine, 1, 2)), "FireBox");
LanguageRegistry.addName((new ItemStack(itemEngine, 1, 0)),
"SteamPiston");
}
@PostInit
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit();
// Crafting
try {
CraftingManager
.getInstance()
.getRecipeList()
.add(new ShapedOreRecipe(new ItemStack(gen, 1),
new Object[] { "@T@", "OVO", "@T@", 'T',
new ItemStack(BasicPipesMain.rod, 1), '@',
"plateSteel", 'O', "basicCircuit", 'V',
"motor" }));
/**
* TileEntityBoiler();<- metadata 1 TileEntityFireBox();<-metadata
* 2-5
*/
CraftingManager
.getInstance()
.getRecipeList()
.add(new ShapedOreRecipe(new ItemStack(machine, 1, 1),
new Object[] { "TT", "VV", "TT", 'T',
new ItemStack(BasicPipesMain.parts, 1, 6),
'V',
new ItemStack(BasicPipesMain.parts, 1, 7) }));
CraftingManager
.getInstance()
.getRecipeList()
.add(new ShapedOreRecipe(new ItemStack(machine, 1, 2),
new Object[] { "@", "F", 'F', Block.stoneOvenIdle,
'@', "plateSteel" }));
CraftingManager
.getInstance()
.getRecipeList()
.add(new ShapedOreRecipe(new ItemStack(itemEngine, 1, 0),
new Object[] { "GGG", "VPV", "@T@", 'T',
new ItemStack(BasicPipesMain.parts, 1, 1),
'G', BasicPipesMain.rod, '@', "plateSteel",
'P', Block.pistonBase, 'V',
new ItemStack(BasicPipesMain.parts, 1, 7),
'M', "motor" }));
} catch (Exception e) {
e.printStackTrace();
System.out.print("UE based recipes not loaded");
}
}
}

View file

@ -1,67 +0,0 @@
package steampower;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import steampower.boiler.TileEntityBoiler;
import steampower.burner.ContainerFireBox;
import steampower.burner.TileEntityFireBox;
import steampower.turbine.TileEntityGen;
import steampower.turbine.TileEntitySteamPiston;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
public class SteamProxy implements IGuiHandler{
public void preInit()
{
}
public void init()
{
GameRegistry.registerTileEntity(TileEntityBoiler.class, "boiler");
GameRegistry.registerTileEntity(TileEntityFireBox.class, "fireBox");
GameRegistry.registerTileEntity(TileEntitySteamPiston.class, "steamPiston");
GameRegistry.registerTileEntity(TileEntityGen.class, "elecGen");
}
public void postInit()
{
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity != null)
{
switch(ID)
{
case 0: return new GUIFireBox(player.inventory, ((TileEntityFireBox)tileEntity));
case 1: return new GuiBoiler(player.inventory, ((TileEntityBoiler)tileEntity));
case 2: return new GUISteamPiston(player.inventory, ((TileEntitySteamPiston)tileEntity));
}
}
return null;
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
if (tileEntity != null)
{
switch(ID)
{
case 0: return new ContainerFireBox(player.inventory, ((TileEntityFireBox)tileEntity));
default: return new ContainerFake(player.inventory, (IInventory) tileEntity);
}
}
return null;
}
}

View file

@ -1,220 +0,0 @@
package steampower;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.NBTTagList;
import net.minecraft.src.Packet;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
import universalelectricity.core.Vector3;
import universalelectricity.prefab.network.PacketManager;
public class TileEntityMachine extends TileEntity implements IInventory, ISidedInventory
{
public int facing = 0;
private int count = 0;
public ItemStack[] storedItems = new ItemStack[this.getInvSize()];
private int getInvSize() {
return 1;
}
public int getDirection()
{
return this.facing;
}
public void setDirection(int i)
{
this.facing = i;
}
@Override
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("facing", this.facing);
//inventory
NBTTagList var2 = new NBTTagList();
for (int var3 = 0; var3 < this.storedItems.length; ++var3)
{
if (this.storedItems[var3] != null)
{
NBTTagCompound var4 = new NBTTagCompound();
var4.setByte("Slot", (byte)var3);
this.storedItems[var3].writeToNBT(var4);
var2.appendTag(var4);
}
}
par1NBTTagCompound.setTag("Items", var2);
}
@Override
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
//inventory
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
this.storedItems = new ItemStack[this.getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3)
{
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
byte var5 = var4.getByte("Slot");
if (var5 >= 0 && var5 < this.storedItems.length)
{
this.storedItems[var5] = ItemStack.loadItemStackFromNBT(var4);
}
}
//vars
this.facing = par1NBTTagCompound.getInteger("facing");
}
@Override
public boolean canUpdate()
{
return true;
}
public Object[] getSendData()
{
return new Object[]{};
}
public boolean needUpdate()
{
return true;
}
@Override
public void updateEntity()
{
super.updateEntity();
if(count ++ >= 10 && !worldObj.isRemote && needUpdate())
{count = 0;
Packet packet = PacketManager.getPacket(SteamPowerMain.channel,this, getSendData());
PacketManager.sendPacketToClients(packet, worldObj, Vector3.get(this), 40);
}
}
//////////////////////////
//I Inventory shit
/////////////////////////
public int getSizeInventory()
{
return this.storedItems.length;
}
/**
* Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't
* this more of a set than a get?*
*/
public int getInventoryStackLimit()
{
return 64;
}
/**
* Do not make give this method the name canInteractWith because it clashes with Container
*/
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)
{
return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
}
/**
* Returns the stack in slot i
*/
public ItemStack getStackInSlot(int par1)
{
return this.storedItems[par1];
}
public ItemStack decrStackSize(int par1, int par2)
{
if (this.storedItems[par1] != null)
{
ItemStack var3;
if (this.storedItems[par1].stackSize <= par2)
{
var3 = this.storedItems[par1];
this.storedItems[par1] = null;
return var3;
}
else
{
var3 = this.storedItems[par1].splitStack(par2);
if (this.storedItems[par1].stackSize == 0)
{
this.storedItems[par1] = null;
}
return var3;
}
}
else
{
return null;
}
}
/**
* When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
* like when you close a workbench GUI.
*/
public ItemStack getStackInSlotOnClosing(int par1)
{
if (this.storedItems[par1] != null)
{
ItemStack var2 = this.storedItems[par1];
this.storedItems[par1] = null;
return var2;
}
else
{
return null;
}
}
/**
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
*/
public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
{
this.storedItems[par1] = par2ItemStack;
if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())
{
par2ItemStack.stackSize = this.getInventoryStackLimit();
}
}
@Override
public int getStartInventorySide(ForgeDirection side) {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getSizeInventorySide(ForgeDirection side) {
// TODO Auto-generated method stub
return 0;
}
@Override
public String getInvName() {
// TODO Auto-generated method stub
return "SteamMachine";
}
@Override
public void openChest() {
// TODO Auto-generated method stub
}
@Override
public void closeChest() {
// TODO Auto-generated method stub
}
}

View file

@ -1,249 +0,0 @@
package steampower.boiler;
import net.minecraft.src.Block;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import steampower.TileEntityMachine;
import universalelectricity.prefab.network.IPacketReceiver;
import basicpipes.pipes.api.IHeatProducer;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.IStorageTank;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityBoiler extends TileEntityMachine implements IPacketReceiver,ILiquidProducer, IStorageTank
{
public int steam = 0;
public int water = 0;
public int heat = 0;
public int hullHeat = 0;
public TileEntity[] connectedBlocks = {null,null,null,null,null,null};
public int tankCount = 0;
public int tickCount = 0;
//-----------------------------
//Update stuff
//-----------------------------
@Override
public void updateEntity()
{
//update connection list used for rendering
this.connectedBlocks = MHelper.getSourounding(worldObj,xCoord, yCoord, zCoord);
this.tankCount = 0;
for(int i =0; i < connectedBlocks.length; i++)
{
if(connectedBlocks[i] != null)
{
tankCount++;
}
}//end connection update
if(tickCount++ >= 10 && !worldObj.isRemote)
{
tickCount = 0;
TileEntity ent = worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord);
if(ent instanceof IHeatProducer)
{
this.heat = (int) Math.min(((IHeatProducer)ent).onProduceHeat(250, ForgeDirection.UP)+heat,2000);
}else
if(worldObj.getBlockId(xCoord, yCoord-1, zCoord) == Block.lavaStill.blockID)
{
this.heat = Math.min(90+heat,2000);
}
if(hullHeat < 10000)
{
int mHeat = 10000 - hullHeat;
int hHeat = mHeat - Math.max((mHeat - this.heat),0);
hullHeat = Math.min(hullHeat + hHeat,10000);
this.heat -=hHeat;
}else
{
if(heat >= 2000 && this.water >= 1 && this.steam < this.getLiquidCapacity(Liquid.STEAM))
{
this.water--;
this.steam = Math.min(this.steam +20,this.getLiquidCapacity(Liquid.STEAM));
this.heat -= 2000;
}
this.hullHeat-=5;
}
this.water = MHelper.shareLiquid(worldObj,xCoord, yCoord, zCoord,this.water,this.getLiquidCapacity(Liquid.WATER), Liquid.WATER);
this.steam = MHelper.shareLiquid(worldObj,xCoord, yCoord, zCoord,this.steam,this.getLiquidCapacity(Liquid.STEAM), Liquid.STEAM);
}
super.updateEntity();
}
//-----------------------------
//Liquid stuff
//-----------------------------
@Override
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side)
{
if(type == Liquid.WATER)
{
if(this.water < this.getLiquidCapacity(Liquid.WATER))
{
int rej = Math.max((this.water + vol) - this.getLiquidCapacity(Liquid.WATER), 0);
this.water += vol - rej;
return rej;
}
else
{
TileEntity te = worldObj.getBlockTileEntity(xCoord, yCoord+1, zCoord);
if( te instanceof IStorageTank)
{
return ((IStorageTank)te).onReceiveLiquid(type, vol, ForgeDirection.UNKNOWN);
}
}
}else
if(type == Liquid.STEAM)
{
if(this.steam < this.getLiquidCapacity(Liquid.STEAM))
{
int rej = Math.max((this.steam + vol) - this.getLiquidCapacity(Liquid.STEAM), 0);
this.steam += vol - rej;
return rej;
}
else
{
TileEntity te = worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord);
if( te instanceof IStorageTank)
{
return ((IStorageTank)te).onReceiveLiquid(type, vol, ForgeDirection.UNKNOWN);
}
}
}
return vol;
}
@Override
public boolean canRecieveLiquid(Liquid type, ForgeDirection s) {
if(type == Liquid.WATER)
{
return true;
}else
if(type == Liquid.STEAM && s == ForgeDirection.UNKNOWN)
{
return true;
}
return false;
}
@Override
public int getStoredLiquid(Liquid type) {
if(type == Liquid.WATER)
{
return this.water;
}else
if(type == Liquid.STEAM)
{
return this.steam;
}
return 0;
}
@Override
public int getLiquidCapacity(Liquid type) {
if(type == Liquid.WATER)
{
return 14;
}else
if(type == Liquid.STEAM)
{
return 140;
}
return 0;
}
@Override
public int onProduceLiquid(Liquid type, int vol, ForgeDirection side) {
if(type == Liquid.STEAM)
{
//TODO setup the actual math for this
if(vol < this.steam)
{
this.steam -= vol;
return vol;
}else
if(this.steam >= 1)
{
this.steam -= 1;
return 1;
}
}
return 0;
}
@Override
public boolean canProduceLiquid(Liquid type, ForgeDirection side) {
if(type == Liquid.STEAM)
{
return true;
}
return false;
}
@Override
public boolean canProducePresure(Liquid type, ForgeDirection side) {
if(type == Liquid.STEAM)
{
return true;
}
return false;
}
@Override
public int presureOutput(Liquid type, ForgeDirection side) {
if(type == Liquid.STEAM)
{
return 100;
}
return 0;
}
//-----------------------------
//Data
//-----------------------------
public Object[] getSendData()
{
return new Object[]{this.water,this.steam,this.heat,this.hullHeat};
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput dataStream) {
try{
this.water = dataStream.readInt();
this.steam = dataStream.readInt();
this.heat = dataStream.readInt();
this.hullHeat = dataStream.readInt();
}catch(Exception e)
{
e.printStackTrace();
}
}
@Override
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("water", this.water);
par1NBTTagCompound.setInteger("steam", this.steam);
par1NBTTagCompound.setInteger("heat", this.heat);
par1NBTTagCompound.setInteger("hullHeat", this.hullHeat);
}
@Override
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.water = par1NBTTagCompound.getInteger("water");
this.steam = par1NBTTagCompound.getInteger("steam");
this.heat = par1NBTTagCompound.getInteger("heat");
this.hullHeat = par1NBTTagCompound.getInteger("hullHeat");
}
}

View file

@ -1,42 +0,0 @@
package steampower.burner;
import net.minecraft.src.*;
public class ContainerFireBox extends Container
{
private TileEntityFireBox tileEntity;
public ContainerFireBox(InventoryPlayer par1InventoryPlayer, TileEntityFireBox tileEntity)
{
this.tileEntity = tileEntity;
this.addSlotToContainer(new Slot(tileEntity, 0, 33, 34));
int var3;
for (var3 = 0; var3 < 3; ++var3)
{
for (int var4 = 0; var4 < 9; ++var4)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
}
}
for (var3 = 0; var3 < 9; ++var3)
{
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
}
}
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
}
/**
* Called to transfer a stack from one inventory to the other eg. when shift clicking.
*/
public ItemStack transferStackInSlot(int par1)
{
return null;
}
}

View file

@ -1,214 +0,0 @@
package steampower.burner;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.ISidedInventory;
import steampower.SteamPowerMain;
import steampower.TileEntityMachine;
import steampower.boiler.TileEntityBoiler;
import universalelectricity.prefab.network.IPacketReceiver;
import basicpipes.pipes.api.IHeatProducer;
import basicpipes.pipes.api.MHelper;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityFireBox extends TileEntityMachine implements IPacketReceiver,IInventory, ISidedInventory, IHeatProducer
{
//max heat generated per second
public boolean isConnected = false;
public TileEntity[] connectedBlocks = {null, null, null, null, null, null};
private int connectedUnits = 0;
public static int maxGenerateRate = 250;
//Current generation rate based on hull heat. In TICKS.
public int generateRate = 0;
int count = 0;
public int itemCookTime = 0;
private int getInvSize() {
return 1;
}
public int getTickInterval()
{
return 5;
}
public boolean needUpdate()
{
return true;
}
public void updateEntity()
{
super.updateEntity();
if(count++ >= 10)
{
count = 0;
addConnection();
if(!worldObj.isRemote)
{
sharCoal();
}
TileEntity blockEntity = worldObj.getBlockTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
if(blockEntity instanceof TileEntityBoiler)
{
isConnected = true;
}
else
{
isConnected = false;
}
if (!this.worldObj.isRemote){
maxGenerateRate = SteamPowerMain.fireOutput + (connectedUnits*10);
//The top slot is for recharging items. Check if the item is a electric item. If so, recharge it.
if (this.storedItems[0] != null && isConnected)
{
if (this.storedItems[0].getItem().shiftedIndex == Item.coal.shiftedIndex)
{
if(this.itemCookTime <= 0)
{
itemCookTime = Math.max(1600 - (int)(this.generateRate*20), 400);
this.decrStackSize(0, 1);
}
}
}
}
//Starts generating electricity if the device is heated up
if (this.itemCookTime > 0)
{
this.itemCookTime --;
if(isConnected)
{
this.generateRate = Math.min(this.generateRate+Math.min((this.generateRate)+1, 1), this.maxGenerateRate/10);
}
}
//Loose heat when the generator is not connected or if there is no coal in the inventory.
if(this.itemCookTime <= 0 || !isConnected)
{
this.generateRate = Math.max(this.generateRate-5, 0);
}
}
}
//gets all connected fireBoxes and shares its supply of coal
public void sharCoal(){
for(int i =0; i<6;i++)
{
if(connectedBlocks[i] instanceof TileEntityFireBox)
{
TileEntityFireBox connectedConsumer = (TileEntityFireBox) connectedBlocks[i];
if(this.storedItems[0] != null)
{
if(this.storedItems[0].getItem().shiftedIndex == Item.coal.shiftedIndex && this.storedItems[0].stackSize > 0)
{
if(connectedConsumer.storedItems[0] != null)
{
if(connectedConsumer.storedItems[0].getItem().shiftedIndex == Item.coal.shiftedIndex)
{
if(connectedConsumer.storedItems[0].getItem().shiftedIndex == Item.coal.shiftedIndex)
{
int CSum = Math.round(this.storedItems[0].stackSize + connectedConsumer.storedItems[0].stackSize)/2;
if(this.storedItems[0].stackSize > connectedConsumer.storedItems[0].stackSize)
{
int transferC = 0;
transferC = Math.round(CSum - connectedConsumer.storedItems[0].stackSize);
connectedConsumer.storedItems[0].stackSize = connectedConsumer.storedItems[0].stackSize + transferC;
this.storedItems[0].stackSize = this.storedItems[0].stackSize - transferC;
}
}
}
}
else
{
connectedConsumer.storedItems[0] = new ItemStack(this.storedItems[0].getItem(),1,this.storedItems[0].getItemDamage());
this.storedItems[0].stackSize -= 1;
}
}
}
}
}
}
public void addConnection()
{
connectedUnits = 0;
TileEntity[] aEntity = MHelper.getSourounding(worldObj,xCoord, yCoord, zCoord);
for(int i = 0; i<6; i++)
{
if(aEntity[i] instanceof TileEntityFireBox && i != 0 && i != 1)
{
this.connectedBlocks[i] = aEntity[i];
connectedUnits += 1;
}
else
{
this.connectedBlocks[i] = null;
}
}
}
/**
* Reads a tile entity from NBT.
*/
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.itemCookTime = par1NBTTagCompound.getInteger("itemCookTime");
this.generateRate = par1NBTTagCompound.getInteger("generateRate");
}
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("itemCookTime", (int)this.itemCookTime);
par1NBTTagCompound.setInteger("generateRate", (int)this.generateRate);
}
@Override
public String getInvName() {
return "FireBox";
}
public float onProduceHeat(float jouls, ForgeDirection side) {
if(side == ForgeDirection.UP)
{
return Math.min(generateRate,jouls);
}
return 0;
}
@Override
public Object[] getSendData()
{
return new Object[]{(int)facing,(int)connectedUnits,(int)generateRate,(int)itemCookTime};
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput dataStream) {
try
{
facing = dataStream.readInt();
connectedUnits = dataStream.readInt();
generateRate = dataStream.readInt();
itemCookTime = dataStream.readInt();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

View file

@ -1,21 +0,0 @@
[
{
"modid": "SteamPower",
"name": "Steam Power",
"description": "Basic power plant package for Universal Electricity. Power system is based on steam and works with any heat source. Current heat sources lava, and fireBox Furnace",
"version": "1.8",
"mcversion": "1.3.2",
"url": "http://www.minecraftforge.net/forum/index.php/topic,222.0.html",
"updateUrl": "",
"authors": [
"DarkGuardsman"
],
"credits": "Created by Darkguardsman; Vector/network code from Calclavia; Some Models thanks to Azkhare;",
"logoFile": "",
"screenshots": [
],
"parent":"",
"dependencies": ["UE","BasicPipes"
]
}
]

View file

@ -1,68 +0,0 @@
package steampower.turbine;
import java.util.ArrayList;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import steampower.ItemRenderHelperS;
public class BlockGenerator extends universalelectricity.prefab.BlockMachine {
public BlockGenerator(int id) {
super("Generator", id, Material.iron);
this.setCreativeTab(CreativeTabs.tabBlock);
}
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this, 1, 0));
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z,
EntityLiving par5EntityLiving) {
int angle = MathHelper
.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
world.setBlockAndMetadataWithUpdate(x, y, z, blockID, angle, true);
}
@Override
public boolean onUseWrench(World par1World, int x, int y, int z,
EntityPlayer par5EntityPlayer) {
int angle = MathHelper
.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int metadata = par1World.getBlockMetadata(x, y, z);
if (metadata < 3) {
par1World.setBlockAndMetadata(x, y, z, blockID, metadata + angle);
} else {
par1World.setBlockAndMetadata(x, y, z, blockID, 0);
}
return true;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType() {
return ItemRenderHelperS.renderID;
}
@Override
public TileEntity createNewTileEntity(World world) {
return new TileEntityGen();
}
}

View file

@ -1,114 +0,0 @@
package steampower.turbine;
import java.util.Random;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Material;
import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import steampower.SteamPowerMain;
public class BlockSteamPiston extends universalelectricity.prefab.BlockMachine {
public BlockSteamPiston(int par1) {
super("SteamEngine", par1, Material.iron);
}
@Override
public boolean onMachineActivated(World par1World, int x, int y, int z,
EntityPlayer par5EntityPlayer) {
return false;
}
@Override
public boolean onUseWrench(World par1World, int x, int y, int z,
EntityPlayer par5EntityPlayer) {
int angle = MathHelper
.floor_double((par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
int metadata = par1World.getBlockMetadata(x, y, z);
if (metadata < 3) {
par1World.setBlockAndMetadata(x, y, z, blockID, metadata + angle);
} else {
par1World.setBlockAndMetadata(x, y, z, blockID, 0);
}
return true;
}
public TileEntity createNewTileEntity(World var1) {
return null;
}
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
super.breakBlock(world, x, y, z, par5, par6);
int meta = world.getBlockMetadata(x, y, z);
if (meta < 4) {
if (world.getBlockId(x, y + 1, z) == this.blockID) {
if (world.getBlockMetadata(x, y, z) > 4) {
world.setBlockAndMetadataWithUpdate(x, y, z, 0, 0, true);
}
}
} else if (meta > 4) {
if (world.getBlockId(x, y - 1, z) == this.blockID) {
if (world.getBlockMetadata(x, y, z) < 4) {
world.setBlockAndMetadataWithUpdate(x, y, z, 0, 0, true);
}
}
}
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public int getRenderType() {
return -1;
}
@Override
public TileEntity createNewTileEntity(World world, int metadata) {
if (metadata >= 0 && metadata < 4) {
return new TileEntitySteamPiston();
}
if (metadata == 14) {
return new TileEntitytopGen();
}
return null;
}
public void onNeighborBlockChange(World par1World, int par2, int par3,
int par4, int par5) {
int meta = par1World.getBlockMetadata(par2, par3, par4);
if (meta < 4) {
if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID) {
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
} else {
if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID) {
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
}
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return SteamPowerMain.itemEngine.shiftedIndex;
}
@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
int var5 = par1World.getBlockId(par2, par3, par4);
int var6 = par1World.getBlockId(par2, par3 + 1, par4);
return (var5 == 0 || blocksList[var5].blockMaterial.isGroundCover())
&& (var6 == 0 || blocksList[var6].blockMaterial.isGroundCover());
}
}

View file

@ -1,112 +0,0 @@
package steampower.turbine;
import java.util.List;
import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.MathHelper;
import net.minecraft.src.World;
import steampower.SteamPowerMain;
import steampower.TileEntityMachine;
public class ItemEngine extends Item {
public ItemEngine(int par1) {
super(par1);
this.maxStackSize = 5;
this.setCreativeTab(CreativeTabs.tabBlock);
this.setIconIndex(21);
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs,
List par3List) {
par3List.add(new ItemStack(this, 1, 0));
}
@Override
public String getTextureFile() {
// TODO Auto-generated method stub
return SteamPowerMain.textureFile + "Items.png";
}
public boolean onItemUse(ItemStack itemStack, EntityPlayer ePlayer,
World world, int x, int y, int z, int par7, float par8, float par9,
float par10) {
int var11 = world.getBlockId(x, y, z);
int BlockID = SteamPowerMain.EngineID;
if (var11 == Block.snow.blockID) {
par7 = 1;
} else if (var11 != Block.vine.blockID
&& var11 != Block.tallGrass.blockID
&& var11 != Block.deadBush.blockID
&& (Block.blocksList[var11] == null || !Block.blocksList[var11]
.isBlockReplaceable(world, x, y, z))) {
if (par7 == 0) {
--y;
}
if (par7 == 1) {
++y;
}
if (par7 == 2) {
--z;
}
if (par7 == 3) {
++z;
}
if (par7 == 4) {
--x;
}
if (par7 == 5) {
++x;
}
}
if (itemStack.stackSize == 0) {
return false;
} else if (!ePlayer.func_82247_a(x, y, z, par7, itemStack)) {
return false;
} else if (y == 255
&& Block.blocksList[BlockID].blockMaterial.isSolid()) {
return false;
} else if (world.canPlaceEntityOnSide(BlockID, x, y, z, false, par7,
ePlayer)) {
Block var12 = Block.blocksList[BlockID];
int angle = MathHelper
.floor_double((ePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
switch (angle) {
case 0:
world.setBlockAndMetadata(x, y, z, var12.blockID, 0);
break;
case 1:
world.setBlockAndMetadata(x, y, z, var12.blockID, 1);
break;
case 2:
world.setBlockAndMetadata(x, y, z, var12.blockID, 2);
break;
case 3:
world.setBlockAndMetadata(x, y, z, var12.blockID, 3);
break;
}
int meta = world.getBlockMetadata(x, y, z);
// ePlayer.sendChatToPlayer("A:"+angle+" M:"+meta);
world.notifyBlocksOfNeighborChange(x, y, z, var12.blockID);
world.setBlockAndMetadataWithNotify(x, y + 1, z, var12.blockID, 14);
world.notifyBlocksOfNeighborChange(x, y, z, var12.blockID);
world.editingBlocks = false;
--itemStack.stackSize;
return true;
} else {
return false;
}
}
}

View file

@ -1,185 +0,0 @@
package steampower.turbine;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import steampower.TileEntityMachine;
import universalelectricity.electricity.ElectricityManager;
import universalelectricity.implement.IConductor;
import universalelectricity.implement.IElectricityProducer;
import universalelectricity.prefab.network.IPacketReceiver;
import basicpipes.pipes.api.IMechanical;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityGen extends TileEntityMachine implements IPacketReceiver, IMechanical,IElectricityProducer
{
ForgeDirection facing = ForgeDirection.DOWN;
public int force = 0;
public int aForce = 0;
public int pos = 0;
public int disableTicks = 0;
public double genAmmount = 0;
public int tCount = 0;
public boolean empProf = false;
IConductor[] wires = {null,null,null,null,null,null};
public boolean needUpdate()
{
return false;
}
@Override
public void updateEntity()
{
this.genAmmount = force/this.getVoltage();
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
int nMeta = 0;
int wireCount = 0;
switch(meta)
{
case 0: nMeta = 2;break;
case 1: nMeta = 5;break;
case 2: nMeta = 3;break;
case 3: nMeta = 4;break;
}
facing = ForgeDirection.getOrientation(nMeta).getOpposite();
if(genAmmount > 0)
{
//worldObj.setBlock(xCoord, yCoord+1, zCoord, 1);
}
for(int i = 0; i < 6; i++)
{
ForgeDirection side = ForgeDirection.UNKNOWN;
switch(i)
{
case 0: side = ForgeDirection.UP;break;
//case 1: side = ForgeDirection.DOWN;break;
case 2: side = ForgeDirection.NORTH;break;
case 3: side = ForgeDirection.EAST;break;
case 4: side = ForgeDirection.SOUTH;break;
case 5: side = ForgeDirection.WEST;break;
}
if(side != facing && side != facing.getOpposite())
{
TileEntity tileEntity = worldObj.getBlockTileEntity(xCoord+side.offsetX, yCoord+side.offsetY, zCoord+side.offsetZ);
if (tileEntity instanceof IConductor)
{
if (ElectricityManager.instance.getElectricityRequired(((IConductor)tileEntity).getNetwork()) > 0)
{
this.wires[i] = (IConductor)tileEntity;
wireCount++;
}
else
{
this.wires[i] = null;
}
}
else
{
this.wires[i] = null;
}
}
}
for(int side =0; side < 6; side++)
{
if(wires[side] instanceof IConductor)
{
double max = wires[side].getMaxAmps();
ElectricityManager.instance.produceElectricity(this, wires[side],Math.min(genAmmount/wireCount,max), this.getVoltage());
}
}
super.updateEntity();
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput data) {
// TODO Auto-generated method stub
}
//------------------------------
//Mechanics
//------------------------------
@Override
public int getForceSide(ForgeDirection side) {
if(side == facing.getOpposite())
{
return aForce;
}
return 0;
}
@Override
public int getForce() {
// TODO Auto-generated method stub
return this.force;
}
@Override
public boolean canOutputSide(ForgeDirection side) {
if(side == facing.getOpposite())
{
return true;
}
return false;
}
@Override
public boolean canInputSide(ForgeDirection side) {
if(side == facing)
{
return true;
}
return false;
}
@Override
public int applyForce(int force) {
this.force = force;
return force;
}
@Override
public int getAnimationPos() {
return pos;
}
//------------------------------
//Electric
//------------------------------
@Override
public void onDisable(int duration)
{
this.disableTicks = duration;
}
@Override
public boolean isDisabled() {
if(disableTicks-- <= 0)
{
return false;
}
return true;
}
@Override
public double getVoltage() {
return 120;
}
@Override
public boolean canConnect(ForgeDirection side) {
if(side != ForgeDirection.DOWN && side != facing && side != facing.getOpposite())
{
return true;
}
return false;
}
}

View file

@ -1,330 +0,0 @@
package steampower.turbine;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import steampower.TileEntityMachine;
import universalelectricity.prefab.network.IPacketReceiver;
import basicpipes.pipes.api.ILiquidConsumer;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.IMechanical;
import basicpipes.pipes.api.Liquid;
import com.google.common.io.ByteArrayDataInput;
public class TileEntitySteamPiston extends TileEntityMachine implements IPacketReceiver,ILiquidConsumer,ILiquidProducer,IMechanical
{
public int force = 0;
public int aForce = 0;
public int bForce = 0;
private int frictionLoad = 10;
public int steam = 0;
public int water = 0;
public int maxWater = 2;
public int maxSteam = 10;
public int pos = 0; //max at 7
private int tickCount = 0;
private int runTime = 0;
private int genRate = 0;//max 100
private int posCount = 0;
public int tCount = 0;
private ForgeDirection frontDir;
public TileEntity ff;
public TileEntity bb;
private int pWater = 0;
private int pSteam = 0;
private int pForce = 0;
public int pCount = 0;
public boolean running= false;
@Override
public void updateEntity()
{
super.updateEntity();
if(tickCount++ >=10)
{tickCount = 0;
//this.pos += 1; if(pos >= 8){pos = 0;}
//++tCount;if(tCount > 120){tCount = 0;}
int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
int nMeta = 0;
switch(meta)
{
case 0: nMeta = 2;break;
case 1: nMeta = 5;break;
case 2: nMeta = 3;break;
case 3: nMeta = 4;break;
}
frontDir = ForgeDirection.getOrientation(nMeta);
ff = worldObj.getBlockTileEntity(xCoord+frontDir.offsetX, yCoord+1, zCoord+frontDir.offsetZ);
bb = worldObj.getBlockTileEntity(xCoord+frontDir.getOpposite().offsetX, yCoord+1, zCoord+frontDir.getOpposite().offsetZ);
if(this.runTime > 0)
{
this.running = true;
}else
{
this.running = false;
}
if(this.running)
{
int countA = 10 - (genRate/10);
if(posCount++ >=countA)
{
posCount = 0;
pos += 1;if(pos > 7){pos =0;}
}
}
if(!worldObj.isRemote)
{
if(this.runTime < 1 && this.steam > 0)
{
this.steam--;
this.runTime=60;
}
if(bb instanceof IMechanical)
{
if(((IMechanical) bb).canOutputSide(frontDir))
{
this.bForce = ((IMechanical) bb).getForce();
}else
if( bb instanceof TileEntitySteamPiston)
{
if(((TileEntitySteamPiston) bb).getMeta() == this.getMeta())
{
this.bForce = ((TileEntitySteamPiston) bb).getForce();
}
}
else
{
this.bForce = 0;
}
}
if(this.runTime > 0)
{
genRate=Math.min(genRate + 1, 100);
this.runTime-=1;
this.force = Math.min(genRate * 10,1000);
this.aForce = Math.max(force - this.frictionLoad+bForce,0);
}
if(runTime == 0 && this.steam == 0)
{
genRate = Math.max(genRate--, 0);
force= Math.max(force-=10, 0);;
}
if(ff instanceof IMechanical)
{
if(((IMechanical) ff).canInputSide(frontDir.getOpposite()))
{
((IMechanical) ff).applyForce(this.aForce);
}else
{
}
}
pWater = this.water;
pSteam = this.steam;
pForce = this.force;
}
}
}
//-------------------
//Liquid and mechanical stuff
//----------------
@Override
public int getForceSide(ForgeDirection side) {
return aForce;
}
@Override
public boolean canOutputSide(ForgeDirection side) {
if(frontDir.getOpposite() == side)
{
return true;
}
return false;
}
@Override
public boolean canInputSide(ForgeDirection side) {
if(frontDir == side)
{
return true;
}
return false;
}
@Override
public int applyForce(int force) {
this.bForce = force;
return aForce;
}
@Override
public int onProduceLiquid(Liquid type, int vol, ForgeDirection side) {
if(type == Liquid.WATER)
{
if(this.water > 0)
{
this.water -= 1;
return 1;
}
}
return 0;
}
@Override
public boolean canProduceLiquid(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return true;
}
return false;
}
@Override
public boolean canProducePresure(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return true;
}
return false;
}
@Override
public int presureOutput(Liquid type, ForgeDirection side) {
if(type == Liquid.WATER)
{
return 32;
}
return 0;
}
@Override
public int onReceiveLiquid(Liquid type, int vol, ForgeDirection side) {
if(type == Liquid.STEAM)
{
int rejectedSteam = Math.max((this.steam + vol) - this.maxSteam, 0);
this.steam += vol - rejectedSteam;
return rejectedSteam;
}
return 0;
}
@Override
public boolean canRecieveLiquid(Liquid type, ForgeDirection forgeDirection) {
if(type == Liquid.STEAM)
{
return true;
}
return false;
}
@Override
public int getStoredLiquid(Liquid type) {
if(type == Liquid.WATER)
{
return this.water;
}else
if(type == Liquid.STEAM)
{
return this.steam;
}
return 0;
}
@Override
public int getLiquidCapacity(Liquid type) {
if(type == Liquid.WATER)
{
return this.maxWater;
}else
if(type == Liquid.STEAM)
{
return this.maxSteam;
}
return 0;
}
//-------------------
//Data
//----------------
public Object[] getSendData()
{
return new Object[]{steam,water,force,aForce,genRate,runTime};
}
public boolean needUpdate()
{
if(this.pForce != this.force || this.pWater != this.water || this.pSteam != this.steam)
{
return true;
}
return false;
}
@Override
public void handlePacketData(INetworkManager network, int packetType,
Packet250CustomPayload packet, EntityPlayer player,
ByteArrayDataInput dataStream) {
try
{
this.steam = dataStream.readInt();
this.water = dataStream.readInt();
this.force = dataStream.readInt();
this.aForce = dataStream.readInt();
this.genRate= dataStream.readInt();
this.runTime = dataStream.readInt();
++pCount;
}
catch(Exception e)
{
System.out.print("SteamPistonDataFail");
e.printStackTrace();
}
}
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
super.readFromNBT(par1NBTTagCompound);
this.runTime = par1NBTTagCompound.getInteger("time");
this.genRate = par1NBTTagCompound.getInteger("gen");
this.steam = par1NBTTagCompound.getInteger("steam");
this.water = par1NBTTagCompound.getInteger("water");
}
/**
* Writes a tile entity to NBT.
*/
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeToNBT(par1NBTTagCompound);
par1NBTTagCompound.setInteger("time", (int)this.runTime);
par1NBTTagCompound.setInteger("gen", (int)this.genRate);
par1NBTTagCompound.setInteger("steam", (int)this.steam);
par1NBTTagCompound.setInteger("water", (int)this.water);
}
@Override
public int getAnimationPos() {
// TODO Auto-generated method stub
return this.pos;
}
@Override
public int getForce() {
// TODO Auto-generated method stub
return this.force;
}
public int getMeta() {
return worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
}
}

View file

@ -1,12 +0,0 @@
package steampower.turbine;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import steampower.TileEntityMachine;
import basicpipes.pipes.api.ILiquidConsumer;
import basicpipes.pipes.api.ILiquidProducer;
import basicpipes.pipes.api.Liquid;
public class TileEntitytopGen extends TileEntityMachine {
}

View file

@ -1,56 +0,0 @@
package basicpipes;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import org.lwjgl.opengl.GL11;
import basicpipes.conductors.TileEntityPipe;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class ItemRenderHelper implements ISimpleBlockRenderingHandler {
public static ItemRenderHelper instance = new ItemRenderHelper();
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
private ModelPump modelPump = new ModelPump();
private ModelGearRod modelRod = new ModelGearRod();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
if(block.blockID == BasicPipesMain.machineID && metadata < 4)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.1F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/textures/pumps/Pump.png"));
modelPump.renderMain(0.0725F);
modelPump.renderC1(0.0725F);
modelPump.renderC2(0.0725F);
modelPump.renderC3(0.0725F);
GL11.glPopMatrix();
}
if(block.blockID == BasicPipesMain.rodID)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.5F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/textures/GearRod.png"));
modelRod.render(0.0825F,0);
GL11.glPopMatrix();
}
}
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
public boolean shouldRender3DInInventory() {
return true;
}
public int getRenderId()
{
return renderID;
}
}

View file

@ -1,139 +0,0 @@
// Date: 9/25/2012 4:29:17 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package basicpipes;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelGearRod extends ModelBase
{
//fields
ModelRenderer Rod;
ModelRenderer front;
ModelRenderer back;
ModelRenderer f2;
ModelRenderer b2;
ModelRenderer b3;
ModelRenderer b4;
ModelRenderer b1;
ModelRenderer f1;
ModelRenderer f4;
ModelRenderer f3;
ModelRenderer Rod2;
public ModelGearRod()
{
textureWidth = 64;
textureHeight = 32;
Rod = new ModelRenderer(this, 0, 0);
Rod.addBox(-1.5F, -1.5F, 0F, 3, 3, 12);
Rod.setRotationPoint(0F, 16F, -6F);
Rod.setTextureSize(64, 32);
Rod.mirror = true;
setRotation(Rod, 0F, 0F, 0F);
front = new ModelRenderer(this, 35, 0);
front.addBox(-2F, -2F, -2F, 4, 4, 2);
front.setRotationPoint(0F, 16F, -6F);
front.setTextureSize(64, 32);
front.mirror = true;
setRotation(front, 0F, 0F, 0F);
back = new ModelRenderer(this, 35, 0);
back.addBox(-2F, -2F, 0F, 4, 4, 2);
back.setRotationPoint(0F, 16F, 6F);
back.setTextureSize(64, 32);
back.mirror = true;
setRotation(back, 0F, 0F, 0.7853982F);
f2 = new ModelRenderer(this, 0, 17);
f2.addBox(0F, 0F, 0F, 1, 1, 2);
f2.setRotationPoint(1F, 17F, -10F);
f2.setTextureSize(64, 32);
f2.mirror = true;
setRotation(f2, 0F, 0F, 0F);
b2 = new ModelRenderer(this, 0, 17);
b2.addBox(-0.5F, -0.5F, 0F, 1, 1, 2);
b2.setRotationPoint(0F, 18F, 8F);
b2.setTextureSize(64, 32);
b2.mirror = true;
setRotation(b2, 0F, 0F, 0.7853982F);
b3 = new ModelRenderer(this, 0, 17);
b3.addBox(-0.5F, -0.5F, 0F, 1, 1, 2);
b3.setRotationPoint(-2F, 16F, 8F);
b3.setTextureSize(64, 32);
b3.mirror = true;
setRotation(b3, 0F, 0F, 0.7853982F);
b4 = new ModelRenderer(this, 0, 17);
b4.addBox(-0.5F, -0.5F, 0F, 1, 1, 2);
b4.setRotationPoint(2F, 16F, 8F);
b4.setTextureSize(64, 32);
b4.mirror = true;
setRotation(b4, 0F, 0F, 0.7853982F);
b1 = new ModelRenderer(this, 0, 17);
b1.addBox(-0.5F, -0.5F, 0F, 1, 1, 2);
b1.setRotationPoint(0F, 14F, 8F);
b1.setTextureSize(64, 32);
b1.mirror = true;
setRotation(b1, 0F, 0F, 0.7853982F);
f1 = new ModelRenderer(this, 0, 17);
f1.addBox(0F, 0F, 0F, 1, 1, 2);
f1.setRotationPoint(1F, 14F, -10F);
f1.setTextureSize(64, 32);
f1.mirror = true;
setRotation(f1, 0F, 0F, 0F);
f4 = new ModelRenderer(this, 0, 17);
f4.addBox(0F, 0F, 0F, 1, 1, 2);
f4.setRotationPoint(-2F, 17F, -10F);
f4.setTextureSize(64, 32);
f4.mirror = true;
setRotation(f4, 0F, 0F, 0F);
f3 = new ModelRenderer(this, 0, 17);
f3.addBox(0F, 0F, 0F, 1, 1, 2);
f3.setRotationPoint(-2F, 14F, -10F);
f3.setTextureSize(64, 32);
f3.mirror = true;
setRotation(f3, 0F, 0F, 0F);
Rod2 = new ModelRenderer(this, 0, 0);
Rod2.addBox(-1.5F, -1.5F, 0F, 3, 3, 12);
Rod2.setRotationPoint(0F, 16F, -6F);
Rod2.setTextureSize(64, 32);
Rod2.mirror = true;
setRotation(Rod2, 0F, 0F, 0.7853982F);
}
public void render(float f5,int r)
{
Rod.rotateAngleZ= 45 * r;
Rod2.rotateAngleZ= Rod.rotateAngleZ + 45;
Rod.render(f5);
Rod2.render(f5);
//TODO add rotation to rods
front.render(f5);
back.render(f5);
f2.render(f5);
b2.render(f5);
b3.render(f5);
b4.render(f5);
b1.render(f5);
f1.render(f5);
f4.render(f5);
f3.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,177 +0,0 @@
// Date: 9/20/2012 12:00:21 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package basicpipes;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelLargePipe extends ModelBase
{
//fields
ModelRenderer Mid;
ModelRenderer RightPipe;
ModelRenderer RightInter;
ModelRenderer RightConnect;
ModelRenderer LeftInter;
ModelRenderer LeftPipe;
ModelRenderer LeftConnect;
ModelRenderer TopInter;
ModelRenderer TopPipe;
ModelRenderer TopConnect;
ModelRenderer BottomPipe;
ModelRenderer BottomInter;
ModelRenderer BottomConnect;
ModelRenderer BackPipe;
ModelRenderer BackInter;
ModelRenderer BackConnect;
ModelRenderer FrontInter;
ModelRenderer FrontPipe;
ModelRenderer FrontConnect;
public ModelLargePipe()
{
textureWidth = 128;
textureHeight = 32;
Mid = new ModelRenderer(this, 50, 13);
Mid.addBox(-3F, -3F, -3F, 6, 6, 6);
Mid.setRotationPoint(0F, 16F, 0F);
Mid.setTextureSize(128, 32);
Mid.mirror = true;
setRotation(Mid, 0F, 0F, 0F);
RightPipe = new ModelRenderer(this, 25, 0);
RightPipe.addBox(0F, -3F, -3F, 4, 6, 6);
RightPipe.setRotationPoint(3F, 16F, 0F);
RightPipe.setTextureSize(128, 32);
RightPipe.mirror = true;
setRotation(RightPipe, 0F, 0F, 0F);
RightInter = new ModelRenderer(this, 98, 0);
RightInter.addBox(0F, -4F, -4F, 1, 8, 8);
RightInter.setRotationPoint(2F, 16F, 0F);
RightInter.setTextureSize(128, 32);
RightInter.mirror = true;
setRotation(RightInter, 0F, 0F, 0F);
RightConnect = new ModelRenderer(this, 98, 0);
RightConnect.addBox(0F, -4F, -4F, 1, 8, 8);
RightConnect.setRotationPoint(7F, 16F, 0F);
RightConnect.setTextureSize(128, 32);
RightConnect.mirror = true;
setRotation(RightConnect, 0F, 0F, 0F);
LeftInter = new ModelRenderer(this, 98, 0);
LeftInter.addBox(-1F, -4F, -4F, 1, 8, 8);
LeftInter.setRotationPoint(-2F, 16F, 0F);
LeftInter.setTextureSize(128, 32);
LeftInter.mirror = true;
setRotation(LeftInter, 0F, 0F, 0F);
LeftPipe = new ModelRenderer(this, 25, 0);
LeftPipe.addBox(-4F, -3F, -3F, 4, 6, 6);
LeftPipe.setRotationPoint(-3F, 16F, 0F);
LeftPipe.setTextureSize(128, 32);
LeftPipe.mirror = true;
setRotation(LeftPipe, 0F, 0F, 0F);
LeftConnect = new ModelRenderer(this, 98, 0);
LeftConnect.addBox(-1F, -4F, -4F, 1, 8, 8);
LeftConnect.setRotationPoint(-7F, 16F, 0F);
LeftConnect.setTextureSize(128, 32);
LeftConnect.mirror = true;
setRotation(LeftConnect, 0F, 0F, 0F);
TopInter = new ModelRenderer(this, 77, 17);
TopInter.addBox(-4F, -1F, -4F, 8, 1, 8);
TopInter.setRotationPoint(0F, 14F, 0F);
TopInter.setTextureSize(128, 32);
TopInter.mirror = true;
setRotation(TopInter, 0F, 0F, 0F);
TopPipe = new ModelRenderer(this, 50, 0);
TopPipe.addBox(-3F, -4F, -3F, 6, 4, 6);
TopPipe.setRotationPoint(0F, 13F, 0F);
TopPipe.setTextureSize(128, 32);
TopPipe.mirror = true;
setRotation(TopPipe, 0F, 0F, 0F);
TopConnect = new ModelRenderer(this, 77, 17);
TopConnect.addBox(-4F, -1F, -4F, 8, 1, 8);
TopConnect.setRotationPoint(0F, 9F, 0F);
TopConnect.setTextureSize(128, 32);
TopConnect.mirror = true;
setRotation(TopConnect, 0F, 0F, 0F);
BottomPipe = new ModelRenderer(this, 50, 0);
BottomPipe.addBox(-3F, 0F, -3F, 6, 4, 6);
BottomPipe.setRotationPoint(0F, 19F, 0F);
BottomPipe.setTextureSize(128, 32);
BottomPipe.mirror = true;
setRotation(BottomPipe, 0F, 0F, 0F);
BottomInter = new ModelRenderer(this, 77, 17);
BottomInter.addBox(-4F, 0F, -4F, 8, 1, 8);
BottomInter.setRotationPoint(0F, 18F, 0F);
BottomInter.setTextureSize(128, 32);
BottomInter.mirror = true;
setRotation(BottomInter, 0F, 0F, 0F);
BottomConnect = new ModelRenderer(this, 77, 17);
BottomConnect.addBox(-4F, 0F, -4F, 8, 1, 8);
BottomConnect.setRotationPoint(0F, 23F, 0F);
BottomConnect.setTextureSize(128, 32);
BottomConnect.mirror = true;
setRotation(BottomConnect, 0F, 0F, 0F);
BackPipe = new ModelRenderer(this, 0, 0);
BackPipe.addBox(-3F, -3F, 0F, 6, 6, 4);
BackPipe.setRotationPoint(0F, 16F, 3F);
BackPipe.setTextureSize(128, 32);
BackPipe.mirror = true;
setRotation(BackPipe, 0F, 0F, 0F);
BackInter = new ModelRenderer(this, 0, 23);
BackInter.addBox(-4F, -4F, 0F, 8, 8, 1);
BackInter.setRotationPoint(0F, 16F, 2F);
BackInter.setTextureSize(128, 32);
BackInter.mirror = true;
setRotation(BackInter, 0F, 0F, 0F);
BackConnect = new ModelRenderer(this, 0, 23);
BackConnect.addBox(-4F, -4F, 0F, 8, 8, 1);
BackConnect.setRotationPoint(0F, 16F, 7F);
BackConnect.setTextureSize(128, 32);
BackConnect.mirror = true;
setRotation(BackConnect, 0F, 0F, 0F);
FrontInter = new ModelRenderer(this, 0, 23);
FrontInter.addBox(-4F, -4F, -1F, 8, 8, 1);
FrontInter.setRotationPoint(0F, 16F, -2F);
FrontInter.setTextureSize(128, 32);
FrontInter.mirror = true;
setRotation(FrontInter, 0F, 0F, 0F);
FrontPipe = new ModelRenderer(this, 0, 0);
FrontPipe.addBox(-3F, -3F, -4F, 6, 6, 4);
FrontPipe.setRotationPoint(0F, 16F, -3F);
FrontPipe.setTextureSize(128, 32);
FrontPipe.mirror = true;
setRotation(FrontPipe, 0F, 0F, 0F);
FrontConnect = new ModelRenderer(this, 0, 23);
FrontConnect.addBox(-4F, -4F, -1F, 8, 8, 1);
FrontConnect.setRotationPoint(0F, 16F, -7F);
FrontConnect.setTextureSize(128, 32);
FrontConnect.mirror = true;
setRotation(FrontConnect, 0F, 0F, 0F);
}
public void renderMiddle() { Mid.render(0.0625F); }
public void renderBottom() { BottomPipe.render(0.0625F); BottomConnect.render(0.0625F); BottomInter.render(0.0625F);}
public void renderTop() { TopPipe.render(0.0625F);TopConnect.render(0.0625F); TopInter.render(0.0625F);}
public void renderLeft() { LeftPipe.render(0.0625F);LeftConnect.render(0.0625F); LeftInter.render(0.0625F);}
public void renderRight() { RightPipe.render(0.0625F);RightConnect.render(0.0625F); RightInter.render(0.0625F);}
public void renderBack() { BackPipe.render(0.0625F); BackConnect.render(0.0625F);BackInter.render(0.0625F); }
public void renderFront() { FrontPipe.render(0.0625F);FrontConnect.render(0.0625F);FrontInter.render(0.0625F);}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,93 +0,0 @@
package basicpipes;
import net.minecraft.src.*;
public class ModelPipe extends ModelBase
{
//fields
ModelRenderer Middle;
ModelRenderer Right;
ModelRenderer Left;
ModelRenderer Back;
ModelRenderer Front;
ModelRenderer Top;
ModelRenderer Bottom;
public ModelPipe()
{
textureWidth = 64;
textureHeight = 32;
Middle = new ModelRenderer(this, 0, 0);
Middle.addBox(-1F, -1F, -1F, 4, 4, 4);
Middle.setRotationPoint(-1F, 15F, -1F);
Middle.setTextureSize(64, 32);
Middle.mirror = true;
setRotation(Middle, 0F, 0F, 0F);
Right = new ModelRenderer(this, 21, 0);
Right.addBox(0F, 0F, 0F, 6, 4, 4);
Right.setRotationPoint(2F, 14F, -2F);
Right.setTextureSize(64, 32);
Right.mirror = true;
setRotation(Right, 0F, 0F, 0F);
Left = new ModelRenderer(this, 21, 0);
Left.addBox(0F, 0F, 0F, 6, 4, 4);
Left.setRotationPoint(-8F, 14F, -2F);
Left.setTextureSize(64, 32);
Left.mirror = true;
setRotation(Left, 0F, 0F, 0F);
Back = new ModelRenderer(this, 0, 11);
Back.addBox(0F, 0F, 0F, 4, 4, 6);
Back.setRotationPoint(-2F, 14F, 2F);
Back.setTextureSize(64, 32);
Back.mirror = true;
setRotation(Back, 0F, 0F, 0F);
Front = new ModelRenderer(this, 0, 11);
Front.addBox(0F, 0F, 0F, 4, 4, 6);
Front.setRotationPoint(-2F, 14F, -8F);
Front.setTextureSize(64, 32);
Front.mirror = true;
setRotation(Front, 0F, 0F, 0F);
Top = new ModelRenderer(this, 21, 11);
Top.addBox(0F, 0F, 0F, 4, 6, 4);
Top.setRotationPoint(-2F, 8F, -2F);
Top.setTextureSize(64, 32);
Top.mirror = true;
setRotation(Top, 0F, 0F, 0F);
Bottom = new ModelRenderer(this, 21, 11);
Bottom.addBox(0F, 0F, 0F, 4, 6, 4);
Bottom.setRotationPoint(-2F, 18F, -2F);
Bottom.setTextureSize(64, 32);
Bottom.mirror = true;
setRotation(Bottom, 0F, 0F, 0F);
}
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);
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.renderMiddle();
this.renderBottom();
this.renderTop();
this.renderLeft();
this.renderRight();
this.renderBack();
this.renderFront();
}
public void renderMiddle() { Middle.render(0.0625F); }
public void renderBottom() { Bottom.render(0.0625F); }
public void renderTop() { Top.render(0.0625F); }
public void renderLeft() { Left.render(0.0625F); }
public void renderRight() { Right.render(0.0625F); }
public void renderBack() { Back.render(0.0625F); }
public void renderFront() { Front.render(0.0625F);}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,140 +0,0 @@
// Date: 9/3/2012 6:12:15 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package basicpipes;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelPump extends ModelBase
{
//fields
ModelRenderer Main;
ModelRenderer sidePort;
ModelRenderer FrontPort;
ModelRenderer pivit;
ModelRenderer crank;
ModelRenderer Rope;
ModelRenderer pivit2;
ModelRenderer Piston;
ModelRenderer pPlate;
ModelRenderer Rope2;
ModelRenderer BackPort;
public ModelPump()
{
textureWidth = 128;
textureHeight = 128;
Main = new ModelRenderer(this, 0, 0);
Main.addBox(-5F, 0F, -5F, 10, 13, 10);
Main.setRotationPoint(1F, 11F, 0F);
Main.setTextureSize(128, 128);
Main.mirror = true;
setRotation(Main, 0F, 0F, 0F);
sidePort = new ModelRenderer(this, 0, 76);
sidePort.addBox(-6F, -3F, -3F, 6, 6, 6);
sidePort.setRotationPoint(8F, 16F, 0F);
sidePort.setTextureSize(128, 128);
sidePort.mirror = true;
setRotation(sidePort, 0F, 0F, 0F);
FrontPort = new ModelRenderer(this, 0, 63);
FrontPort.addBox(-3F, -3F, 0F, 6, 6, 6);
FrontPort.setRotationPoint(0F, 16F, -8F);
FrontPort.setTextureSize(128, 128);
FrontPort.mirror = true;
setRotation(FrontPort, 0F, 0F, 0F);
pivit = new ModelRenderer(this, 0, 40);
pivit.addBox(-1F, 0F, -1F, 2, 3, 1);
pivit.setRotationPoint(0F, 8F, 1F);
pivit.setTextureSize(128, 128);
pivit.mirror = true;
setRotation(pivit, 0F, 0F, 0F);
crank = new ModelRenderer(this, 48, 0);
crank.addBox(-8F, 0F, -1F, 14, 2, 1);
crank.setRotationPoint(0F, 7F, 0F);
crank.setTextureSize(128, 128);
crank.mirror = true;
setRotation(crank, 0F, 0F, 0F);
Rope = new ModelRenderer(this, 0, 28);
Rope.addBox(0F, 0F, 0F, 1, 7, 1);
Rope.setRotationPoint(4F, 8F, -1F);
Rope.setTextureSize(128, 128);
Rope.mirror = true;
setRotation(Rope, 0F, 0F, 0F);
pivit2 = new ModelRenderer(this, 0, 40);
pivit2.addBox(-1F, 0F, -1F, 2, 3, 1);
pivit2.setRotationPoint(0F, 8F, -1F);
pivit2.setTextureSize(128, 128);
pivit2.mirror = true;
setRotation(pivit2, 0F, 0F, 0F);
pPlate = new ModelRenderer(this, 34, 30);
pPlate.addBox(0F, 0F, 0F, 1, 12, 1);
pPlate.setRotationPoint(-5F, 12F, -1F);
pPlate.setTextureSize(128, 128);
pPlate.mirror = true;
setRotation(pPlate, 0F, 0F, 0F);
Piston = new ModelRenderer(this, 20, 30);
Piston.addBox(0F, 0F, 0F, 3, 12, 3);
Piston.setRotationPoint(-8F, 12F, -2F);
Piston.setTextureSize(128, 128);
Piston.mirror = true;
setRotation(Piston, 0F, 0F, 0F);
Rope2 = new ModelRenderer(this, 0, 28);
Rope2.addBox(0F, 0F, 0F, 1, 7, 1);
Rope2.setRotationPoint(-7F, 8F, -1F);
Rope2.setTextureSize(128, 128);
Rope2.mirror = true;
setRotation(Rope2, 0F, 0F, 0F);
BackPort = new ModelRenderer(this, 0, 50);
BackPort.addBox(-3F, -3F, -6F, 6, 6, 6);
BackPort.setRotationPoint(0F, 16F, 8F);
BackPort.setTextureSize(128, 128);
BackPort.mirror = true;
setRotation(BackPort, 0F, 0F, 0F);
}
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);
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
}
public void renderMain(float f5)
{
Main.render(f5);
pivit.render(f5);
crank.render(f5);
Rope.render(f5);
pivit2.render(f5);
Piston.render(f5);
pPlate.render(f5);
Rope2.render(f5);
}
public void renderC1(float f5)
{
sidePort.render(f5);
}
public void renderC2(float f5)
{
FrontPort.render(f5);
}
public void renderC3(float f5)
{
BackPort.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,34 +0,0 @@
package basicpipes;
import steampower.SteamPowerMain;
import basicpipes.PipeProxy;
import basicpipes.LTanks.TileEntityLTank;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.conductors.TileEntityRod;
import basicpipes.machines.TileEntityPump;
import basicpipes.renderTank.RenderLTank;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
public class PipeClientProxy extends PipeProxy
{
@Override
public void preInit()
{
//Preload textures
MinecraftForgeClient.preloadTexture(BasicPipesMain.textureFile+"/Items.png");
MinecraftForgeClient.preloadTexture(BasicPipesMain.textureFile+"/blocks.png");
RenderingRegistry.registerBlockHandler(new ItemRenderHelper());
}
@Override
public void init()
{
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new RenderPipe());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPump.class, new RenderPump());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRod.class, new RenderGearRod());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLTank.class, new RenderLTank());
}
}

View file

@ -1,49 +0,0 @@
package basicpipes;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import steampower.geared.ModelGearPiston;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.conductors.TileEntityRod;
import basicpipes.machines.TileEntityPump;
import basicpipes.pipes.api.Liquid;
public class RenderGearRod extends TileEntitySpecialRenderer
{
private ModelGearRod model;
public RenderGearRod()
{
model = new ModelGearRod();
}
public void renderAModelAt(TileEntityRod tileEntity, double d, double d1, double d2, float f)
{
bindTextureByName("/textures/GearRod.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
switch(meta)
{
case 0: GL11.glRotatef(90f, 1f, 0f, 0f);break;
case 1: GL11.glRotatef(-90f, 1f, 0f, 0f);break;
case 2:GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 5:GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 3:GL11.glRotatef(180f, 0f, 1f, 0f);break;
case 4:GL11.glRotatef(270f, 0f, 1f, 0f);break;
}
model.render(0.0625F,tileEntity.pos);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
this.renderAModelAt((TileEntityRod)tileEntity, var2, var4, var6, var8);
}
}

View file

@ -1,62 +0,0 @@
package basicpipes;
import net.minecraft.src.ModelBase;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.pipes.api.Liquid;
public class RenderPipe extends TileEntitySpecialRenderer
{
Liquid type;
int size = 6;
private ModelPipe fourPipe;
private ModelLargePipe SixPipe;
private ModelBase model = fourPipe;
public RenderPipe()
{
fourPipe = new ModelPipe();
SixPipe = new ModelLargePipe();
}
public void renderAModelAt(TileEntityPipe tileEntity, double d, double d1, double d2, float f)
{
//Texture file
type = tileEntity.getType();
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
switch(type.ordinal())
{
case 0: bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixSteamPipe.png");break;
case 1: bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixWaterPipe.png");break;
case 2: bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixLavaPipe.png");break;
case 3: bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixOilPipe.png");break;
default:bindTextureByName(BasicPipesMain.textureFile+"/pipes/DefaultPipe.png"); break;
}
if(tileEntity.connectedBlocks[0] != null) SixPipe.renderBottom();
if(tileEntity.connectedBlocks[1] != null) SixPipe.renderTop();
if(tileEntity.connectedBlocks[3] != null) SixPipe.renderFront();
if(tileEntity.connectedBlocks[2] != null) SixPipe.renderBack();
if(tileEntity.connectedBlocks[5] != null) SixPipe.renderRight();
if(tileEntity.connectedBlocks[4] != null) SixPipe.renderLeft();
SixPipe.renderMiddle();
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
this.renderAModelAt((TileEntityPipe)tileEntity, var2, var4, var6, var8);
}
}

View file

@ -1,59 +0,0 @@
package basicpipes;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.machines.TileEntityPump;
import basicpipes.pipes.api.Liquid;
public class RenderPump extends TileEntitySpecialRenderer
{
int type = 0;
private ModelPump model;
public RenderPump()
{
model = new ModelPump();
}
public void renderAModelAt(TileEntityPump tileEntity, double d, double d1, double d2, float f)
{
Liquid type = tileEntity.type;
int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
switch(type.ordinal())
{
default: bindTextureByName("/textures/pumps/Pump.png");break;
//case 0://steam
case 1:bindTextureByName("/textures/pumps/WaterPump.png");break;//water
case 2:bindTextureByName("/textures/pumps/LavaPump.png");break;//lava
case 3:bindTextureByName("/textures/pumps/OilPump.png");break;//oil
//case 4://fuel
}
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
switch(meta)
{
case 1:GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 2:GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 3:GL11.glRotatef(180f, 0f, 1f, 0f);break;
case 0:GL11.glRotatef(270f, 0f, 1f, 0f);break;
}
model.renderMain(0.0625F);
model.renderC1(0.0625F);
model.renderC2(0.0625F);
model.renderC3(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
this.renderAModelAt((TileEntityPump)tileEntity, var2, var4, var6, var8);
}
}

View file

@ -1,422 +0,0 @@
// Date: 10/8/2012 7:31:40 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package basicpipes.renderTank;
import basicpipes.LTanks.TileEntityLTank;
import basicpipes.conductors.TileEntityPipe;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
import net.minecraft.src.TileEntity;
import net.minecraftforge.common.ForgeDirection;
public class ModelLiquidTank extends ModelBase
{
//fields
ModelRenderer Mid;
ModelRenderer Corner;
ModelRenderer Corner2;
ModelRenderer Corner3;
ModelRenderer Corner4;
ModelRenderer C8;
ModelRenderer C7;
ModelRenderer C6;
ModelRenderer C5;
ModelRenderer C4;
ModelRenderer C;
ModelRenderer C3;
ModelRenderer C2;
ModelRenderer GuageT;
ModelRenderer GuageB;
ModelRenderer Guage;
ModelRenderer GuageR;
ModelRenderer GuageGlass;
ModelRenderer GuageL;
ModelRenderer GuageT2;
ModelRenderer GuageB2;
ModelRenderer Guage2;
ModelRenderer GuageR2;
ModelRenderer GuageGlass2;
ModelRenderer GuageL2;
ModelRenderer GuageT3;
ModelRenderer GuageB3;
ModelRenderer Guage3;
ModelRenderer GuageR3;
ModelRenderer GuageGlass3;
ModelRenderer GuageL3;
ModelRenderer GuageT4;
ModelRenderer GuageB4;
ModelRenderer Guage4;
ModelRenderer GuageR4;
ModelRenderer GuageGlass4;
ModelRenderer GuageL4;
ModelRenderer CCBottom;
ModelRenderer CCRight;
ModelRenderer CCLeft;
ModelRenderer CCFront;
ModelRenderer CCBack;
ModelRenderer CCTop;
public ModelLiquidTank()
{
textureWidth = 128;
textureHeight = 128;
Mid = new ModelRenderer(this, 0, 50);
Mid.addBox(-6F, 0F, -6F, 12, 14, 12);
Mid.setRotationPoint(0F, 9F, 0F);
Mid.setTextureSize(128, 128);
Mid.mirror = true;
setRotation(Mid, 0F, 0F, 0F);
Corner = new ModelRenderer(this, 0, 30);
Corner.addBox(-1F, 0F, -1F, 2, 16, 2);
Corner.setRotationPoint(-7F, 8F, 7F);
Corner.setTextureSize(128, 128);
Corner.mirror = true;
setRotation(Corner, 0F, 0F, 0F);
Corner2 = new ModelRenderer(this, 0, 30);
Corner2.addBox(-1F, 0F, -1F, 2, 16, 2);
Corner2.setRotationPoint(-7F, 8F, -7F);
Corner2.setTextureSize(128, 128);
Corner2.mirror = true;
setRotation(Corner2, 0F, 0F, 0F);
Corner3 = new ModelRenderer(this, 0, 30);
Corner3.addBox(-1F, 0F, -1F, 2, 16, 2);
Corner3.setRotationPoint(7F, 8F, -7F);
Corner3.setTextureSize(128, 128);
Corner3.mirror = true;
setRotation(Corner3, 0F, 0F, 0F);
Corner4 = new ModelRenderer(this, 0, 30);
Corner4.addBox(-1F, 0F, -1F, 2, 16, 2);
Corner4.setRotationPoint(7F, 8F, 7F);
Corner4.setTextureSize(128, 128);
Corner4.mirror = true;
setRotation(Corner4, 0F, 0F, 0F);
C8 = new ModelRenderer(this, 9, 35);
C8.addBox(-1F, 0F, -1F, 2, 2, 12);
C8.setRotationPoint(6F, 22F, -5F);
C8.setTextureSize(128, 128);
C8.mirror = true;
setRotation(C8, 0F, 0F, 0F);
C7 = new ModelRenderer(this, 9, 35);
C7.addBox(-1F, 0F, -1F, 2, 2, 12);
C7.setRotationPoint(-6F, 8F, -5F);
C7.setTextureSize(128, 128);
C7.mirror = true;
setRotation(C7, 0F, 0F, 0F);
C6 = new ModelRenderer(this, 9, 35);
C6.addBox(-1F, 0F, -1F, 2, 2, 12);
C6.setRotationPoint(6F, 8F, -5F);
C6.setTextureSize(128, 128);
C6.mirror = true;
setRotation(C6, 0F, 0F, 0F);
C5 = new ModelRenderer(this, 9, 30);
C5.addBox(-1F, 0F, -1F, 12, 2, 2);
C5.setRotationPoint(-5F, 8F, 6F);
C5.setTextureSize(128, 128);
C5.mirror = true;
setRotation(C5, 0F, 0F, 0F);
C4 = new ModelRenderer(this, 9, 35);
C4.addBox(-1F, 0F, -1F, 2, 2, 12);
C4.setRotationPoint(-6F, 22F, -5F);
C4.setTextureSize(128, 128);
C4.mirror = true;
setRotation(C4, 0F, 0F, 0F);
C = new ModelRenderer(this, 9, 30);
C.addBox(-1F, 0F, -1F, 12, 2, 2);
C.setRotationPoint(-5F, 22F, 6F);
C.setTextureSize(128, 128);
C.mirror = true;
setRotation(C, 0F, 0F, 0F);
C3 = new ModelRenderer(this, 9, 30);
C3.addBox(-1F, 0F, -1F, 12, 2, 2);
C3.setRotationPoint(-5F, 8F, -6F);
C3.setTextureSize(128, 128);
C3.mirror = true;
setRotation(C3, 0F, 0F, 0F);
C2 = new ModelRenderer(this, 9, 30);
C2.addBox(-1F, 0F, -1F, 12, 2, 2);
C2.setRotationPoint(-5F, 22F, -6F);
C2.setTextureSize(128, 128);
C2.mirror = true;
setRotation(C2, 0F, 0F, 0F);
//G1--------------------------------------
GuageT = new ModelRenderer(this, 54, 42);
GuageT.addBox(-1F, -1F, 0F, 2, 1, 2);
GuageT.setRotationPoint(0F, 12F, -8F);
GuageT.setTextureSize(128, 128);
GuageT.mirror = true;
setRotation(GuageT, 0F, 0F, 0F);
GuageB = new ModelRenderer(this, 54, 42);
GuageB.addBox(-1F, 8F, 0F, 2, 1, 2);
GuageB.setRotationPoint(0F, 12F, -8F);
GuageB.setTextureSize(128, 128);
GuageB.mirror = true;
setRotation(GuageB, 0F, 0F, 0F);
Guage = new ModelRenderer(this, 54, 32);
Guage.addBox(-1F, 0F, 0F, 2, 8, 1);
Guage.setRotationPoint(0F, 12F, -7F);
Guage.setTextureSize(128, 128);
Guage.mirror = true;
setRotation(Guage, 0F, 0F, 0F);
GuageR = new ModelRenderer(this, 44, 32);
GuageR.addBox(1F, -1F, -1F, 2, 10, 2);
GuageR.setRotationPoint(0F, 12F, -7F);
GuageR.setTextureSize(128, 128);
GuageR.mirror = true;
setRotation(GuageR, 0F, 0F, 0F);
GuageGlass = new ModelRenderer(this, 60, 32);
GuageGlass.addBox(-1F, 0F, 0F, 2, 8, 1);
GuageGlass.setRotationPoint(0F, 12F, -8F);
GuageGlass.setTextureSize(128, 128);
GuageGlass.mirror = true;
setRotation(GuageGlass, 0F, 0F, 0F);
GuageL = new ModelRenderer(this, 44, 32);
GuageL.addBox(-3F, -1F, -1F, 2, 10, 2);
GuageL.setRotationPoint(0F, 12F, -7F);
GuageL.setTextureSize(128, 128);
GuageL.mirror = true;
setRotation(GuageL, 0F, 0F, 0F);
//G2----------------------------------
GuageT2 = new ModelRenderer(this, 54, 42);
GuageT2.addBox(-1F, -1F, 0F, 2, 1, 2);
GuageT2.setRotationPoint(-8F, 12F, 0F);
GuageT2.setTextureSize(128, 128);
GuageT2.mirror = true;
setRotation(GuageT2, 0F, 1.570796F, 0F);
GuageB2 = new ModelRenderer(this, 54, 42);
GuageB2.addBox(-1F, 8F, 0F, 2, 1, 2);
GuageB2.setRotationPoint(-8F, 12F, 0F);
GuageB2.setTextureSize(128, 128);
GuageB2.mirror = true;
setRotation(GuageB2, 0F, 1.570796F, 0F);
Guage2 = new ModelRenderer(this, 54, 32);
Guage2.addBox(-1F, 0F, 0F, 2, 8, 1);
Guage2.setRotationPoint(-7F, 12F, 0F);
Guage2.setTextureSize(128, 128);
Guage2.mirror = true;
setRotation(Guage2, 0F, 1.570796F, 0F);
GuageR2 = new ModelRenderer(this, 44, 32);
GuageR2.addBox(1F, -1F, -1F, 2, 10, 2);
GuageR2.setRotationPoint(-7F, 12F, 0F);
GuageR2.setTextureSize(128, 128);
GuageR2.mirror = true;
setRotation(GuageR2, 0F, 1.570796F, 0F);
GuageGlass2 = new ModelRenderer(this, 60, 32);
GuageGlass2.addBox(-1F, 0F, 0F, 2, 8, 1);
GuageGlass2.setRotationPoint(-8F, 12F, 0F);
GuageGlass2.setTextureSize(128, 128);
GuageGlass2.mirror = true;
setRotation(GuageGlass2, 0F, 1.570796F, 0F);
GuageL2 = new ModelRenderer(this, 44, 32);
GuageL2.addBox(-3F, -1F, -1F, 2, 10, 2);
GuageL2.setRotationPoint(-7F, 12F, 0F);
GuageL2.setTextureSize(128, 128);
GuageL2.mirror = true;
setRotation(GuageL2, 0F, 1.570796F, 0F);
//G3--------------------------------------
GuageT3 = new ModelRenderer(this, 54, 42);
GuageT3.addBox(-1F, -1F, 0F, 2, 1, 2);
GuageT3.setRotationPoint(0F, 12F, 8F);
GuageT3.setTextureSize(128, 128);
GuageT3.mirror = true;
setRotation(GuageT3, 0F, 3.141593F, 0F);
GuageB3 = new ModelRenderer(this, 54, 42);
GuageB3.addBox(-1F, 8F, 0F, 2, 1, 2);
GuageB3.setRotationPoint(0F, 12F, 8F);
GuageB3.setTextureSize(128, 128);
GuageB3.mirror = true;
setRotation(GuageB3, 0F, 3.141593F, 0F);
Guage3 = new ModelRenderer(this, 54, 32);
Guage3.addBox(-1F, 0F, 0F, 2, 8, 1);
Guage3.setRotationPoint(0F, 12F, 7F);
Guage3.setTextureSize(128, 128);
Guage3.mirror = true;
setRotation(Guage3, 0F, 3.141593F, 0F);
GuageR3 = new ModelRenderer(this, 44, 32);
GuageR3.addBox(1F, -1F, -1F, 2, 10, 2);
GuageR3.setRotationPoint(0F, 12F, 7F);
GuageR3.setTextureSize(128, 128);
GuageR3.mirror = true;
setRotation(GuageR3, 0F, 3.141593F, 0F);
GuageGlass3 = new ModelRenderer(this, 60, 32);
GuageGlass3.addBox(-1F, 0F, 0F, 2, 8, 1);
GuageGlass3.setRotationPoint(0F, 12F, 8F);
GuageGlass3.setTextureSize(128, 128);
GuageGlass3.mirror = true;
setRotation(GuageGlass3, 0F, 3.141593F, 0F);
GuageL3 = new ModelRenderer(this, 44, 32);
GuageL3.addBox(-3F, -1F, -1F, 2, 10, 2);
GuageL3.setRotationPoint(0F, 12F, 7F);
GuageL3.setTextureSize(128, 128);
GuageL3.mirror = true;
setRotation(GuageL3, 0F, 3.141593F, 0F);
//G4-------------------------------
GuageT4 = new ModelRenderer(this, 54, 42);
GuageT4.addBox(-1F, -1F, 0F, 2, 1, 2);
GuageT4.setRotationPoint(8F, 12F, 0F);
GuageT4.setTextureSize(128, 128);
GuageT4.mirror = true;
setRotation(GuageT4, 0F, -1.570796F, 0F);
GuageB4 = new ModelRenderer(this, 54, 42);
GuageB4.addBox(-1F, 8F, 0F, 2, 1, 2);
GuageB4.setRotationPoint(8F, 12F, 0F);
GuageB4.setTextureSize(128, 128);
GuageB4.mirror = true;
setRotation(GuageB4, 0F, -1.570796F, 0F);
Guage4 = new ModelRenderer(this, 54, 32);
Guage4.addBox(-1F, 0F, 0F, 2, 8, 1);
Guage4.setRotationPoint(7F, 12F, 0F);
Guage4.setTextureSize(128, 128);
Guage4.mirror = true;
setRotation(Guage4, 0F, -1.570796F, 0F);
GuageR4 = new ModelRenderer(this, 44, 32);
GuageR4.addBox(1F, -1F, -1F, 2, 10, 2);
GuageR4.setRotationPoint(7F, 12F, 0F);
GuageR4.setTextureSize(128, 128);
GuageR4.mirror = true;
setRotation(GuageR4, 0F, -1.570796F, 0F);
GuageGlass4 = new ModelRenderer(this, 60, 32);
GuageGlass4.addBox(-1F, 0F, 0F, 2, 8, 1);
GuageGlass4.setRotationPoint(8F, 12F, 0F);
GuageGlass4.setTextureSize(128, 128);
GuageGlass4.mirror = true;
setRotation(GuageGlass4, 0F, -1.570796F, 0F);
GuageL4 = new ModelRenderer(this, 44, 32);
GuageL4.addBox(-3F, -1F, -1F, 2, 10, 2);
GuageL4.setRotationPoint(7F, 12F, 0F);
GuageL4.setTextureSize(128, 128);
GuageL4.mirror = true;
setRotation(GuageL4, 0F, -1.570796F, 0F);
//Pipe Connectors
CCBottom = new ModelRenderer(this, 0, 0);
CCBottom.addBox(-3F, -9F, -3F, 6, 1, 6);
CCBottom.setRotationPoint(0F, 15F, 0F);
CCBottom.setTextureSize(128, 128);
CCBottom.mirror = true;
setRotation(CCBottom, 3.141593F, 0F, 0F);
CCRight = new ModelRenderer(this, 0, 0);
CCRight.addBox(-3F, -8F, -3F, 6, 2, 6);
CCRight.setRotationPoint(0F, 15F, 0F);
CCRight.setTextureSize(128, 128);
CCRight.mirror = true;
setRotation(CCRight, 0F, 0F, -1.570796F);
CCLeft = new ModelRenderer(this, 0, 0);
CCLeft.addBox(-3F, -8F, -3F, 6, 2, 6);
CCLeft.setRotationPoint(0F, 15F, 0F);
CCLeft.setTextureSize(128, 128);
CCLeft.mirror = true;
setRotation(CCLeft, 0F, 0F, 1.570796F);
CCFront = new ModelRenderer(this, 0, 0);
CCFront.addBox(-3F, -8F, -3F, 6, 2, 6);
CCFront.setRotationPoint(0F, 15F, 0F);
CCFront.setTextureSize(128, 128);
CCFront.mirror = true;
setRotation(CCFront, 1.570796F, 0F, 0F);
CCBack = new ModelRenderer(this, 0, 0);
CCBack.addBox(-3F, -8F, -3F, 6, 2, 6);
CCBack.setRotationPoint(0F, 15F, 0F);
CCBack.setTextureSize(128, 128);
CCBack.mirror = true;
setRotation(CCBack, -1.570796F, 0F, 0F);
CCTop = new ModelRenderer(this, 0, 0);
CCTop.addBox(-3F, -7F, -3F, 6, 1, 6);
CCTop.setRotationPoint(0F, 15F, 0F);
CCTop.setTextureSize(128, 128);
CCTop.mirror = true;
setRotation(CCTop, 0F, 0F, 0F);
}
public void renderMain(TileEntityLTank te ,float f5)
{
//render regardless of sides
Mid.render(f5);
Corner.render(f5);
Corner2.render(f5);
Corner3.render(f5);
Corner4.render(f5);
C8.render(f5);
C7.render(f5);
C6.render(f5);
C5.render(f5);
C4.render(f5);
C.render(f5);
C3.render(f5);
C2.render(f5);
CCTop.render(f5);CCBottom.render(f5);
//Front
if(te.cc[2] instanceof TileEntityPipe)
{
CCFront.render(f5);
}else
{
GuageT.render(f5);
GuageB.render(f5);
Guage.render(f5);
GuageR.render(f5);
GuageGlass.render(f5);
GuageL.render(f5);
}
//back
if(te.cc[3] instanceof TileEntityPipe)
{
CCBack.render(f5);
}else
{
GuageT3.render(f5);
Guage3.render(f5);
Guage3.render(f5);
GuageR3.render(f5);
GuageGlass3.render(f5);
GuageL3.render(f5);
}
//right
if(te.cc[4] instanceof TileEntityPipe)
{
CCRight.render(f5);
}else
{
GuageT4.render(f5);
Guage4.render(f5);
Guage4.render(f5);
GuageR4.render(f5);
GuageGlass4.render(f5);
GuageL4.render(f5);
}
//left
if(te.cc[5] instanceof TileEntityPipe)
{
CCLeft.render(f5);
}else
{
GuageT2.render(f5);
Guage2.render(f5);
Guage2.render(f5);
GuageR2.render(f5);
GuageGlass2.render(f5);
GuageL2.render(f5);
}
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,133 +0,0 @@
package basicpipes.renderTank;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelLiquidTankCorner extends ModelBase
{
//fields
ModelRenderer sOne;
ModelRenderer sTwo;
ModelRenderer d7;
ModelRenderer d5;
ModelRenderer d3;
ModelRenderer d4;
ModelRenderer d1;
ModelRenderer d6;
ModelRenderer d2;
ModelRenderer d8;
ModelRenderer d9;
ModelRenderer d10;
ModelRenderer face;
public ModelLiquidTankCorner()
{
textureWidth = 128;
textureHeight = 128;
sOne = new ModelRenderer(this, 0, 30);
sOne.addBox(-1F, 0F, -1F, 2, 16, 2);
sOne.setRotationPoint(-7F, 8F, 7F);
sOne.setTextureSize(128, 128);
sOne.mirror = true;
setRotation(sOne, 0F, 0F, 0F);
sTwo = new ModelRenderer(this, 0, 30);
sTwo.addBox(-1F, 0F, -1F, 2, 16, 2);
sTwo.setRotationPoint(-7F, 8F, -7F);
sTwo.setTextureSize(128, 128);
sTwo.mirror = true;
setRotation(sTwo, 0F, 0F, 0F);
d7 = new ModelRenderer(this, 43, 2);
d7.addBox(-1F, 0F, -1F, 2, 16, 12);
d7.setRotationPoint(-7F, 8F, -5F);
d7.setTextureSize(128, 128);
d7.mirror = true;
setRotation(d7, 0F, 0F, 0F);
d5 = new ModelRenderer(this, 9, 12);
d5.addBox(-1F, 0F, -1F, 14, 16, 2);
d5.setRotationPoint(-5F, 8F, 7F);
d5.setTextureSize(128, 128);
d5.mirror = true;
setRotation(d5, 0F, 0F, 0F);
d3 = new ModelRenderer(this, 9, 67);
d3.addBox(-1.5F, 0F, -1.3F, 20, 2, 2);
d3.setRotationPoint(-6F, 22F, -6F);
d3.setTextureSize(128, 128);
d3.mirror = true;
setRotation(d3, 0F, -0.7853982F, 0F);
d4 = new ModelRenderer(this, 9, 88);
d4.addBox(0F, 0F, -9F, 5, 2, 4);
d4.setRotationPoint(-6F, 22F, 6F);
d4.setTextureSize(128, 128);
d4.mirror = true;
setRotation(d4, 0F, 0F, 0F);
d1 = new ModelRenderer(this, 9, 67);
d1.addBox(-1.5F, 0F, -1.3F, 20, 2, 2);
d1.setRotationPoint(-6F, 8F, -6F);
d1.setTextureSize(128, 128);
d1.mirror = true;
setRotation(d1, 0F, -0.7853982F, 0F);
d6 = new ModelRenderer(this, 9, 75);
d6.addBox(-1.5F, 0F, -1.3F, 17, 2, 2);
d6.setRotationPoint(-6F, 22F, -4F);
d6.setTextureSize(128, 128);
d6.mirror = true;
setRotation(d6, 0F, -0.7853982F, 0F);
d2 = new ModelRenderer(this, 9, 80);
d2.addBox(0F, 0F, -5F, 9, 2, 5);
d2.setRotationPoint(-6F, 22F, 6F);
d2.setTextureSize(128, 128);
d2.mirror = true;
setRotation(d2, 0F, 0F, 0F);
d8 = new ModelRenderer(this, 9, 75);
d8.addBox(-1.5F, 0F, -1.3F, 17, 2, 2);
d8.setRotationPoint(-6F, 8F, -4F);
d8.setTextureSize(128, 128);
d8.mirror = true;
setRotation(d8, 0F, -0.7853982F, 0F);
d9 = new ModelRenderer(this, 9, 88);
d9.addBox(0F, 0F, -9F, 5, 2, 4);
d9.setRotationPoint(-6F, 8F, 6F);
d9.setTextureSize(128, 128);
d9.mirror = true;
setRotation(d9, 0F, 0F, 0F);
d10 = new ModelRenderer(this, 9, 80);
d10.addBox(0F, 0F, -5F, 9, 2, 5);
d10.setRotationPoint(-6F, 8F, 6F);
d10.setTextureSize(128, 128);
d10.mirror = true;
setRotation(d10, 0F, 0F, 0F);
face = new ModelRenderer(this, 0, 50);
face.addBox(-8.5F, 0F, 0F, 17, 14, 2);
face.setRotationPoint(0F, 9F, 0F);
face.setTextureSize(128, 128);
face.mirror = true;
setRotation(face, 0F, -0.7853982F, 0F);
}
public void render(float f5)
{
sOne.render(f5);
sTwo.render(f5);
d7.render(f5);
d5.render(f5);
d3.render(f5);
d4.render(f5);
d1.render(f5);
d6.render(f5);
d2.render(f5);
d8.render(f5);
d9.render(f5);
d10.render(f5);
face.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,71 +0,0 @@
package basicpipes.renderTank;
import net.minecraft.src.ModelBase;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import steampower.SteamPowerMain;
import basicpipes.BasicPipesMain;
import basicpipes.ModelLargePipe;
import basicpipes.ModelPipe;
import basicpipes.LTanks.TileEntityLTank;
import basicpipes.conductors.TileEntityPipe;
import basicpipes.pipes.api.Liquid;
import basicpipes.pipes.api.MHelper;
public class RenderLTank extends TileEntitySpecialRenderer
{
private Liquid type = Liquid.DEFUALT;
private ModelLiquidTank model;
private ModelLiquidTankCorner modelC;
private int pos = 0;
public RenderLTank()
{
model = new ModelLiquidTank();
modelC = new ModelLiquidTankCorner();
}
public void renderAModelAt(TileEntityLTank te, double d, double d1, double d2, float f)
{
type = te.getType();
pos = Math.min(te.getStoredLiquid(type),4);
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if(MHelper.corner(te) > 0)
{
bindTextureByName(BasicPipesMain.textureFile+"/tanks/LiquidTankCorner.png");
int corner = MHelper.corner(te);
switch(corner)
{
case 2: GL11.glRotatef(270f, 0f, 1f, 0f);break;
case 3: GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 4: GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 1: GL11.glRotatef(180f, 0f, 1f, 0f);break;
}
modelC.render(0.0625F);
}
else
{
switch(type.ordinal())
{
//case 0: bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixSteamPipe.png");break;
default:bindTextureByName(BasicPipesMain.textureFile+"/tanks/LiquidTank"+pos+".png"); break;
}
model.renderMain(te, 0.0625F);
}
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
this.renderAModelAt((TileEntityLTank)tileEntity, var2, var4, var6, var8);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -1,92 +0,0 @@
package steampower;
import java.text.DecimalFormat;
import net.minecraft.src.GuiContainer;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.StatCollector;
import org.lwjgl.opengl.GL11;
import steampower.burner.ContainerFireBox;
import steampower.burner.TileEntityFireBox;
public class GUIFireBox extends GuiContainer
{
private TileEntityFireBox tileEntity;
private int containerWidth;
private int containerHeight;
public GUIFireBox(InventoryPlayer par1InventoryPlayer, TileEntityFireBox tileEntity)
{
super(new ContainerFireBox(par1InventoryPlayer, tileEntity));
this.tileEntity = tileEntity;
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer()
{
this.fontRenderer.drawString("FireBox", 55, 6, 4210752);
this.fontRenderer.drawString("HeatOut", 90, 33, 4210752);
String displayText = "";
if(!tileEntity.isConnected)
{
displayText = "No Boiler";
}
else if(tileEntity.storedItems[0] != null)
{
if(tileEntity.storedItems[0].getItem().shiftedIndex != Item.coal.shiftedIndex)
{
displayText = "No Fuel";
}
else{
if(tileEntity.generateRate*20 < 20)
{
displayText = "Hull Heat: "+(tileEntity.generateRate*100)+"%";
}
else
{
displayText = getWattDisplay((tileEntity.generateRate*20));
}
}
}
this.fontRenderer.drawString(displayText, (int)(105-displayText.length()*1.25), 45, 4210752);
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(SteamPowerMain.textureFile+"SteamGUI.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
containerWidth = (this.width - this.xSize) / 2;
containerHeight = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
}
public static String getWattDisplay(int watts)
{
String displayWatt;
if(watts > 1000)
{
displayWatt = roundTwoDecimals((double)watts/1000)+" MJ";
}
else
{
displayWatt = watts+" KJ";
}
return displayWatt;
}
public static double roundTwoDecimals(double d)
{
DecimalFormat twoDForm = new DecimalFormat("#.##");
return Double.valueOf(twoDForm.format(d));
}
}

View file

@ -1,79 +0,0 @@
package steampower;
import net.minecraft.src.GuiContainer;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.StatCollector;
import org.lwjgl.opengl.GL11;
import steampower.turbine.TileEntitySteamPiston;
import universalelectricity.electricity.ElectricInfo;
import universalelectricity.electricity.ElectricInfo.ElectricUnit;
public class GUISteamPiston extends GuiContainer
{
private TileEntitySteamPiston tileEntity;
private int containerWidth;
private int containerHeight;
public GUISteamPiston(InventoryPlayer par1InventoryPlayer, TileEntitySteamPiston tileEntity)
{
super(new ContainerFake(par1InventoryPlayer, tileEntity));
this.tileEntity = tileEntity;
}
/**
* Draw the foreground layer for the GuiContainer (everything in front of the items)
*/
protected void drawGuiContainerForegroundLayer()
{
this.fontRenderer.drawString("Steam Piston Guage Read outs", 55, 6, 4210752);
this.fontRenderer.drawString("MeterReadings", 90, 33, 4210752);
String displayText = "";
String displayText2 = "";
String displayText3 = "";
/**
if(tileEntity.connectedElectricUnit == null)
{
displayText = "Not Connected";
}
else*/
if(!tileEntity.running)
{
if(tileEntity.steam> 0)
{
displayText = "No Load";
}
if(tileEntity.steam<= 0)
{
displayText = "No Steam";
}
}
else
{
//displayText = ElectricUnit.getWattDisplay((int)(tileEntity.generateRate*20));
displayText = "ForceOut: "+tileEntity.force+"N";
displayText2 = "water" + "-" + tileEntity.water;
displayText3 = "steam" + "-" + tileEntity.steam;
}
this.fontRenderer.drawString(displayText, (int)(105-displayText.length()*1), 45, 4210752);
this.fontRenderer.drawString(displayText2, (int)(105-displayText.length()*1), 55, 4210752);
this.fontRenderer.drawString(displayText3, (int)(105-displayText.length()*1), 65, 4210752);
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(SteamPowerMain.textureFile+"SteamGUI.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
containerWidth = (this.width - this.xSize) / 2;
containerHeight = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
}
}

View file

@ -1,94 +0,0 @@
package steampower;
import java.text.DecimalFormat;
import net.minecraft.src.GuiContainer;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.StatCollector;
import org.lwjgl.opengl.GL11;
import steampower.boiler.TileEntityBoiler;
import basicpipes.pipes.api.Liquid;
public class GuiBoiler extends GuiContainer
{
private TileEntityBoiler boilerInventory;
public GuiBoiler(InventoryPlayer par1InventoryPlayer, TileEntityBoiler par2TileEntityGrinder)
{
super(new ContainerFake(par1InventoryPlayer, par2TileEntityGrinder));
this.boilerInventory = par2TileEntityGrinder;
}
/**
* Draw the foreground layer for the GuiContainer (everythin in front of the items)
*/
protected void drawGuiContainerForegroundLayer()
{
this.fontRenderer.drawString("Boiler", 60, 6, 4210752);
this.fontRenderer.drawString("Inventory", 8, this.ySize - 96 + 2, 4210752);
if(boilerInventory.hullHeat >=10000)
{
//this.fontRenderer.drawString("Heat Danger", (int)(105), 50, 4210752);
}
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
/**
* Draw the background layer for the GuiContainer (everything behind the items)
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(SteamPowerMain.textureFile+"BoilerGui.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize-1, this.ySize);
int var7;
int var8;
int var9;
int var10;
if (this.boilerInventory.getStoredLiquid(Liquid.WATER)> 0)
{
var7 = boilerInventory.getStoredLiquid(Liquid.WATER)*4 + 1;
this.drawTexturedModalRect(var5 + 29, var6 + 72 - var7, 176, 148 - var7, 23, var7);
}
if (this.boilerInventory.getStoredLiquid(Liquid.STEAM) > 0)
{
var8 = boilerInventory.getStoredLiquid(Liquid.STEAM)/14*4 + 1;
this.drawTexturedModalRect(var5 + 108, var6 + 72 - var8, 176, 90 - var8, 23, var8);
}
float precentH = Math.min(boilerInventory.hullHeat/1000 + 1, 10);
var9 = (int) Math.min(precentH*3.0F,30);
this.drawTexturedModalRect(var5 + 59, var6 + 70 - var9, 199, 71 - var9, 9, var9);
float precentSH = this.boilerInventory.heat/1000;
var10 = (int) Math.round(precentSH*5.33);
this.drawTexturedModalRect(var5 + 78, var6 + 16, 176, 14, var10, 16);
//debug
this.fontRenderer.drawString("NonGraphic Debug", (int)(200), 90, 000000);
this.fontRenderer.drawString("Water:"+this.boilerInventory.water+"/14", (int)(200), 100, 000000);
this.fontRenderer.drawString("Steam:"+this.boilerInventory.steam+"/140", (int)(200), 110, 000000);
}
public static String getWattDisplay(int watts)
{
String displayWatt;
if(watts > 1000)
{
displayWatt = roundTwoDecimals((double)watts/1000)+" MJ";
}
else
{
displayWatt = watts+" kJ";
}
return displayWatt;
}
public static double roundTwoDecimals(double d)
{
DecimalFormat twoDForm = new DecimalFormat("#.##");
return Double.valueOf(twoDForm.format(d));
}
}

View file

@ -1,62 +0,0 @@
package steampower;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
//ItemRenderHelperS.renderID
public class ItemRenderHelperS implements ISimpleBlockRenderingHandler {
public static ItemRenderHelperS instance = new ItemRenderHelperS();
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
private ModelGenerator modelGen = new ModelGenerator();
private ModelTank modelTank = new ModelTank(0f);
private ModelFurnace modelFurnace = new ModelFurnace();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
if(block.blockID == SteamPowerMain.genID)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1.3F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(SteamPowerMain.textureFile+"Generator.png"));
modelGen.RenderMain(0.0725F);
GL11.glPopMatrix();
}
if(block.blockID == SteamPowerMain.machine.blockID && metadata == 1)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(SteamPowerMain.textureFile+"tankTexture.png"));
modelTank.generalRender(0.0625F);
GL11.glPopMatrix();
}
if(block.blockID == SteamPowerMain.machine.blockID && metadata > 1 && metadata < 6)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float)1F, (float)0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(SteamPowerMain.textureFile+"Furnace.png"));
modelFurnace.genRender(0.0625F);
GL11.glPopMatrix();
}
}
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
public boolean shouldRender3DInInventory() {
return true;
}
public int getRenderId()
{
return renderID;
}
}

View file

@ -1,53 +0,0 @@
// Date: 8/14/2012 1:48:41 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelCenterTank extends ModelBase
{
ModelRenderer Block;
public ModelCenterTank(float par1)
{
textureWidth = 128;
textureHeight = 128;
//block
Block = new ModelRenderer(this, 0, 0);
Block.addBox(0F, 0F, 0F, 16, 16, 16);
Block.setRotationPoint(-8F, 8F, -8F);
Block.setTextureSize(128, 32);
Block.mirror = true;
setRotation(Block, 0F, 0F, 0F);
}
public void renderBlock(float f5)
{
Block.render(f5);
}
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);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,95 +0,0 @@
// Date: 8/14/2012 1:48:41 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelCornerTank extends ModelBase
{
//Corner
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape4;
public ModelCornerTank(float par1)
{
textureWidth = 128;
textureHeight = 128;
//corner
Shape1 = new ModelRenderer(this, 0, 1);
Shape1.addBox(0F, 0F, 0F, 1, 16, 20);
Shape1.setRotationPoint(7F, 8F, -7F);
Shape1.setTextureSize(128, 128);
Shape1.mirror = true;
setRotation(Shape1, 0F, -0.7853982F, 0F);
Shape2 = new ModelRenderer(this, 44, 0);
Shape2.addBox(0F, 0F, 0F, 2, 16, 2);
Shape2.setRotationPoint(-8F, 8F, 6F);
Shape2.setTextureSize(128, 128);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 44, 0);
Shape3.addBox(0F, 0F, 0F, 2, 16, 2);
Shape3.setRotationPoint(6F, 8F, -8F);
Shape3.setTextureSize(128, 128);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape6 = new ModelRenderer(this, 0, 44);
Shape6.addBox(0F, 0F, 0F, 1, 15, 13);
Shape6.setRotationPoint(-8F, 9F, -7F);
Shape6.setTextureSize(128, 128);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape7 = new ModelRenderer(this, 0, 73);
Shape7.addBox(0F, 0F, 0F, 14, 15, 1);
Shape7.setRotationPoint(-8F, 9F, -8F);
Shape7.setTextureSize(128, 128);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 0, 92);
Shape4.addBox(0F, 0F, 0F, 16, 1, 16);
Shape4.setRotationPoint(-8F, 8F, -8F);
Shape4.setTextureSize(128, 128);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
}
public void renderCorner(float f5)
{
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape6.render(f5);
Shape7.render(f5);
Shape4.render(f5);
}
@Override
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);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,109 +0,0 @@
// Date: 8/24/2012 1:44:37 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelEngine extends ModelBase
{
//fields
ModelRenderer Base;
ModelRenderer top;
ModelRenderer TopPiston;
ModelRenderer BottomPiston;
ModelRenderer center;
ModelRenderer C1;
ModelRenderer C2;
public ModelEngine()
{
textureWidth = 64;
textureHeight = 64;
Base = new ModelRenderer(this, 0, 20);
Base.addBox(-6F, 0F, -6F, 12, 8, 12);
Base.setRotationPoint(0F, 16F, 0F);
Base.setTextureSize(64, 64);
Base.mirror = true;
setRotation(Base, 0F, 0F, 0F);
top = new ModelRenderer(this, 0, 0);
top.addBox(-6F, 0F, -6F, 12, 8, 12);
top.setRotationPoint(0F, -8F, 0F);
top.setTextureSize(64, 64);
top.mirror = true;
setRotation(top, 0F, 0F, 0F);
TopPiston = new ModelRenderer(this, 0, 52);
TopPiston.addBox(-2F, 0F, -2F, 4, 8, 4);
TopPiston.setRotationPoint(0F, 0F, 0F);
TopPiston.setTextureSize(64, 64);
TopPiston.mirror = true;
setRotation(TopPiston, 0F, 0F, 0F);
BottomPiston = new ModelRenderer(this, 16, 52);
BottomPiston.addBox(-2F, 0F, -2F, 4, 8, 4);
BottomPiston.setRotationPoint(0F, 8F, 0F);
BottomPiston.setTextureSize(64, 64);
BottomPiston.mirror = true;
setRotation(BottomPiston, 0F, 0F, 0F);
center = new ModelRenderer(this, 32, 52);
center.addBox(-3F, 0F, -3F, 6, 6, 6);
//center.setRotationPoint(0F, 5F, 0F);
center.setTextureSize(64, 64);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
C1 = new ModelRenderer(this, 0, 41);
C1.addBox(-2F, -3F, 0F, 4, 6, 3);
C1.setRotationPoint(0F, 8F, 3F);
C1.setTextureSize(64, 64);
C1.mirror = true;
setRotation(C1, 0F, 0F, 0F);
C2 = new ModelRenderer(this, 15, 41);
C2.addBox(-2F, -3F, -3F, 4, 6, 3);
C2.setRotationPoint(0F, 8F, -3F);
C2.setTextureSize(64, 64);
C2.mirror = true;
setRotation(C2, 0F, 0F, 0F);
}
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);
//renderBot(f5);
//renderTop(f5);
}
public void renderBot(float f5)
{
Base.render(f5);
BottomPiston.render(f5);
}
public void renderTop(float f5)
{
top.render(f5);
TopPiston.render(f5);
C1.render(f5);
C2.render(f5);
}
public void renderMid(float f5,float p)
{
center.setRotationPoint(0F, p, 0F);
center.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,77 +0,0 @@
// Date: 8/14/2012 3:02:31 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelFurnace extends ModelBase
{
//fields
ModelRenderer Body;
ModelRenderer top;
ModelRenderer bottom;
ModelRenderer Shape1;
public ModelFurnace()
{
textureWidth = 256;
textureHeight = 256;
Body = new ModelRenderer(this, 0, 0);
Body.addBox(-8F, -8F, -8F, 14, 14, 12);
Body.setRotationPoint(1F, 18F, 1F);
Body.setTextureSize(64, 32);
Body.mirror = true;
setRotation(Body, 0F, 0F, 0F);
top = new ModelRenderer(this, 80, 20);
top.addBox(-8F, 0F, -8F, 16, 2, 16);
top.setRotationPoint(0F, 8F, 0F);
top.setTextureSize(64, 32);
top.mirror = true;
setRotation(top, 0F, 0F, 0F);
bottom = new ModelRenderer(this, 80, 0);
bottom.addBox(-8F, 22F, -8F, 16, 2, 16);
bottom.setRotationPoint(0F, 0F, 0F);
bottom.setTextureSize(64, 32);
bottom.mirror = true;
setRotation(bottom, 0F, 0F, 0F);
Shape1 = new ModelRenderer(this, 0, 27);
Shape1.addBox(-4F, -4F, 0F, 10, 8, 1);
Shape1.setRotationPoint(-1F, 16F, 5F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
}
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);
genRender(f5);
}
public void genRender(float f5)
{
Body.render(f5);
top.render(f5);
bottom.render(f5);
Shape1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,131 +0,0 @@
// Date: 8/27/2012 3:20:21 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelGenerator extends ModelBase
{
//fields
ModelRenderer BasePlate;
ModelRenderer LeftConnection;
ModelRenderer RightConnection;
ModelRenderer Mid;
ModelRenderer Mid2;
ModelRenderer front;
ModelRenderer front2;
ModelRenderer front3;
ModelRenderer Mid3;
ModelRenderer FrontConnector;
public ModelGenerator()
{
textureWidth = 128;
textureHeight = 128;
BasePlate = new ModelRenderer(this, 0, 0);
BasePlate.addBox(-7F, 0F, -7F, 14, 1, 14);
BasePlate.setRotationPoint(0F, 23F, 0F);
BasePlate.setTextureSize(128, 128);
BasePlate.mirror = true;
setRotation(BasePlate, 0F, 0F, 0F);
LeftConnection = new ModelRenderer(this, 0, 112);
LeftConnection.addBox(-2F, -2F, -2F, 2, 4, 4);
LeftConnection.setRotationPoint(-6F, 16F, 0F);
LeftConnection.setTextureSize(128, 128);
LeftConnection.mirror = true;
setRotation(LeftConnection, 0F, 0F, 0F);
RightConnection = new ModelRenderer(this, 12, 112);
RightConnection.addBox(0F, -2F, -2F, 2, 4, 4);
RightConnection.setRotationPoint(6F, 16F, 0F);
RightConnection.setTextureSize(128, 128);
RightConnection.mirror = true;
setRotation(RightConnection, 0F, 0F, 0F);
Mid = new ModelRenderer(this, 0, 29);
Mid.addBox(-4F, 0F, -6F, 8, 12, 12);
Mid.setRotationPoint(0F, 10F, 0F);
Mid.setTextureSize(128, 128);
Mid.mirror = true;
setRotation(Mid, 0F, 0F, 0F);
Mid2 = new ModelRenderer(this, 0, 53);
Mid2.addBox(-6F, 0F, -6F, 12, 8, 12);
Mid2.setRotationPoint(0F, 12F, 0F);
Mid2.setTextureSize(128, 128);
Mid2.mirror = true;
setRotation(Mid2, 0F, 0F, 0F);
front = new ModelRenderer(this, 20, 15);
front.addBox(-2F, -4F, 0F, 4, 8, 1);
front.setRotationPoint(0F, 16F, -7F);
front.setTextureSize(128, 128);
front.mirror = true;
setRotation(front, 0F, 0F, 0F);
front2 = new ModelRenderer(this, 0, 24);
front2.addBox(-4F, -2F, 0F, 8, 4, 1);
front2.setRotationPoint(0F, 16F, -7F);
front2.setTextureSize(128, 128);
front2.mirror = true;
setRotation(front2, 0F, 0F, 0F);
front3 = new ModelRenderer(this, 0, 16);
front3.addBox(-3F, -3F, 0F, 6, 6, 1);
front3.setRotationPoint(0F, 16F, -7F);
front3.setTextureSize(128, 128);
front3.mirror = true;
setRotation(front3, 0F, 0F, 0F);
Mid3 = new ModelRenderer(this, 40, 29);
Mid3.addBox(-5F, -1F, -6F, 10, 10, 12);
Mid3.setRotationPoint(0F, 12F, 0F);
Mid3.setTextureSize(128, 128);
Mid3.mirror = true;
setRotation(Mid3, 0F, 0F, 0F);
FrontConnector = new ModelRenderer(this, 0, 120);
FrontConnector.addBox(-2F, 0F, -2F, 4, 4, 4);
FrontConnector.setRotationPoint(0F, 14F, -6F);
FrontConnector.setTextureSize(128, 128);
FrontConnector.mirror = true;
setRotation(FrontConnector, 0F, 0F, 0F);
}
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);
}
public void RenderMain(float f5)
{
BasePlate.render(f5);
Mid.render(f5);
Mid2.render(f5);
front.render(f5);
front2.render(f5);
front3.render(f5);
Mid3.render(f5);
FrontConnector.render(f5);
}
public void RenderLeft(float f5)
{
LeftConnection.render(f5);
}
public void RenderRight(float f5)
{
RightConnection.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,148 +0,0 @@
// Date: 8/14/2012 1:48:41 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelTank extends ModelBase
{
//One Block Tank
ModelRenderer TANK_WALL_1;
ModelRenderer TANK_WALL_2;
ModelRenderer TANK_WALL_3;
ModelRenderer TANK_WALL_4;
ModelRenderer TANK_SUPPORT_1;
ModelRenderer TANK_TOP_1;
ModelRenderer TANK_WALL_5;
ModelRenderer TANK_SUPPORT_2;
ModelRenderer TANK_SUPPORT_3;
ModelRenderer TANK_WALL_6;
ModelRenderer TANK_TOP_2;
ModelRenderer TANK_TOP_3;
ModelRenderer TANK_VALVE;
public ModelTank(float par1)
{
textureWidth = 128;
textureHeight = 128;
TANK_WALL_1 = new ModelRenderer(this, 0, 49);
TANK_WALL_1.addBox(0F, 0F, 0F, 1, 12, 8,par1);
TANK_WALL_1.setRotationPoint(6F, 12F, -4F);
TANK_WALL_1.setTextureSize(128, 128);
TANK_WALL_1.mirror = true;
setRotation(TANK_WALL_1, 0F, 0F, 0F);
TANK_WALL_2 = new ModelRenderer(this, 0, 70);
TANK_WALL_2.addBox(0F, 0F, 0F, 1, 12, 7,par1);
TANK_WALL_2.setRotationPoint(-8F, 12F, -4F);
TANK_WALL_2.setTextureSize(128, 128);
TANK_WALL_2.mirror = true;
setRotation(TANK_WALL_2, 0F, 0F, 0F);
TANK_WALL_3 = new ModelRenderer(this, 0, 34);
TANK_WALL_3.addBox(0F, 0F, 0F, 8, 12, 1,par1);
TANK_WALL_3.setRotationPoint(0F, 12F, 8F);
TANK_WALL_3.setTextureSize(128, 128);
TANK_WALL_3.mirror = true;
setRotation(TANK_WALL_3, 0F, 2.617994F, 0F);
TANK_WALL_4 = new ModelRenderer(this, 0, 34);
TANK_WALL_4.addBox(0F, 0F, 0F, 8, 12, 1,par1);
TANK_WALL_4.setRotationPoint(0F, 12F, -8F);
TANK_WALL_4.setTextureSize(128, 128);
TANK_WALL_4.mirror = true;
setRotation(TANK_WALL_4, 0F, -0.5235988F, 0F);
TANK_SUPPORT_1 = new ModelRenderer(this, 43, 22);
TANK_SUPPORT_1.addBox(-1F, 0F, -8F, 2, 14, 16,par1);
TANK_SUPPORT_1.setRotationPoint(0F, 10F, 0F);
TANK_SUPPORT_1.setTextureSize(128, 128);
TANK_SUPPORT_1.mirror = true;
setRotation(TANK_SUPPORT_1, 0F, 0F, 0F);
TANK_TOP_1 = new ModelRenderer(this, 43, 11);
TANK_TOP_1.addBox(-8F, 0F, -4F, 16, 2, 8,par1);
TANK_TOP_1.setRotationPoint(0F, 10F, 0F);
TANK_TOP_1.setTextureSize(128, 128);
TANK_TOP_1.mirror = true;
setRotation(TANK_TOP_1, 0F, 0F, 0F);
TANK_WALL_5 = new ModelRenderer(this, 0, 34);
TANK_WALL_5.addBox(0F, 0F, 0F, 8, 12, 1,par1);
TANK_WALL_5.setRotationPoint(0F, 12F, -7F);
TANK_WALL_5.setTextureSize(128, 128);
TANK_WALL_5.mirror = true;
setRotation(TANK_WALL_5, 0F, -2.617994F, 0F);
TANK_SUPPORT_2 = new ModelRenderer(this, 0, 0);
TANK_SUPPORT_2.addBox(-1F, 0F, -9F, 2, 14, 18,par1);
TANK_SUPPORT_2.setRotationPoint(0F, 10F, 0F);
TANK_SUPPORT_2.setTextureSize(128, 128);
TANK_SUPPORT_2.mirror = true;
setRotation(TANK_SUPPORT_2, 0F, 1.047198F, 0F);
TANK_SUPPORT_3 = new ModelRenderer(this, 0, 0);
TANK_SUPPORT_3.addBox(-1F, 0F, -9F, 2, 14, 18,par1);
TANK_SUPPORT_3.setRotationPoint(0F, 10F, 0F);
TANK_SUPPORT_3.setTextureSize(128, 128);
TANK_SUPPORT_3.mirror = true;
setRotation(TANK_SUPPORT_3, 0F, -1.047198F, 0F);
TANK_WALL_6 = new ModelRenderer(this, 0, 34);
TANK_WALL_6.addBox(0F, 0F, 0F, 8, 12, 1,par1);
TANK_WALL_6.setRotationPoint(0F, 12F, 7F);
TANK_WALL_6.setTextureSize(128, 128);
TANK_WALL_6.mirror = true;
setRotation(TANK_WALL_6, 0F, 0.5235988F, 0F);
TANK_TOP_2 = new ModelRenderer(this, 43, 0);
TANK_TOP_2.addBox(-6F, 0F, -4F, 12, 2, 8,par1);
TANK_TOP_2.setRotationPoint(0F, 10F, 0F);
TANK_TOP_2.setTextureSize(128, 128);
TANK_TOP_2.mirror = true;
setRotation(TANK_TOP_2, 0F, 1.047198F, 0F);
TANK_TOP_3 = new ModelRenderer(this, 43, 0);
TANK_TOP_3.addBox(-6F, 0F, -4F, 12, 2, 8,par1);
TANK_TOP_3.setRotationPoint(0F, 10F, 0F);
TANK_TOP_3.setTextureSize(128, 128);
TANK_TOP_3.mirror = true;
setRotation(TANK_TOP_3, 0F, -1.047198F, 0F);
TANK_VALVE = new ModelRenderer(this, 84, 0);
TANK_VALVE.addBox(0F, 0F, 0F, 2, 1, 2,par1);
TANK_VALVE.setRotationPoint(-1F, 9F, -1F);
TANK_VALVE.setTextureSize(128, 128);
TANK_VALVE.mirror = true;
setRotation(TANK_VALVE, 0F, 0F, 0F);
}
@Override
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);
}
public void generalRender(float f5)
{
TANK_WALL_1.render(f5);
TANK_WALL_2.render(f5);
TANK_WALL_3.render(f5);
TANK_WALL_4.render(f5);
TANK_SUPPORT_1.render(f5);
TANK_TOP_1.render(f5);
TANK_WALL_5.render(f5);
TANK_SUPPORT_2.render(f5);
TANK_SUPPORT_3.render(f5);
TANK_WALL_6.render(f5);
TANK_TOP_2.render(f5);
TANK_TOP_3.render(f5);
TANK_VALVE.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,62 +0,0 @@
package steampower;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import steampower.boiler.TileEntityBoiler;
import basicpipes.pipes.api.MHelper;
public class RenderBoiler extends TileEntitySpecialRenderer
{
int type = 0;
private ModelTank model;
private ModelCenterTank model2;
private ModelCornerTank model3;
public RenderBoiler(float par1)
{
model = new ModelTank(par1);
model2 = new ModelCenterTank(par1);
model3 = new ModelCornerTank(par1);
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float d3) {
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
TileEntity[] connected = ((TileEntityBoiler)tileEntity).connectedBlocks;
int meta = 0;
if(connected[5] == null && connected[3] == null && connected[4] == null && connected[2] == null || ((TileEntityBoiler)tileEntity).tankCount < 2 )
{
bindTextureByName(SteamPowerMain.textureFile+"tankTexture.png");
model.generalRender(0.0625F);
}
else
if(MHelper.corner(tileEntity) == 0 || ((TileEntityBoiler)tileEntity).tankCount > 2)
{
bindTextureByName(SteamPowerMain.textureFile+"tankBlock.png");
model2.renderBlock(0.0625F);
}
else
{
int corner = MHelper.corner(tileEntity);
bindTextureByName(SteamPowerMain.textureFile+"CornerTank.png");
switch(corner)
{
case 1: GL11.glRotatef(270f, 0f, 1f, 0f);break;
case 2: GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 3: GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 4: GL11.glRotatef(180f, 0f, 1f, 0f);break;
}
model3.renderCorner(0.0625f);
}
GL11.glPopMatrix();
}
}

View file

@ -1,37 +0,0 @@
package steampower;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
public class RenderFurnace extends TileEntitySpecialRenderer
{
int type = 0;
private ModelFurnace model;
public RenderFurnace()
{
model = new ModelFurnace();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float d3) {
bindTextureByName(SteamPowerMain.textureFile+"Furnace.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
int meta = ((TileEntityMachine) tileEntity).getDirection();
switch(meta)
{
case 1:GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 2:GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 3:GL11.glRotatef(180f, 0f, 1f, 0f);break;
case 4:GL11.glRotatef(270f, 0f, 1f, 0f);break;
}
model.genRender(0.0625F);
GL11.glPopMatrix();
}
}

View file

@ -1,37 +0,0 @@
package steampower;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
public class RenderGenerator extends TileEntitySpecialRenderer
{
int type = 0;
private ModelGenerator model;
public RenderGenerator()
{
model = new ModelGenerator();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float d3) {
bindTextureByName(SteamPowerMain.textureFile+"Generator.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
switch(meta)
{
case 0:GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 1:GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 2:GL11.glRotatef(180f, 0f, 1f, 0f);break;
case 3:GL11.glRotatef(270f, 0f, 1f, 0f);break;
}
model.RenderMain(0.0625F);
GL11.glPopMatrix();
}
}

View file

@ -1,34 +0,0 @@
package steampower;
import net.minecraftforge.client.MinecraftForgeClient;
import steampower.boiler.TileEntityBoiler;
import steampower.burner.TileEntityFireBox;
import steampower.geared.RenderGearPiston;
import steampower.turbine.TileEntityGen;
import steampower.turbine.TileEntitySteamPiston;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class SteamClientProxy extends SteamProxy{
public void preInit()
{
MinecraftForgeClient.preloadTexture(SteamPowerMain.textureFile+"blocks.png");
MinecraftForgeClient.preloadTexture(SteamPowerMain.textureFile+"Items.png");
RenderingRegistry.registerBlockHandler(new ItemRenderHelperS());
}
@Override
public void init()
{
ClientRegistry.registerTileEntity(TileEntityBoiler.class, "boiler", new RenderBoiler(0f));
ClientRegistry.registerTileEntity(TileEntityFireBox.class, "fireBox", new RenderFurnace());
ClientRegistry.registerTileEntity(TileEntitySteamPiston.class, "generator", new RenderGearPiston());
ClientRegistry.registerTileEntity(TileEntityGen.class, "elecGen", new RenderGenerator());
}
public void postInit()
{
}
}

View file

@ -1,381 +0,0 @@
// Date: 10/1/2012 12:32:21 AM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package steampower.geared;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelGearPiston extends ModelBase
{
//fields
ModelRenderer PistonCover;
ModelRenderer RSpiston;
ModelRenderer LSpiston;
ModelRenderer RodPiston;
ModelRenderer Base;
ModelRenderer Front;
ModelRenderer BackCC;
ModelRenderer RightPipe;
ModelRenderer FrontCC;
ModelRenderer LeftCC;
ModelRenderer FrontPipe;
ModelRenderer Right;
ModelRenderer RightCC;
ModelRenderer Back;
ModelRenderer BackPipe;
ModelRenderer Left;
ModelRenderer LeftPipe;
ModelRenderer RigthF4;
ModelRenderer LeftF4;
ModelRenderer LeftF3;
ModelRenderer LeftF2;
ModelRenderer LeftF1;
ModelRenderer RigthF3;
ModelRenderer RigthF2;
ModelRenderer RigthF1;
ModelRenderer RigthGCC;
ModelRenderer RightSlide;
ModelRenderer midRod;
ModelRenderer RightRod2;
ModelRenderer LeftGCC;
ModelRenderer LeftRod2;
ModelRenderer LeftSlide2;
public ModelGearPiston()
{
textureWidth = 128;
textureHeight = 128;
PistonCover = new ModelRenderer(this, 13, 31);
PistonCover.addBox(0F, -9F, -3F, 6, 10, 6);
PistonCover.setRotationPoint(-3F, 20F, 0F);
PistonCover.setTextureSize(128, 128);
PistonCover.mirror = true;
setRotation(PistonCover, 0F, 0F, 0F);
RSpiston = new ModelRenderer(this, 0, 32);
RSpiston.addBox(-3F, -2F, -2F, 1, 7, 4);
RSpiston.setRotationPoint(1F, 3F, 0F);
RSpiston.setTextureSize(128, 128);
RSpiston.mirror = true;
setRotation(RSpiston, 0F, 0F, 0F);
LSpiston = new ModelRenderer(this, 0, 32);
LSpiston.addBox(-1F, -2F, -2F, 1, 7, 4);
LSpiston.setRotationPoint(2F, 3F, 0F);
LSpiston.setTextureSize(128, 128);
LSpiston.mirror = true;
setRotation(LSpiston, 0F, 0F, 0F);
RodPiston = new ModelRenderer(this, 0, 59);
RodPiston.addBox(-1F, -2F, -1.5F, 2, 13, 3);
RodPiston.setRotationPoint(0F, 8F, 0F);
RodPiston.setTextureSize(128, 128);
RodPiston.mirror = true;
setRotation(RodPiston, 0F, 0F, 0F);
Base = new ModelRenderer(this, 12, 49);
Base.addBox(0F, 0F, 0F, 10, 5, 10);
Base.setRotationPoint(-5F, 19F, -5F);
Base.setTextureSize(128, 128);
Base.mirror = true;
setRotation(Base, 0F, 0F, 0F);
Front = new ModelRenderer(this, 28, 68);
Front.addBox(-3F, 0F, 0F, 6, 12, 1);
Front.setRotationPoint(0F, 12F, -7F);
Front.setTextureSize(128, 128);
Front.mirror = true;
setRotation(Front, 0F, 0F, 0F);
BackCC = new ModelRenderer(this, 43, 68);
BackCC.addBox(-2F, -2F, 1F, 4, 4, 1);
BackCC.setRotationPoint(0F, 16F, 6F);
BackCC.setTextureSize(128, 128);
BackCC.mirror = true;
setRotation(BackCC, 0F, 0F, 0F);
RightPipe = new ModelRenderer(this, 12, 87);
RightPipe.addBox(0F, 0F, -2F, 2, 10, 4);
RightPipe.setRotationPoint(-6F, 14F, 0F);
RightPipe.setTextureSize(128, 128);
RightPipe.mirror = true;
setRotation(RightPipe, 0F, 0F, 0F);
FrontCC = new ModelRenderer(this, 43, 68);
FrontCC.addBox(-2F, -2F, -1F, 4, 4, 1);
FrontCC.setRotationPoint(0F, 16F, -7F);
FrontCC.setTextureSize(128, 128);
FrontCC.mirror = true;
setRotation(FrontCC, 0F, 0F, 0F);
LeftCC = new ModelRenderer(this, 43, 74);
LeftCC.addBox(0F, -2F, -2F, 1, 4, 4);
LeftCC.setRotationPoint(7F, 16F, 0F);
LeftCC.setTextureSize(128, 128);
LeftCC.mirror = true;
setRotation(LeftCC, 0F, 0F, 0F);
FrontPipe = new ModelRenderer(this, 28, 82);
FrontPipe.addBox(-2F, 0F, 0F, 4, 10, 2);
FrontPipe.setRotationPoint(0F, 14F, -6F);
FrontPipe.setTextureSize(128, 128);
FrontPipe.mirror = true;
setRotation(FrontPipe, 0F, 0F, 0F);
Right = new ModelRenderer(this, 12, 68);
Right.addBox(0F, 0F, -3F, 1, 12, 6);
Right.setRotationPoint(-7F, 12F, 0F);
Right.setTextureSize(128, 128);
Right.mirror = true;
setRotation(Right, 0F, 0F, 0F);
RightCC = new ModelRenderer(this, 43, 74);
RightCC.addBox(-1F, -2F, -2F, 1, 4, 4);
RightCC.setRotationPoint(-7F, 16F, 0F);
RightCC.setTextureSize(128, 128);
RightCC.mirror = true;
setRotation(RightCC, 0F, 0F, 0F);
Back = new ModelRenderer(this, 28, 68);
Back.addBox(-3F, 0F, 0F, 6, 12, 1);
Back.setRotationPoint(0F, 12F, 6F);
Back.setTextureSize(128, 128);
Back.mirror = true;
setRotation(Back, 0F, 0F, 0F);
BackPipe = new ModelRenderer(this, 28, 82);
BackPipe.addBox(-2F, 0F, -2F, 4, 10, 2);
BackPipe.setRotationPoint(0F, 14F, 6F);
BackPipe.setTextureSize(128, 128);
BackPipe.mirror = true;
setRotation(BackPipe, 0F, 0F, 0F);
Left = new ModelRenderer(this, 12, 68);
Left.addBox(0F, 0F, -3F, 1, 12, 6);
Left.setRotationPoint(6F, 12F, 0F);
Left.setTextureSize(128, 128);
Left.mirror = true;
setRotation(Left, 0F, 0F, 0F);
LeftPipe = new ModelRenderer(this, 12, 87);
LeftPipe.addBox(-2F, 0F, -2F, 2, 10, 4);
LeftPipe.setRotationPoint(6F, 14F, 0F);
LeftPipe.setTextureSize(128, 128);
LeftPipe.mirror = true;
setRotation(LeftPipe, 0F, 0F, 0F);
RigthF4 = new ModelRenderer(this, 0, 56);
RigthF4.addBox(-2F, 1F, 1F, 2, 1, 1);
RigthF4.setRotationPoint(-8F, 0F, 0F);
RigthF4.setTextureSize(128, 128);
RigthF4.mirror = true;
setRotation(RigthF4, 0F, 0F, 0F);
LeftF4 = new ModelRenderer(this, 0, 56);
LeftF4.addBox(0F, 1F, 1F, 2, 1, 1);
LeftF4.setRotationPoint(8F, 0F, 0F);
LeftF4.setTextureSize(128, 128);
LeftF4.mirror = true;
setRotation(LeftF4, 0.7853982F, 0F, 0F);
LeftF3 = new ModelRenderer(this, 0, 56);
LeftF3.addBox(0F, 1F, -2F, 2, 1, 1);
LeftF3.setRotationPoint(8F, 0F, 0F);
LeftF3.setTextureSize(128, 128);
LeftF3.mirror = true;
setRotation(LeftF3, 0.7853982F, 0F, 0F);
LeftF2 = new ModelRenderer(this, 0, 56);
LeftF2.addBox(0F, -2F, -2F, 2, 1, 1);
LeftF2.setRotationPoint(8F, 0F, 0F);
LeftF2.setTextureSize(128, 128);
LeftF2.mirror = true;
setRotation(LeftF2, 0.7853982F, 0F, 0F);
LeftF1 = new ModelRenderer(this, 0, 56);
LeftF1.addBox(0F, -2F, 1F, 2, 1, 1);
LeftF1.setRotationPoint(8F, 0F, 0F);
LeftF1.setTextureSize(128, 128);
LeftF1.mirror = true;
setRotation(LeftF1, 0.7853982F, 0F, 0F);
RigthF3 = new ModelRenderer(this, 0, 56);
RigthF3.addBox(-2F, 1F, -2F, 2, 1, 1);
RigthF3.setRotationPoint(-8F, 0F, 0F);
RigthF3.setTextureSize(128, 128);
RigthF3.mirror = true;
setRotation(RigthF3, 0F, 0F, 0F);
RigthF2 = new ModelRenderer(this, 0, 56);
RigthF2.addBox(-2F, -2F, 1F, 2, 1, 1);
RigthF2.setRotationPoint(-8F, 0F, 0F);
RigthF2.setTextureSize(128, 128);
RigthF2.mirror = true;
setRotation(RigthF2, 0F, 0F, 0F);
RigthF1 = new ModelRenderer(this, 0, 56);
RigthF1.addBox(-2F, -2F, -2F, 2, 1, 1);
RigthF1.setRotationPoint(-8F, 0F, 0F);
RigthF1.setTextureSize(128, 128);
RigthF1.mirror = true;
setRotation(RigthF1, 0F, 0F, 0F);
RigthGCC = new ModelRenderer(this, 12, 18);
RigthGCC.addBox(-2F, -2F, -2F, 2, 4, 4);
RigthGCC.setRotationPoint(-6F, 0F, 0F);
RigthGCC.setTextureSize(128, 128);
RigthGCC.mirror = true;
setRotation(RigthGCC, 0F, 0F, 0F);
RightSlide = new ModelRenderer(this, 0, 44);
RightSlide.addBox(0F, -2F, -2F, 1, 7, 4);
RightSlide.setRotationPoint(-4F, 0F, 0F);
RightSlide.setTextureSize(128, 128);
RightSlide.mirror = true;
setRotation(RightSlide, 0F, 0F, 0F);
LeftSlide2 = new ModelRenderer(this, 0, 27);
LeftSlide2.addBox(0F, 2F, -1F, 6, 2, 2);
LeftSlide2.setRotationPoint(-3F, 0F, 0F);
LeftSlide2.setTextureSize(128, 128);
LeftSlide2.mirror = true;
setRotation(LeftSlide2, 0F, 0F, 0F);
RightRod2 = new ModelRenderer(this, 0, 20);
RightRod2.addBox(0F, -1.5F, -1.5F, 2, 3, 3);
RightRod2.setRotationPoint(-6F, 0F, 0F);
RightRod2.setTextureSize(128, 128);
RightRod2.mirror = true;
setRotation(RightRod2, 0F, 0F, 0F);
LeftGCC = new ModelRenderer(this, 24, 18);
LeftGCC.addBox(-1F, -2F, -2F, 2, 4, 4);
LeftGCC.setRotationPoint(7F, 0F, 0F);
LeftGCC.setTextureSize(128, 128);
LeftGCC.mirror = true;
setRotation(LeftGCC, 0.7853982F, 0F, 0F);
LeftRod2 = new ModelRenderer(this, 0, 20);
LeftRod2.addBox(-3F, -1.5F, -1.5F, 2, 3, 3);
LeftRod2.setRotationPoint(7F, 0F, 0F);
LeftRod2.setTextureSize(128, 128);
LeftRod2.mirror = true;
setRotation(LeftRod2, 0F, 0F, 0F);
midRod = new ModelRenderer(this, 0, 32);
midRod.addBox(-1F, -2F, -2F, 1, 7, 4);
midRod.setRotationPoint(4F, 0F, 0F);
midRod.setTextureSize(128, 128);
midRod.mirror = true;
setRotation(midRod, 0F, 0F, 0F);
}
public void renderBody(float f5)
{
Base.render(f5);
PistonCover.render(f5);
}
public void renderGear(float f5)
{
//Rod connectors
LeftF4.render(f5);
LeftF3.render(f5);
LeftF2.render(f5);
LeftF1.render(f5);
RigthF4.render(f5);
RigthF3.render(f5);
RigthF2.render(f5);
RigthF1.render(f5);
RigthGCC.render(f5);
LeftGCC.render(f5);
}
public void renderR(float f5,int pos)
{
switch(pos)
{
case 0:
RSpiston.setRotationPoint(1F, 3F, 0F);
LSpiston.setRotationPoint(2F, 3F, 0F);
RodPiston.setRotationPoint(0F, 8F, 0F);
setRotation(RSpiston, 0F, 0F, 0F);
setRotation(LSpiston, 0F, 0F, 0F);
break;
case 1:
RodPiston.setRotationPoint(0F, 6F, 0F);
LSpiston.setRotationPoint(2F, 2F, 2F);
RSpiston.setRotationPoint(1F, 2F, 2F);
setRotation(LSpiston, -0.5235988F, 0F, 0F);
setRotation(RSpiston, -0.5235988F, 0F, 0F);
break;
case 2:
LSpiston.setRotationPoint(2F, 0F, 3F);
RSpiston.setRotationPoint(1F, 0F, 3F);
RodPiston.setRotationPoint(0F, 3F, 0F);
setRotation(RSpiston, -1.047198F, 0F, 0F);
setRotation(LSpiston, -1.047198F, 0F, 0F);
break;
case 3:
LSpiston.setRotationPoint(2F, -2F, 2F);
RSpiston.setRotationPoint(1F, -2F, 2F);
RodPiston.setRotationPoint(0F, 1F, 0F);
setRotation(LSpiston, -0.7853982F, 0F, 0F);
setRotation(RSpiston, -0.7853982F, 0F, 0F);
break;
case 4:
LSpiston.setRotationPoint(2F, -3F, 0F);
RSpiston.setRotationPoint(1F, -3F, 0F);
RodPiston.setRotationPoint(0F, 1F, 0F);
setRotation(LSpiston, 0F, 0F, 0F);
setRotation(RSpiston, 0F, 0F, 0F);
break;
case 5:
LSpiston.setRotationPoint(2F, -2F, -2F);
RSpiston.setRotationPoint(1F, -2F, -2F);
RodPiston.setRotationPoint(0F, 1F, 0F);
setRotation(LSpiston, 0.7853982F, 0F, 0F);
setRotation(RSpiston, 0.7853982F, 0F, 0F);
break;
case 6:
RSpiston.setRotationPoint(1F, 0F, -3F);
LSpiston.setRotationPoint(2F, 0F, -3F);
RodPiston.setRotationPoint(0F, 2F, 0F);
setRotation(RSpiston, 1.047198F, 0F, 0F);
setRotation(LSpiston, 1.047198F, 0F, 0F);
break;
case 7:
RodPiston.setRotationPoint(0F, 6F, 0F);
LSpiston.setRotationPoint(2F, 2F, -2F);
RSpiston.setRotationPoint(1F, 2F, -2F);
setRotation(LSpiston, 0.5235988F, 0F, 0F);
setRotation(RSpiston, 0.5235988F, 0F, 0F);
break;
}
//Piston Arm
RSpiston.render(f5);
LSpiston.render(f5);
RodPiston.render(f5);
//GearShaft
RightSlide.rotateAngleX = 0.7853982F * pos;
midRod.rotateAngleX = 0.7853982F * pos;
midRod.rotateAngleX = 0.7853982F * pos;
RightRod2.rotateAngleX = 0.7853982F * pos;
LeftRod2.rotateAngleX = 0.7853982F * pos;
LeftSlide2.rotateAngleX = 0.7853982F * pos;
RightSlide.render(f5);
midRod.render(f5);
RightRod2.render(f5);
LeftRod2.render(f5);
LeftSlide2.render(f5);
}
public void renderLeft(float f5)
{
Left.render(f5);
LeftPipe.render(f5);
LeftCC.render(f5);
}
public void renderRight(float f5)
{
Right.render(f5);
RightCC.render(f5);
RightPipe.render(f5);
}
public void renderFront(float f5)
{
Front.render(f5);
FrontCC.render(f5);
FrontPipe.render(f5);
}
public void renderBack(float f5)
{
Back.render(f5);
BackPipe.render(f5);
BackCC.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,51 +0,0 @@
package steampower.geared;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import steampower.SteamPowerMain;
import steampower.turbine.TileEntitySteamPiston;
public class RenderGearPiston extends TileEntitySpecialRenderer
{
private ModelGearPiston model;
public RenderGearPiston()
{
model = new ModelGearPiston();
}
public void renderTileEntityAt(TileEntitySteamPiston tileEntity, double d, double d1, double d2, float d3) {
bindTextureByName(SteamPowerMain.textureFile+"GearShaftPiston.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
switch(meta)
{
case 1:GL11.glRotatef(0f, 0f, 1f, 0f);break;
case 2:GL11.glRotatef(90f, 0f, 1f, 0f);break;
case 3:GL11.glRotatef(180f, 0f, 1f, 0f);break;
case 0:GL11.glRotatef(270f, 0f, 1f, 0f);break;
}
model.renderGear(0.0625F);
model.renderR(0.0625F,tileEntity.pos);
model.renderBody(0.0625F);
model.renderBack(0.0625F);
model.renderFront(0.0625F);
model.renderLeft(0.0625F);
model.renderRight(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity var1, double d, double d1,
double d2, float d3) {
this.renderTileEntityAt(((TileEntitySteamPiston)var1), d, d1, d2, d3);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 782 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

Some files were not shown because too many files have changed in this diff Show more