Textures mostly done

Detector and turntable have yet to be finished but i've run out of time
to work on this today. If no one else fixes it by tommorow i will work
on it.
This commit is contained in:
Rseifert 2013-03-18 01:10:02 -04:00
parent 9df766ce28
commit c5d47c43cc
17 changed files with 116 additions and 49 deletions

View file

@ -14,6 +14,7 @@ import assemblyline.client.render.RenderConveyorBelt;
import assemblyline.client.render.RenderCraneController; import assemblyline.client.render.RenderCraneController;
import assemblyline.client.render.RenderCraneFrame; import assemblyline.client.render.RenderCraneFrame;
import assemblyline.client.render.RenderCrate; import assemblyline.client.render.RenderCrate;
import assemblyline.client.render.RenderDetector;
import assemblyline.client.render.RenderManipulator; import assemblyline.client.render.RenderManipulator;
import assemblyline.client.render.RenderRejector; import assemblyline.client.render.RenderRejector;
import assemblyline.common.AssemblyLine; import assemblyline.common.AssemblyLine;
@ -25,6 +26,7 @@ import assemblyline.common.machine.armbot.TileEntityArmbot;
import assemblyline.common.machine.belt.TileEntityConveyorBelt; import assemblyline.common.machine.belt.TileEntityConveyorBelt;
import assemblyline.common.machine.crane.TileEntityCraneController; import assemblyline.common.machine.crane.TileEntityCraneController;
import assemblyline.common.machine.crane.TileEntityCraneRail; import assemblyline.common.machine.crane.TileEntityCraneRail;
import assemblyline.common.machine.detector.TileEntityDetector;
import assemblyline.common.machine.encoder.TileEntityEncoder; import assemblyline.common.machine.encoder.TileEntityEncoder;
import assemblyline.common.machine.imprinter.TileEntityImprinter; import assemblyline.common.machine.imprinter.TileEntityImprinter;
import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.ClientRegistry;
@ -49,6 +51,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityManipulator.class, new RenderManipulator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityManipulator.class, new RenderManipulator());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new RenderCrate()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new RenderCrate());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArmbot.class, new RenderArmbot()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArmbot.class, new RenderArmbot());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDetector.class, new RenderDetector());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneController.class, new RenderCraneController()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneController.class, new RenderCraneController());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneRail.class, new RenderCraneFrame()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraneRail.class, new RenderCraneFrame());
} }

View file

@ -41,7 +41,7 @@ public class GuiAutoCrafting extends GuiContainer
*/ */
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "gui_crafting.png"); int var4 = this.mc.renderEngine.getTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_crafting.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int var5 = (this.width - this.xSize) / 2; int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2; int var6 = (this.height - this.ySize) / 2;

View file

