Added back in textures

This commit is contained in:
Calclavia 2012-10-28 15:19:21 +08:00
parent e66818447a
commit cbad7f40cd
37 changed files with 299 additions and 302 deletions

View file

@ -1,4 +0,0 @@
@echo off
cd resources
"..\..\7za.exe" a "..\jars\bin\minecraft.jar" "*"
pause

View file

@ -8,13 +8,15 @@ import net.minecraft.src.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import universalelectricity.core.UEConfig;
import universalelectricity.prefab.network.PacketManager;
import assemblyline.belts.BlockConveyorBelt;
import assemblyline.belts.TileEntityConveyorBelt;
import assemblyline.interaction.BlockInteraction;
import assemblyline.interaction.ItemMachine;
import assemblyline.interaction.BlockInteraction.InteractMachineMetadata;
import assemblyline.interaction.ItemBlockInteraction;
import assemblyline.interaction.TileEntityEjector;
import assemblyline.interaction.TileEntityMachineInput;
import assemblyline.interaction.TileEntityInjector;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
@ -44,24 +46,13 @@ public class AssemblyLine
public static final String CHANNEL = "AssemblyLine";
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "UniversalElectricity/AssemblyLine.cfg"));
public static int machineID = configurationProperties();
public static int machine2ID;
public static int beltBlockID;
public static boolean animationOn;
public static final String TEXTURE_PATH = "/textures";
public static final Block blockConveyorBelt = new BlockConveyorBelt(beltBlockID);
public static final Block blockMachine = new BlockInteraction(machineID);
public static final String TEXTURE_PATH = "/assemblyline/textures/";
public static int configurationProperties()
{
CONFIGURATION.load();
beltBlockID = Integer.parseInt(CONFIGURATION.getBlock(Configuration.CATEGORY_BLOCK, "BeltBlockID", 3003).value);
machineID = Integer.parseInt(CONFIGURATION.getBlock(Configuration.CATEGORY_BLOCK, "MachineID", 3005).value);
animationOn = Boolean.parseBoolean(CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "BeltAnimationOn", true).value);
CONFIGURATION.save();
return machineID;
}
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "UniversalElectricity/AssemblyLine.cfg"));
public static final int BLOCK_ID_PREFIX = 3003;
public static final Block blockConveyorBelt = new BlockConveyorBelt(UEConfig.getBlockConfigID(CONFIGURATION, "Conveyor Belt", BLOCK_ID_PREFIX));
public static final Block blockInteraction = new BlockInteraction(UEConfig.getBlockConfigID(CONFIGURATION, "Machine", BLOCK_ID_PREFIX+1));
@PreInit
public void preInit(FMLPreInitializationEvent event)
@ -69,7 +60,7 @@ public class AssemblyLine
instance = this;
NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
GameRegistry.registerBlock(blockConveyorBelt);
GameRegistry.registerBlock(blockMachine, ItemMachine.class);
GameRegistry.registerBlock(blockInteraction, ItemBlockInteraction.class);
proxy.preInit();
}
@ -78,14 +69,14 @@ public class AssemblyLine
{
GameRegistry.registerTileEntity(TileEntityConveyorBelt.class, "belt");
GameRegistry.registerTileEntity(TileEntityEjector.class, "ejector");
GameRegistry.registerTileEntity(TileEntityMachineInput.class, "scop");
GameRegistry.registerTileEntity(TileEntityInjector.class, "scop");
proxy.init();
// Names
LanguageRegistry.addName(new ItemStack(blockConveyorBelt, 1), "Coneveyor Belt");
LanguageRegistry.addName(new ItemStack(blockMachine, 1, 0), "Ejector");
LanguageRegistry.addName(new ItemStack(blockMachine, 1, 4), "MachineInput");
LanguageRegistry.addName(new ItemStack(blockMachine, 1, 8), "FutureBlock");
LanguageRegistry.addName(new ItemStack(blockMachine, 1, 12), "FutureBlock");
LanguageRegistry.addName(new ItemStack(blockInteraction, 1, InteractMachineMetadata.EJECTOR.metadata), InteractMachineMetadata.EJECTOR.name);
LanguageRegistry.addName(new ItemStack(blockInteraction, 1, InteractMachineMetadata.INJECTOR.metadata), InteractMachineMetadata.EJECTOR.name);
LanguageRegistry.addName(new ItemStack(blockInteraction, 1, 8), "FutureBlock");
LanguageRegistry.addName(new ItemStack(blockInteraction, 1, 12), "FutureBlock");
}
@PostInit
@ -96,11 +87,11 @@ public class AssemblyLine
{ "III", "MCM", 'I', Item.ingotIron, 'M', "motor", 'C', "basicCircuit" }));
// Rejector
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockMachine, 1, 0), new Object[]
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockInteraction, 1, 0), new Object[]
{ "WPW", "@R@", '@', "plateSteel", 'R', Item.redstone, 'P', Block.pistonBase, 'C', "basicCircuit", 'W', "copperWire" }));
// Retriever
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockMachine, 1, 4), new Object[]
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(blockInteraction, 1, 4), new Object[]
{ Block.dispenser, "basicCircuit" }));
proxy.postInit();
}

