Fixed crate flicker issue

Crates also works with Buildcraft pipes. Tested.
This commit is contained in:
Henry Mao 2013-01-26 21:28:12 +08:00
parent c1cb347d2e
commit 1c783715a0
4 changed files with 9 additions and 5 deletions

View file

@ -11,7 +11,7 @@ import assemblyline.client.gui.GuiImprinter;
import assemblyline.client.render.BlockRenderingHandler; import assemblyline.client.render.BlockRenderingHandler;
import assemblyline.client.render.RenderArmbot; import assemblyline.client.render.RenderArmbot;
import assemblyline.client.render.RenderConveyorBelt; import assemblyline.client.render.RenderConveyorBelt;
import assemblyline.client.render.RenderCrateOld; import assemblyline.client.render.RenderCrate;
import assemblyline.client.render.RenderDetector; 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;
@ -49,7 +49,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRejector.class, new RenderRejector()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRejector.class, new RenderRejector());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDetector.class, new RenderDetector()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDetector.class, new RenderDetector());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityManipulator.class, new RenderManipulator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityManipulator.class, new RenderManipulator());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new RenderCrateOld()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrate.class, new RenderCrate());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArmbot.class, new RenderArmbot()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityArmbot.class, new RenderArmbot());
} }

View file

@ -29,6 +29,7 @@ public class RenderArmbot extends TileEntitySpecialRenderer
if (tileEntity instanceof TileEntityArmbot) if (tileEntity instanceof TileEntityArmbot)
{ {
Command curCommand = ((TileEntityArmbot) tileEntity).getCurrentCommand(); Command curCommand = ((TileEntityArmbot) tileEntity).getCurrentCommand();
if (curCommand != null) if (curCommand != null)
{ {
EntityPlayer player = Minecraft.getMinecraft().thePlayer; EntityPlayer player = Minecraft.getMinecraft().thePlayer;
@ -38,7 +39,7 @@ public class RenderArmbot extends TileEntitySpecialRenderer
{ {
if (objectPosition.blockX == tileEntity.xCoord && (objectPosition.blockY == tileEntity.yCoord || objectPosition.blockY == tileEntity.yCoord + 1) && objectPosition.blockZ == tileEntity.zCoord) if (objectPosition.blockX == tileEntity.xCoord && (objectPosition.blockY == tileEntity.yCoord || objectPosition.blockY == tileEntity.yCoord + 1) && objectPosition.blockZ == tileEntity.zCoord)
{ {
RenderHelper.renderFloatingText(curCommand.toString(), (float) x + 0.5f, ((float) y) + 0.25f, (float) z + 0.5f, 0xFFFFFF); RenderHelper.renderFloatingText(curCommand.toString(), (float) x + 0.5f, (float) y, (float) z + 0.5f, 0xFFFFFF);
} }
} }
} }

View file

@ -19,7 +19,7 @@ import org.lwjgl.opengl.GL11;
import assemblyline.common.block.TileEntityCrate; import assemblyline.common.block.TileEntityCrate;
public class RenderCrateOld extends TileEntitySpecialRenderer public class RenderCrate extends TileEntitySpecialRenderer
{ {
private final RenderBlocks renderBlocks = new RenderBlocks(); private final RenderBlocks renderBlocks = new RenderBlocks();
@ -76,10 +76,13 @@ public class RenderCrateOld extends TileEntitySpecialRenderer
RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine; RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
EntityItem ei = new EntityItem(tileEntity.worldObj, 0.0, 0.0, 0.0, itemStack); EntityItem ei = new EntityItem(tileEntity.worldObj, 0.0, 0.0, 0.0, itemStack);
GL11.glDisable(2896);
if (!ForgeHooksClient.renderInventoryItem(this.renderBlocks, renderEngine, itemStack, true, 0.0F, 0.0F, 0.0F)) if (!ForgeHooksClient.renderInventoryItem(this.renderBlocks, renderEngine, itemStack, true, 0.0F, 0.0F, 0.0F))
{ {
renderItem.renderItemIntoGUI(this.getFontRenderer(), renderEngine, itemStack, 0, 0); renderItem.renderItemIntoGUI(this.getFontRenderer(), renderEngine, itemStack, 0, 0);
} }
GL11.glEnable(2896);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }

View file

@ -21,7 +21,7 @@ import cpw.mods.fml.relauncher.Side;
public class TileEntityCrate extends TileEntityAdvanced implements ISidedInventory, IPacketReceiver public class TileEntityCrate extends TileEntityAdvanced implements ISidedInventory, IPacketReceiver
{ {
public static final int MAX_LIMIT = 2048; public static final int MAX_LIMIT = 2880;
private ItemStack[] containingItems = new ItemStack[1]; private ItemStack[] containingItems = new ItemStack[1];
@Override @Override