@ -309,7 +309,7 @@ public class GuiEncoder extends GuiContainer implements IInventoryWatcher
@Override @Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "gui_encoder.png"); int var4 = this.mc.renderEngine.getTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_encoder.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawTexturedModalRect(containerWidth, containerHeight + ContainerEncoder.Y_OFFSET, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(containerWidth, containerHeight + ContainerEncoder.Y_OFFSET, 0, 0, this.xSize, this.ySize);

View file

@ -40,7 +40,7 @@ public class GuiImprinter extends GuiContainer
@Override @Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{ {
int var4 = this.mc.renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "gui_imprinter.png"); int var4 = this.mc.renderEngine.getTexture(AssemblyLine.GUI_TEXTURES_PATH + "gui_imprinter.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.containerWidth = (this.width - this.xSize) / 2; this.containerWidth = (this.width - this.xSize) / 2;
this.containerHeight = (this.height - this.ySize) / 2; this.containerHeight = (this.height - this.ySize) / 2;

View file

@ -33,13 +33,13 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F); GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F);
GL11.glRotatef(180f, 0f, 0f, 1f); GL11.glRotatef(180f, 0f, 0f, 1f);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "belt/frame0.png")); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + "belt/frame0.png"));
modelConveyorBelt.render(0.0625F, 0, false, false, false, false); modelConveyorBelt.render(0.0625F, 0, false, false, false, false);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else if (block.blockID == AssemblyLine.blockRejector.blockID) else if (block.blockID == AssemblyLine.blockRejector.blockID)
{ {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "rejector.png")); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + "rejector.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F); GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F);
GL11.glRotatef(180f, 0f, 0f, 1f); GL11.glRotatef(180f, 0f, 0f, 1f);
@ -50,7 +50,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
} }
else if (block.blockID == AssemblyLine.blockManipulator.blockID) else if (block.blockID == AssemblyLine.blockManipulator.blockID)
{ {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + "manipulator1.png")); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + "manipulator1.png"));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F); GL11.glTranslatef((float) 0.6F, (float) 1.5F, (float) 0.6F);
GL11.glRotatef(180f, 0f, 0f, 1f); GL11.glRotatef(180f, 0f, 0f, 1f);
@ -60,7 +60,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
} }
else if (block.blockID == AssemblyLine.blockArmbot.blockID) else if (block.blockID == AssemblyLine.blockArmbot.blockID)
{ {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + RenderArmbot.TEXTURE)); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + RenderArmbot.TEXTURE));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(0.4f, 0.8f, 0f); GL11.glTranslatef(0.4f, 0.8f, 0f);
GL11.glScalef(0.7f, 0.7f, 0.7f); GL11.glScalef(0.7f, 0.7f, 0.7f);
@ -71,7 +71,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
} }
else if (block.blockID == AssemblyLine.blockCraneController.blockID) else if (block.blockID == AssemblyLine.blockCraneController.blockID)
{ {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + RenderCraneController.TEXTURE)); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + RenderCraneController.TEXTURE));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(0f, 1f, 0f); GL11.glTranslatef(0f, 1f, 0f);
GL11.glRotatef(180f, 0f, 0f, 1f); GL11.glRotatef(180f, 0f, 0f, 1f);
@ -81,7 +81,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
} }
else if (block.blockID == AssemblyLine.blockCraneFrame.blockID) else if (block.blockID == AssemblyLine.blockCraneFrame.blockID)
{ {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.TEXTURE_PATH + RenderCraneFrame.TEXTURE)); GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(AssemblyLine.MODEL_TEXTURES_PATH + RenderCraneFrame.TEXTURE));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef(0f, 1f, 0f); GL11.glTranslatef(0f, 1f, 0f);
GL11.glRotatef(180f, 0f, 0f, 1f); GL11.glRotatef(180f, 0f, 0f, 1f);

View file

@ -43,7 +43,7 @@ public class RenderArmbot extends TileEntitySpecialRenderer
} }
} }
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + TEXTURE); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + TEXTURE);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F); GL11.glScalef(1.0F, -1F, -1F);

View file

@ -51,7 +51,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
if (slantType == SlantType.UP) if (slantType == SlantType.UP)
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "slantedbelt/frame" + frame + ".png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "slantedbelt/frame" + frame + ".png");
GL11.glTranslatef(0f, 0.8f, -0.8f); GL11.glTranslatef(0f, 0.8f, -0.8f);
GL11.glRotatef(180f, 0f, 1f, 1f); GL11.glRotatef(180f, 0f, 1f, 1f);
boolean slantAdjust = false; boolean slantAdjust = false;
@ -71,7 +71,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
} }
else if (slantType == SlantType.DOWN) else if (slantType == SlantType.DOWN)
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "slantedbelt/frame" + frame + ".png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "slantedbelt/frame" + frame + ".png");
GL11.glRotatef(180f, 0f, 1f, 0f); GL11.glRotatef(180f, 0f, 1f, 0f);
boolean slantAdjust = false; boolean slantAdjust = false;
TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord - tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord - tileEntity.getDirection().offsetZ); TileEntity test = tileEntity.worldObj.getBlockTileEntity(tileEntity.xCoord - tileEntity.getDirection().offsetX, tileEntity.yCoord, tileEntity.zCoord - tileEntity.getDirection().offsetZ);
@ -91,7 +91,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
} }
else else
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "belt/frame" + frame + ".png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "belt/frame" + frame + ".png");
GL11.glRotatef(180, 0f, 1f, 0f); GL11.glRotatef(180, 0f, 1f, 0f);
GL11.glTranslatef(0f, -0.68f, 0f); GL11.glTranslatef(0f, -0.68f, 0f);
MODEL.render(0.0625f, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false, false); MODEL.render(0.0625f, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false, false);
@ -115,7 +115,7 @@ public class RenderConveyorBelt extends TileEntitySpecialRenderer
break; break;
} }
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "belt/frame" + frame + ".png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "belt/frame" + frame + ".png");
MODEL.render(0.0625F, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false, true); MODEL.render(0.0625F, (float) Math.toRadians(tileEntity.wheelRotation), tileEntity.getIsLastBelt(), tileEntity.getIsFirstBelt(), false, true);
} }

