Merge remote-tracking branch 'steampower/master'

This commit is contained in:
DarkGuardsman 2013-08-28 14:04:58 -04:00
commit 244f31a805
25 changed files with 1559 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

View file

@ -0,0 +1,64 @@
package dark.mech.steam;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
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;
import dark.mech.steam.renders.ModelFurnace;
import dark.mech.steam.renders.ModelGenerator;
import dark.mech.steam.renders.ModelTank;
//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.blockBoiler.blockID && metadata >= 0 && metadata <= 3)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float) 1F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(SteamPowerMain.instance.PREFIX,SteamPowerMain.GUI_DIRECTORY + "tankTexture.png"));
modelTank.generalRender(0.0625F);
GL11.glPopMatrix();
}
if (block.blockID == SteamPowerMain.blockHeater.blockID && metadata >= 0 && metadata <= 3)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float) 1F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f);
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(new ResourceLocation(SteamPowerMain.instance.PREFIX,SteamPowerMain.GUI_DIRECTORY + "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

@ -0,0 +1,31 @@
package dark.mech.steam;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import dark.mech.steam.boiler.TileEntityBoiler;
import dark.mech.steam.renders.RenderBoiler;
import dark.mech.steam.renders.RenderGearPiston;
import dark.mech.steam.steamengine.TileEntitySteamPiston;
public class SteamClientProxy extends SteamProxy
{
public void preInit()
{
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());
}
public void postInit()
{
}
}

View file

@ -0,0 +1,99 @@
package dark.mech.steam;
import java.io.File;
import net.minecraft.block.Block;
import net.minecraftforge.common.Configuration;
import universalelectricity.prefab.network.PacketManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
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 dark.core.DarkMain;
import dark.core.ModPrefab;
import dark.mech.steam.boiler.BlockBoiler;
import dark.mech.steam.steamengine.BlockSteamPiston;
@Mod(modid = SteamPowerMain.MOD_NAME, name = SteamPowerMain.MOD_ID, version = DarkMain.VERSION, dependencies = ("after:" + DarkMain.MOD_ID))
@NetworkMod(channels = { SteamPowerMain.CHANNEL }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketManager.class)
public class SteamPowerMain extends ModPrefab
{
public static Configuration config = new Configuration((new File(cpw.mods.fml.common.Loader.instance().getConfigDir(), "SteamPower.cfg")));
public static final String MOD_ID = "SteamPower";
public static final String MOD_NAME = "Steam Power";
public static final String CHANNEL = MOD_ID;
// Blocks and items
public static Block blockHeater, blockPiston, blockBoiler;
// extra configs
public static int steamOutBoiler, boilerHeat, fireOutput;
@Instance
public static SteamPowerMain instance;
@SidedProxy(clientSide = "dark.SteamPower.SteamClientProxy", serverSide = "dark.SteamPower.SteamProxy")
public static SteamProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
instance = this;
NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
super.preInit(event);
GameRegistry.registerBlock(blockHeater, "SPHeater");
GameRegistry.registerBlock(blockPiston, "SPPiston");
GameRegistry.registerBlock(blockBoiler, "SPBoiler");
proxy.preInit();
}
@EventHandler
public void load(FMLInitializationEvent event)
{
super.init(event);
proxy.init();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
super.postInit(event);
proxy.postInit();
}
@Override
public String getDomain()
{
return "steam";
}
@Override
public void loadConfig()
{
config.load();
//blockHeater = new BlockHeaters(config.get("Heater", "HeaterBlockID", this.getNextID()).getInt());
blockPiston = new BlockSteamPiston(config.getBlock(Configuration.CATEGORY_BLOCK, "Piston", this.getNextID()).getInt());
blockBoiler = new BlockBoiler(config.get("Boiler", "BoilerBlockID", this.getNextID()).getInt());
steamOutBoiler = config.get("Boiler", "SteamPerCycle", 10).getInt();
boilerHeat = config.get("Boiler", "HeatNeeded", 4500).getInt();
fireOutput = config.get("Heater", "MaxOutputEnergy", 250).getInt();
config.save();
}
@Override
public void loadModMeta()
{
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,68 @@
package dark.mech.steam;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import dark.mech.steam.boiler.TileEntityBoiler;
import dark.mech.steam.steamengine.TileEntitySteamPiston;
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");
}
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

@ -0,0 +1,61 @@
package dark.mech.steam.boiler;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import dark.core.blocks.BlockMachine;
import dark.mech.steam.ItemRenderHelperS;
import dark.mech.steam.SteamPowerMain;
public class BlockBoiler extends BlockMachine
{
public BlockBoiler(int par1)
{
super("Boilers", SteamPowerMain.config, par1, Material.iron);
this.setCreativeTab(CreativeTabs.tabBlock);
this.setHardness(1f);
this.setResistance(3f);
}
@Override
public int damageDropped(int metadata)
{
return 0;
}
@Override
public TileEntity createNewTileEntity(World var1)
{
return new TileEntityBoiler();
}
@Override
public boolean isOpaqueCube()
{
return false;
}
@Override
public boolean renderAsNormalBlock()
{
return false;
}
@Override
public int getRenderType()
{
return ItemRenderHelperS.renderID;
}
@Override
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(par1, 1, 0));
}
}

