Fixed detector texture

This commit is contained in:
Calclavia 2014-01-28 11:54:29 +08:00
parent 8a9ad49d61
commit ef6190cf13
2 changed files with 2 additions and 58 deletions

View file

@ -24,6 +24,7 @@ public class BlockDetector extends BlockImprintable
public BlockDetector()
{
super("detector");
setTextureName(Reference.PREFIX + "material_metal_side");
}
@Override
@ -67,7 +68,7 @@ public class BlockDetector extends BlockImprintable
super.registerIcons(iconReg);
this.eye_green = iconReg.registerIcon(Reference.PREFIX + "detector_green");
this.eye_red = iconReg.registerIcon(Reference.PREFIX + "detector_red");
this.blockIcon = iconReg.registerIcon(Reference.PREFIX + "machine");
super.registerIcons(iconReg);
}
@Override

View file

@ -1,57 +0,0 @@
package resonantinduction.mechanical.logistic;
import static calclavia.lib.render.ModelUtility.drawCuboid;
import static calclavia.lib.render.ModelUtility.setGlobalTextureResolution;
import static calclavia.lib.render.ModelUtility.setTextureClip;
import static calclavia.lib.render.ModelUtility.setTextureOffset;
import static calclavia.lib.render.ModelUtility.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 resonantinduction.core.render.RenderImprintable;
import universalelectricity.api.vector.Vector3;
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);
setTextureOffset(0, 64);
setTextureSubResolution(64, 64);
drawCuboid(0.45f, 12f / 16f, 0.45f, 2f / 16f, 4f / 16f, 2f / 16f); // stand
setTextureOffset(0, 0);
setTextureSubResolution(128, 64);
drawCuboid(0.25f, 0.25f, 0.25f, 8f / 16f, 8f / 16f, 8f / 16f); // block
setTextureOffset(64, 64);
setTextureSubResolution(64, 32);
drawCuboid(0.375f, 0.25f - (1f / 16f), 0.375f, 4f / 16f, 1f / 16f, 4f / 16f); // lens
glPopMatrix();
}
}