View file

@ -8,13 +8,11 @@ import net.minecraft.src.MathHelper;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import universalelectricity.prefab.BlockMachine;
import assemblyline.render.BeltRenderHelper;
import assemblyline.render.RenderHelper;
/**
* The block for the actual conveyor!
*
* @Oldauthors Calclavia,Elusivehawk
* @author DarkGuardsman
* The block for the actual conveyor belt!
* @author Calclavia, DarkGuardsman
*/
public class BlockConveyorBelt extends BlockMachine
{
@ -24,7 +22,7 @@ public class BlockConveyorBelt extends BlockMachine
this.setBlockBounds(0, 0, 0, 1, 0.3f, 1);
this.setTextureFile("/textures/items.png");
this.blockIndexInTexture = 0;
this.setCreativeTab(CreativeTabs.tabRedstone);
this.setCreativeTab(CreativeTabs.tabTransport);
}
@Override
public void onBlockPlacedBy(World par1World, int x, int y, int z, EntityLiving par5EntityLiving)
@ -71,7 +69,7 @@ public class BlockConveyorBelt extends BlockMachine
@Override
public int getRenderType()
{
return BeltRenderHelper.blockRenderId;
return RenderHelper.BLOCK_RENDER_ID;
}
@Override

View file

@ -176,8 +176,6 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
e.printStackTrace();
}
if (AssemblyLine.animationOn)
{
if (flip == true)
{
flip = false;
@ -186,10 +184,10 @@ public class TileEntityConveyorBelt extends TileEntityElectricityReceiver implem
{
flip = true;
}
this.wheelRotation -= this.speed;
}
}
}
@Override
public double wattRequest()

View file