View file

@ -24,7 +24,7 @@ public class RenderCraneController extends RenderImprintable
{ {
if (tileEntity != null && tileEntity instanceof TileEntityCraneController) if (tileEntity != null && tileEntity instanceof TileEntityCraneController)
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + (((TileEntityCraneController) tileEntity).isCraneValid() ? TEXTURE_VALID : TEXTURE)); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + (((TileEntityCraneController) tileEntity).isCraneValid() ? TEXTURE_VALID : TEXTURE));
ForgeDirection front = ForgeDirection.getOrientation(tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)); ForgeDirection front = ForgeDirection.getOrientation(tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord));
ForgeDirection right = CraneHelper.rotateClockwise(front); ForgeDirection right = CraneHelper.rotateClockwise(front);
float angle = 0f; float angle = 0f;

View file

@ -41,7 +41,7 @@ public class RenderCraneFrame extends TileEntitySpecialRenderer
boolean renderFoot = tileEntity.worldObj.isBlockSolidOnSide(tX, tY - 1, tZ, ForgeDirection.UP); boolean renderFoot = tileEntity.worldObj.isBlockSolidOnSide(tX, tY - 1, tZ, ForgeDirection.UP);
if ((renderLeft && renderRight) || (renderFront && renderBack)) if ((renderLeft && renderRight) || (renderFront && renderBack))
renderFoot = false; renderFoot = false;
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + TEXTURE); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + TEXTURE);
glPushMatrix(); glPushMatrix();
glTranslated(x + 0.5, y + 1.5, z + 0.5); glTranslated(x + 0.5, y + 1.5, z + 0.5);
glRotatef(180f, 0f, 0f, 1f); glRotatef(180f, 0f, 0f, 1f);

View file

@ -0,0 +1,56 @@
package assemblyline.client.render;
import static assemblyline.client.model.ModelHelper.drawCuboid;
import static assemblyline.client.model.ModelHelper.setGlobalTextureResolution;
import static assemblyline.client.model.ModelHelper.setTextureClip;
import static assemblyline.client.model.ModelHelper.setTextureSubResolution;
import static org.lwjgl.opengl.GL11.glPopMatrix;
import static org.lwjgl.opengl.GL11.glPushMatrix;
import static org.lwjgl.opengl.GL11.glTranslated;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.ForgeHooksClient;
import universalelectricity.core.vector.Vector3;
import assemblyline.client.model.ModelHelper;
import assemblyline.common.AssemblyLine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderDetector extends RenderImprintable
{
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
{
super.renderTileEntityAt(tileEntity, x, y, z, var8);
}
public static void render(boolean isInverted, Vector3 position)
{
glPushMatrix();
glTranslated(position.x, position.y, position.z);
if (isInverted)
{
//ForgeHooksClient.bindTexture(AssemblyLine.BLOCK_TEXTURES_PATH + "detector_red.png", 0);
}
else
{
//ForgeHooksClient.bindTexture(AssemblyLine.BLOCK_TEXTURES_PATH + "detector_green.png", 0);
}
setGlobalTextureResolution(128, 128);
setTextureClip(false);
ModelHelper.setTextureOffset(0, 64);
setTextureSubResolution(64, 64);
drawCuboid(0.45f, 12f / 16f, 0.45f, 2f / 16f, 4f / 16f, 2f / 16f); // stand
ModelHelper.setTextureOffset(0, 0);
setTextureSubResolution(128, 64);
drawCuboid(0.25f, 0.25f, 0.25f, 8f / 16f, 8f / 16f, 8f / 16f); // block
ModelHelper.setTextureOffset(64, 64);
setTextureSubResolution(64, 32);
drawCuboid(0.375f, 0.25f - (1f / 16f), 0.375f, 4f / 16f, 1f / 16f, 4f / 16f); // lens
glPopMatrix();
}
}