View file

@ -0,0 +1,11 @@
package dark.mech.steam.boiler;
import net.minecraft.tileentity.TileEntity;
public class TileEntityBoiler extends TileEntity
{
public TileEntity[] connectedBlocks = new TileEntity[6];
public int tankCount;
}

View file

@ -0,0 +1,42 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -0,0 +1,83 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -0,0 +1,99 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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 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

@ -0,0 +1,66 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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 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

@ -0,0 +1,383 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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

@ -0,0 +1,122 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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 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

@ -0,0 +1,137 @@
// 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 dark.mech.steam.renders;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.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);
}
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

@ -0,0 +1,79 @@
package dark.mech.steam.renders;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import dark.client.renders.RenderMachine;
import dark.core.helpers.ConnectionHelper;
import dark.mech.steam.SteamPowerMain;
import dark.mech.steam.boiler.TileEntityBoiler;
public class RenderBoiler extends RenderMachine
{
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.instance.PREFIX, SteamPowerMain.MODEL_DIRECTORY + "tankTexture.png");
model.generalRender(0.0625F);
}
else if (ConnectionHelper.corner(tileEntity) == 0 || ((TileEntityBoiler) tileEntity).tankCount > 2)
{
bindTextureByName(SteamPowerMain.instance.PREFIX, SteamPowerMain.MODEL_DIRECTORY + "tankBlock.png");
model2.renderBlock(0.0625F);
}
else
{
int corner = ConnectionHelper.corner(tileEntity);
bindTextureByName(SteamPowerMain.instance.PREFIX, SteamPowerMain.MODEL_DIRECTORY + "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();
}
@Override
public ResourceLocation getTexture(int block, int meta)
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,55 @@
package dark.mech.steam.renders;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import dark.client.renders.RenderMachine;
import dark.mech.steam.SteamPowerMain;
public class RenderFurnace extends RenderMachine
{
int type = 0;
private ModelFurnace model;
public RenderFurnace()
{
model = new ModelFurnace();
}
@Override
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float d3)
{
bindTextureByName(SteamPowerMain.instance.PREFIX, SteamPowerMain.MODEL_DIRECTORY + "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 = te.worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.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.genRender(0.0625F);
GL11.glPopMatrix();
}
@Override
public ResourceLocation getTexture(int block, int meta)
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,69 @@
package dark.mech.steam.renders;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import dark.client.renders.RenderMachine;
import dark.mech.steam.SteamPowerMain;
import dark.mech.steam.steamengine.TileEntitySteamPiston;
public class RenderGearPiston extends RenderMachine
{
private ModelGearPiston model;
public RenderGearPiston()
{
model = new ModelGearPiston();
}
public void renderTileEntityAt(TileEntitySteamPiston tileEntity, double d, double d1, double d2, float d3)
{
bindTextureByName(SteamPowerMain.instance.PREFIX, SteamPowerMain.MODEL_DIRECTORY + "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, 0);//TODO fix
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);
}
@Override
public ResourceLocation getTexture(int block, int meta)
{
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,76 @@
package dark.mech.steam.steamengine;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import dark.core.blocks.BlockMachine;
import dark.mech.steam.SteamPowerMain;
public class BlockSteamPiston extends BlockMachine
{
public BlockSteamPiston(int par1)
{
super("SteamEngine", SteamPowerMain.config, par1, Material.iron);
}
@Override
public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{
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.setBlock(x, y, z, blockID, metadata + angle, 3);
}
else
{
par1World.setBlock(x, y, z, blockID, 0, 3);
}
return 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)
{
return new TileEntitySteamPiston();
}
@Override
public int idDropped(int par1, Random par2Random, int par3)
{
return this.blockID;
}
@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.isReplaceable()) && (var6 == 0 || blocksList[var6].blockMaterial.isReplaceable());
}
}

View file

@ -0,0 +1,14 @@
package dark.mech.steam.steamengine;
import dark.core.blocks.TileEntityMachine;
import dark.mech.steam.SteamPowerMain;
public class TileEntitySteamPiston extends TileEntityMachine
{
@Override
public String getChannel()
{
return SteamPowerMain.CHANNEL;
}
}