@ -7,26 +7,54 @@ import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import universalelectricity.prefab.BlockMachine;
import assemblyline.AssemblyLine;
import assemblyline.render.BeltRenderHelper;
import assemblyline.render.RenderHelper;
/**
* A metadata block containing a bunch of machines with direction.
* @author Darkguardsman
*
*/
public class BlockInteraction extends BlockMachine
{
public static enum InteractMachineMetadata
{
EJECTOR("Ejector", 0), INJECTOR("Injector", 4);
public String name;
public int metadata;
InteractMachineMetadata(String name, int metadata)
{
this.name = name;
this.metadata = metadata;
}
public static InteractMachineMetadata getBase(int metadata)
{
if (metadata >= 0 && metadata < 4) { return InteractMachineMetadata.values()[0]; }
else if (metadata >= 4 && metadata < 8) { return InteractMachineMetadata.values()[4]; }
else if (metadata >= 8 && metadata < 12) { return InteractMachineMetadata.values()[8]; }
else { return InteractMachineMetadata.values()[12]; }
}
}
public BlockInteraction(int id)
{
super("Machine", id, Material.iron);
this.setCreativeTab(CreativeTabs.tabRedstone);
this.setCreativeTab(CreativeTabs.tabTransport);
}
public int damageDropped(int metadata)
{
if (metadata >= 0 && metadata < 4) { return 0; }
if (metadata >= 4 && metadata < 8) { return 4; }
if (metadata >= 8 && metadata < 12) { return 8; }
if (metadata >= 12 && metadata < 16) { return 12; }
return 0;
return InteractMachineMetadata.getBase(metadata).metadata;
}
public boolean onSneakUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
return this.onSneakMachineActivated(par1World, x, y, z, par5EntityPlayer);
}
public boolean onSneakMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer)
{
if (!par1World.isRemote)
{
@ -120,7 +148,7 @@ public class BlockInteraction extends BlockMachine
public TileEntity createNewTileEntity(World var1, int metadata)
{
if (metadata >= 0 && metadata < 4) { return new TileEntityEjector(); }
if (metadata >= 4 && metadata < 8) { return new TileEntityMachineInput(); }
if (metadata >= 4 && metadata < 8) { return new TileEntityInjector(); }
if (metadata >= 8 && metadata < 12) { return null; }
if (metadata >= 12 && metadata < 16) { return null; }
return null;
@ -129,7 +157,7 @@ public class BlockInteraction extends BlockMachine
@Override
public int getRenderType()
{
return BeltRenderHelper.blockRenderId;
return RenderHelper.BLOCK_RENDER_ID;
}
@Override

View file

@ -0,0 +1,58 @@
package assemblyline.interaction;
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.World;
import assemblyline.AssemblyLine;
import assemblyline.interaction.BlockInteraction.InteractMachineMetadata;
public class ItemBlockInteraction extends ItemBlock
{
public ItemBlockInteraction(int par1)
{
super(par1);
this.setHasSubtypes(true);
this.setCreativeTab(CreativeTabs.tabRedstone);
}
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
for (InteractMachineMetadata machine : InteractMachineMetadata.values())
{
par3List.add(new ItemStack(AssemblyLine.blockInteraction, 1, machine.metadata));
}
}
public String getItemNameIS(ItemStack itemstack)
{
return InteractMachineMetadata.getBase(itemstack.getItemDamage()).name;
}
@Override
public int getBlockID()
{
return AssemblyLine.blockInteraction.blockID;
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
int angle = MathHelper.floor_double((player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if (!world.setBlockAndMetadataWithNotify(x, y, z, this.getBlockID(), stack.getItemDamage() + angle)) { return false; }
if (world.getBlockId(x, y, z) == this.getBlockID())
{
Block.blocksList[this.getBlockID()].updateBlockMetadata(world, x, y, z, side, hitX, hitY, hitZ);
Block.blocksList[this.getBlockID()].onBlockPlacedBy(world, x, y, z, player);
}
return true;
}
}

View file

@ -1,83 +0,0 @@
package assemblyline.interaction;
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.World;
import assemblyline.AssemblyLine;
public class ItemMachine extends ItemBlock {
public ItemMachine(int par1) {
super(par1);
this.setHasSubtypes(true);
this.setCreativeTab(CreativeTabs.tabRedstone);
}
private String[] names = new String[] {"Ejector", "ItemScooper", "FB","FB"};
int blockID = AssemblyLine.machineID;
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
par3List.add(new ItemStack(AssemblyLine.blockMachine,1,0));
par3List.add(new ItemStack(AssemblyLine.blockMachine,1,4));
//par3List.add(new ItemStack(AssembleLine.blockMachine,1,8));
//par3List.add(new ItemStack(AssembleLine.blockMachine,1,12));
}
public String getItemNameIS(ItemStack itemstack)
{
int meta = itemstack.getItemDamage();
switch(meta)
{
case 0: return names[0];
case 4: return names[1];
case 8: return names[2];
case 12: return names[3];
}
return "FB";
}
@Override
public int getIconFromDamage(int i)
{
switch(i)
{
case 0:return 1;
case 4:return 2;
case 8:return 3;
case 12:return 4;
}
return this.iconIndex + i;
}
public int getMetadata(int par1)
{
return 0;
}
@Override
public int getBlockID()
{
return AssemblyLine.machineID;
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
int angle = MathHelper.floor_double((player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
player.sendChatToPlayer("M:"+stack.getItemDamage()+"A:"+angle);
if (!world.setBlockAndMetadataWithNotify(x, y, z, this.blockID, stack.getItemDamage()+angle))
{
return false;
}
if (world.getBlockId(x, y, z) == this.blockID)
{
Block.blocksList[this.blockID].updateBlockMetadata(world, x, y, z, side, hitX, hitY, hitZ);
Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player);
}
return true;
}
}

View file

@ -19,7 +19,7 @@ import universalelectricity.prefab.network.IPacketReceiver;
import com.google.common.io.ByteArrayDataInput;
public class TileEntityMachineInput extends TileEntityElectricityReceiver implements IPacketReceiver, IInventory
public class TileEntityInjector extends TileEntityElectricityReceiver implements IPacketReceiver, IInventory
{
public float energyReq = .1f;
public float energyMax = 10f;

View file

@ -1,21 +0,0 @@
[
{
"modid": "asmLine",
"name": "Assemble Line",
"description": "This mod is a revamp of Calclavia's and ElusiveHawk's Conveyor belts in the form of a factory assemble line",
"version": "0.0.4",
"mcversion": "1.3.2",
"url": "http://www.minecraftforge.net/forum/index.php/board,50.0.html",
"updateUrl": "",
"authors": [
"DarkGuardsman"
],
"credits": "Orignal Devs Calclavia,ElusiveHawk",
"logoFile": "",
"screenshots": [
],
"parent":"",
"dependencies": ["UE"
]
}
]

View file

@ -5,10 +5,11 @@ import assemblyline.AssemblyLine;
import assemblyline.ALCommonProxy;
import assemblyline.belts.TileEntityConveyorBelt;
import assemblyline.interaction.TileEntityEjector;
import assemblyline.interaction.TileEntityMachineInput;
import assemblyline.render.BeltRenderHelper;
import assemblyline.render.RenderBeltMain;
import assemblyline.render.RenderMachineBelt;
import assemblyline.interaction.TileEntityInjector;
import assemblyline.render.RenderEjector;
import assemblyline.render.RenderHelper;
import assemblyline.render.RenderConveyorBelt;
import assemblyline.render.RenderInjector;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
@ -18,15 +19,17 @@ public class ALClientProxy extends ALCommonProxy
public void preInit()
{
MinecraftForgeClient.preloadTexture(AssemblyLine.TEXTURE_PATH + "/Items.png");
RenderingRegistry.registerBlockHandler(new BeltRenderHelper());
RenderingRegistry.registerBlockHandler(new RenderHelper());
}
@Override
public void init()
{
//ClientRegistry.registerTileEntity(TileEntityConveyorBelt.class, "belt", new RenderConveyorBelt());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorBelt.class, new RenderBeltMain());
// ClientRegistry.registerTileEntity(TileEntityConveyorBelt.class,
// "belt", new RenderConveyorBelt());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityConveyorBelt.class, new RenderConveyorBelt());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEjector.class, new RenderEjector());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineInput.class,new RenderMachineBelt());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityInjector.class, new RenderInjector());
}
}

View file

@ -1,38 +0,0 @@
package assemblyline;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import assemblyline.interaction.TileEntityMachineInput;
public class RenderDropBox extends TileEntitySpecialRenderer
{
private ModelDropBox model = new ModelDropBox();
public void renderAModelAt(TileEntity tileEntity, double x, double y, double z, float f)
{
int face = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
int pos = 0;
bindTextureByName("/textures/DropBox.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if(face==4){ GL11.glRotatef(180f, 0f, 1f, 0f);}
if(face==6){ GL11.glRotatef(0f, 0f, 1f, 0f);}
if(face==5){ GL11.glRotatef(270f, 0f, 1f, 0f);}
if(face==7){ GL11.glRotatef(90f, 0f, 1f, 0f);}
model.render(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)
{
this.renderAModelAt((TileEntityMachineInput)tileEntity, var2, var4, var6, var8);
}
}

View file

@ -8,13 +8,15 @@ import net.minecraft.src.World;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiCrafting extends GuiContainer
public class GuiAutoCrafting extends GuiContainer
{
public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
public GuiAutoCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5)
{
super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5));
//TODO on opening if the user is not the owner they can see the crafting recipes but if
@ -36,7 +38,7 @@ public class GuiCrafting extends GuiContainer
*/
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture("/gui/crafting.png");
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH+"gui_crafting.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
int var5 = (this.width - this.xSize) / 2;

View file

@ -43,7 +43,7 @@ public class GuiEjectorSettings extends GuiContainer
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "/GuiEjector.png");
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "gui_ejector.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.renderEngine.bindTexture(var4);
containerWidth = (this.width - this.xSize) / 2;

View file

@ -1,4 +1,4 @@
package assemblyline.render;
package assemblyline.model;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;

View file

@ -1,4 +1,4 @@
package assemblyline;
package assemblyline.model;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;

View file

@ -4,7 +4,7 @@
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package assemblyline;
package assemblyline.model;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;

View file

@ -1,10 +1,10 @@
package assemblyline.render;
package assemblyline.model;
import net.minecraft.src.Entity;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;
public class ModelMachineBelt extends ModelBase
public class ModelInjector extends ModelBase
{
// fields
ModelRenderer bBELTLong;
@ -28,7 +28,7 @@ public class ModelMachineBelt extends ModelBase
ModelRenderer RCPanel;
ModelRenderer LCPanel;
public ModelMachineBelt()
public ModelInjector()
{
textureWidth = 128;
textureHeight = 128;
@ -155,7 +155,7 @@ public class ModelMachineBelt extends ModelBase
setRotation(LCPanel, 0F, 0F, 0F);
}
public void render(float f5, boolean cc, int pos)
public void render(float f5, boolean isLongBelt, int radians)
{
// body panels
BacPanel.render(f5);
@ -172,22 +172,20 @@ public class ModelMachineBelt extends ModelBase
BRL.render(f5);
BML.render(f5);
// rollers
MRoller.rotateAngleX = 0.7853982F * pos;
BRoller.rotateAngleX = 0.7853982F * pos;
FRoller.rotateAngleX = 0.7853982F * pos;
MRoller.rotateAngleX = radians;
BRoller.rotateAngleX = radians;
FRoller.rotateAngleX = radians;
MRoller.render(f5);
BRoller.render(f5);
FRoller.render(f5);
if (cc)
if (isLongBelt)
{
// long belt
tBELTLong.render(f5);
bBELTLong.render(f5);
}
else
{
// short belt
FBELT.render(f5);
tBELT.render(f5);
BBelt.render(f5);

View file

@ -1,60 +0,0 @@
package assemblyline.render;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import assemblyline.ModelEjector;
import assemblyline.belts.TileEntityConveyorBelt;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class BeltRenderHelper implements ISimpleBlockRenderingHandler {
public static BeltRenderHelper instance = new BeltRenderHelper();
public static int blockRenderId = RenderingRegistry.getNextAvailableRenderId();
private static TileEntityConveyorBelt belt = null;
private ModelConveyorBelt modelBelt = new ModelConveyorBelt();
private ModelEjector modelEj = new ModelEjector();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
if(block.blockID == assemblyline.AssemblyLine.beltBlockID)
{
//TileEntityRenderer.instance.renderTileEntityAt(belt, -0.5D, 0.0D, -0.5D, 0.0F);
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/BeltTexture.png"));
//bindTextureByName("/textures/BeltSingle.png");
modelBelt.render(0.0625F,0, false,false,false);
GL11.glPopMatrix();
}
if(block.blockID == assemblyline.AssemblyLine.machineID && metadata == 0)
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/textures/Ejector.png"));
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.6F, (float)1.5F, (float)0.6F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glRotatef(-90f, 0f, 1f, 0f);
modelEj.renderMain(0.0625F);
modelEj.renderPiston(0.0625F, 1);
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 blockRenderId;
}
}

View file

@ -6,8 +6,9 @@ import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import assemblyline.belts.TileEntityConveyorBelt;
import assemblyline.model.ModelConveyorBelt;
public class RenderBeltMain extends TileEntitySpecialRenderer
public class RenderConveyorBelt extends TileEntitySpecialRenderer
{
private ModelConveyorBelt model = new ModelConveyorBelt();

View file

@ -0,0 +1,43 @@
package assemblyline.render;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import assemblyline.interaction.TileEntityInjector;
import assemblyline.model.ModelDropBox;
public class RenderDropBox extends TileEntitySpecialRenderer
{
private ModelDropBox model = new ModelDropBox();
public void renderAModelAt(TileEntityInjector tileEntity, double x, double y, double z, float f)
{
int face = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
bindTextureByName(AssemblyLine.TEXTURE_PATH+"DropBox.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
switch(face)
{
case 4: GL11.glRotatef(180f, 0f, 1f, 0f); break;
case 6: GL11.glRotatef(0f, 0f, 1f, 0f); break;
case 5: GL11.glRotatef(270f, 0f, 1f, 0f); break;
case 7: GL11.glRotatef(90f, 0f, 1f, 0f); break;
}
System.out.println("RENDERIN DROP BOX");
model.render(0.0625F);
GL11.glPopMatrix();
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)
{
this.renderAModelAt((TileEntityInjector)tileEntity, var2, var4, var6, var8);
}
}

View file

@ -1,11 +1,13 @@
package assemblyline;
package assemblyline.render;
import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import assemblyline.interaction.TileEntityEjector;
import assemblyline.model.ModelEjector;
public class RenderEjector extends TileEntitySpecialRenderer
{
@ -17,7 +19,7 @@ public class RenderEjector extends TileEntitySpecialRenderer
int face = tileEntity.getDirection(tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
int pos = 0;
if(fire){pos = 8;}
bindTextureByName("/textures/Ejector.png");
bindTextureByName(AssemblyLine.TEXTURE_PATH+"ejector.png");
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);

View file

@ -0,0 +1,78 @@
package assemblyline.render;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import assemblyline.interaction.BlockInteraction.InteractMachineMetadata;
import assemblyline.model.ModelConveyorBelt;
import assemblyline.model.ModelEjector;
import assemblyline.model.ModelInjector;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class RenderHelper implements ISimpleBlockRenderingHandler
{
public static RenderHelper instance = new RenderHelper();
public static final int BLOCK_RENDER_ID = RenderingRegistry.getNextAvailableRenderId();
private ModelConveyorBelt modelConveyorBelt = new ModelConveyorBelt();
private ModelEjector modelEjector = new ModelEjector();
private ModelInjector modelInjector = new ModelInjector();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
if (block.blockID == AssemblyLine.blockConveyorBelt.blockID)
{
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/BeltTexture.png"));
modelConveyorBelt.render(0.0625F, 0, false, false, false);
GL11.glPopMatrix();
}
else if (block.blockID == AssemblyLine.blockInteraction.blockID)
{
if(metadata == InteractMachineMetadata.EJECTOR.metadata)
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/textures/Ejector.png"));
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glRotatef(-90f, 0f, 1f, 0f);
modelEjector.renderMain(0.0625F);
modelEjector.renderPiston(0.0625F, 1);
GL11.glPopMatrix();
}
else if(metadata == InteractMachineMetadata.INJECTOR.metadata)
{
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture("/textures/Ejector.png"));
GL11.glPushMatrix();
GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F);
GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glRotatef(-90f, 0f, 1f, 0f);
modelInjector.render(0.0625F, true, 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 BLOCK_RENDER_ID;
}
}

View file

@ -5,14 +5,16 @@ import net.minecraft.src.TileEntitySpecialRenderer;
import org.lwjgl.opengl.GL11;
import assemblyline.AssemblyLine;
import assemblyline.belts.TileEntityConveyorBelt;
import assemblyline.interaction.TileEntityMachineInput;
import assemblyline.interaction.TileEntityInjector;
import assemblyline.model.ModelInjector;
public class RenderMachineBelt extends TileEntitySpecialRenderer
public class RenderInjector extends TileEntitySpecialRenderer
{
private ModelMachineBelt model = new ModelMachineBelt();
private ModelInjector model = new ModelInjector();
public void renderAModelAt(TileEntityMachineInput tileEntity, double x, double y, double z, float f)
public void renderAModelAt(TileEntityInjector tileEntity, double x, double y, double z, float f)
{
String flip = "";//if(tileEntity.flip){flip = "F";}
int face = tileEntity.getBeltDirection();
@ -21,16 +23,17 @@ public class RenderMachineBelt extends TileEntitySpecialRenderer
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glRotatef(180f, 0f, 0f, 1f);
int pos = 0;
bindTextureByName("/textures/machineBelt.png");
this.bindTextureByName(AssemblyLine.TEXTURE_PATH+"injector.png");
if(face==2){ GL11.glRotatef(0f, 0f, 1f, 0f);}
if(face==3){ GL11.glRotatef(180f, 0f, 1f, 0f);}
if(face==4){ GL11.glRotatef(270f, 0f, 1f, 0f);}
if(face==5){ GL11.glRotatef(90f, 0f, 1f, 0f);}
int ent = tileEntity.worldObj.getBlockId(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
model.render(0.0625F, true,pos);//TODO change the true part to check if there is a TE on the input side
model.render(0.0625F, true, 0);
//TODO change the true part to check if there is a TE on the input side
System.out.println("RENDERING MACHINE BELT");
GL11.glPopMatrix();
}
@ -38,7 +41,7 @@ public class RenderMachineBelt extends TileEntitySpecialRenderer
@Override
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8)
{
this.renderAModelAt((TileEntityMachineInput)tileEntity, var2, var4, var6, var8);
this.renderAModelAt((TileEntityInjector)tileEntity, var2, var4, var6, var8);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B