View file

@ -22,11 +22,11 @@ public class RenderManipulator extends RenderImprintable
if (tileEntity.isOutput()) if (tileEntity.isOutput())
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "manipulator1.png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "manipulator1.png");
} }
else else
{ {
this.bindTextureByName(AssemblyLine.TEXTURE_PATH + "manipulator2.png"); this.bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "manipulator2.png");
} }
if (face == 2) if (face == 2)

View file

@ -22,7 +22,7 @@ public class RenderRejector extends RenderImprintable
{ {
pos = 8; pos = 8;
} }
bindTextureByName(AssemblyLine.TEXTURE_PATH + "rejector.png"); bindTextureByName(AssemblyLine.MODEL_TEXTURES_PATH + "rejector.png");
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F); GL11.glScalef(1.0F, -1F, -1F);

View file

@ -57,16 +57,20 @@ public class AssemblyLine
public static final String NAME = "Assembly Line"; public static final String NAME = "Assembly Line";
public static final String VERSION = "0.2.8"; public static final String VERSION = "0.3.0";
public static final String CHANNEL = "AssemblyLine"; public static final String CHANNEL = "AssemblyLine";
public static final String DIRECTORY_NO_SLASH = "mods/assemblyline/"; public static final String DIRECTORY_NO_SLASH = "mods/assemblyline/";
public static final String DIRECTORY = "/" + DIRECTORY_NO_SLASH; public static final String DIRECTORY = "/" + DIRECTORY_NO_SLASH;
public static final String TEXTURE_PATH = DIRECTORY + "textures/"; public static final String TEXTURE_PATHS = DIRECTORY + "textures/";
public static final String LANGUAGE_PATH = DIRECTORY + "language/"; public static final String MODEL_TEXTURES_PATH = TEXTURE_PATHS + "models/";
public static final String BLOCK_TEXTURE_PATH = TEXTURE_PATH + "blocks.png"; public static final String BLOCK_TEXTURES_PATH = TEXTURE_PATHS + "blocks/";
public static final String ITEM_TEXTURE_PATH = TEXTURE_PATH + "items.png"; public static final String ITEM_TEXTURES_PATH = TEXTURE_PATHS + "items/";
public static final String GUI_TEXTURES_PATH = TEXTURE_PATHS + "guis/";
public static final String LANGUAGE_PATH = DIRECTORY + "languages/";
public static final String TEXTURE_NAME_PREFIX = "assemblyline:";
private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" }; private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" };

View file

@ -40,7 +40,7 @@ public class BlockCrate extends BlockALMachine
@Override @Override
public void func_94332_a(IconRegister iconReg) public void func_94332_a(IconRegister iconReg)
{ {
this.crate_icon = iconReg.func_94245_a("crate"); this.crate_icon = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"crate");
} }
@Override @Override

View file

@ -1,7 +1,5 @@
package assemblyline.common.machine.detector; package assemblyline.common.machine.detector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -13,8 +11,11 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import universalelectricity.core.UniversalElectricity; import universalelectricity.core.UniversalElectricity;
import assemblyline.common.AssemblyLine;
import assemblyline.common.TabAssemblyLine; import assemblyline.common.TabAssemblyLine;
import assemblyline.common.machine.imprinter.BlockImprintable; import assemblyline.common.machine.imprinter.BlockImprintable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** /**
* @author Briman0094 * @author Briman0094
@ -23,6 +24,7 @@ public class BlockDetector extends BlockImprintable
{ {
Icon eye_red; Icon eye_red;
Icon eye_green; Icon eye_green;
public BlockDetector(int blockID, int texture) public BlockDetector(int blockID, int texture)
{ {
super("detector", blockID, UniversalElectricity.machine, TabAssemblyLine.INSTANCE); super("detector", blockID, UniversalElectricity.machine, TabAssemblyLine.INSTANCE);
@ -59,17 +61,18 @@ public class BlockDetector extends BlockImprintable
change = ForgeDirection.UP.ordinal(); change = ForgeDirection.UP.ordinal();
} }
world.setBlockMetadataWithNotify(x, y, z, change,3); world.setBlockMetadataWithNotify(x, y, z, change, 3);
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public void func_94332_a(IconRegister iconReg) public void func_94332_a(IconRegister iconReg)
{ {
super.func_94332_a(iconReg); super.func_94332_a(iconReg);
this.eye_green = iconReg.func_94245_a("detector_green"); this.eye_green = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX + "detector_green");
this.eye_red = iconReg.func_94245_a("detector_red"); this.eye_red = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX + "detector_red");
} }
@Override @Override
public Icon getBlockTexture(IBlockAccess iBlockAccess, int x, int y, int z, int side) public Icon getBlockTexture(IBlockAccess iBlockAccess, int x, int y, int z, int side)
{ {
@ -92,7 +95,7 @@ public class BlockDetector extends BlockImprintable
return this.machine_icon; return this.machine_icon;
} }
@Override @Override
public Icon getBlockTextureFromSideAndMetadata(int side, int metadata) public Icon getBlockTextureFromSideAndMetadata(int side, int metadata)
{ {
@ -103,22 +106,21 @@ public class BlockDetector extends BlockImprintable
return this.machine_icon; return this.machine_icon;
} }
@Override @Override
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
{ {
world.setBlockMetadataWithNotify(x, y, z, side,3); world.setBlockMetadataWithNotify(x, y, z, side, 3);
return true; return true;
} }
@Override @Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID) public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{ {
if (!canBlockStay(world, x, y, z)) if (!canBlockStay(world, x, y, z))
{ {
this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); this.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
world.setBlockAndMetadataWithNotify(x, y, z, 0,0,3); world.setBlockAndMetadataWithNotify(x, y, z, 0, 0, 3);
} }
} }

View file

@ -29,21 +29,22 @@ public class BlockEncoder extends BlockALMachine
@Override @Override
public void func_94332_a(IconRegister iconReg) public void func_94332_a(IconRegister iconReg)
{ {
this.encoder_side = iconReg.func_94245_a("encoder_side"); this.encoder_side = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"encoder_side");
this.encoder_top = iconReg.func_94245_a("encoder_top"); this.encoder_top = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"encoder_top");
this.encoder_bottom = iconReg.func_94245_a("encoder_bottom"); this.encoder_bottom = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"encoder_bottom");
} }
/** /**
* Returns the block texture based on the side being looked at. Args: side * Returns the block texture based on the side being looked at. Args: side
*/ */
public Icon getBlockTextureFromSide(int side, int meta) @Override
public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if (side == 0) if (side == 1)
{ {
return this.encoder_top; return this.encoder_top;
} }
else if (side == 1) else if (side == 0)
{ {
return this.encoder_bottom; return this.encoder_bottom;

View file

@ -35,28 +35,29 @@ public class BlockImprinter extends BlockALMachine
@Override @Override
public void func_94332_a(IconRegister iconReg) public void func_94332_a(IconRegister iconReg)
{ {
this.imprinter_side = iconReg.func_94245_a("imprinter_side"); this.imprinter_side = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_side");
this.imprinter_top = iconReg.func_94245_a("imprinter_top"); this.imprinter_top = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_top");
this.imprinter_bottom = iconReg.func_94245_a("imprinter_bottom"); this.imprinter_bottom = iconReg.func_94245_a(AssemblyLine.TEXTURE_NAME_PREFIX+"imprinter_bottom");
} }
/** /**
* Returns the block texture based on the side being looked at. Args: side * Returns the block texture based on the side being looked at. Args: side
*/ */
public Icon getBlockTextureFromSide(int side, int meta) @Override
public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if (side == 0) if (side == 1)
{ {
return this.imprinter_top; return this.imprinter_top;
} }
else if (side == 1) else if (side == 0)
{ {
return this.imprinter_bottom; return this.imprinter_bottom;
} }
return this.imprinter_top; return this.imprinter_side;
} }
/** /**