2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.client.render;
|
2013-08-04 05:02:06 +02:00
|
|
|
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.client.model.ModelTransmitter;
|
2013-08-06 05:58:44 +02:00
|
|
|
import mekanism.common.MekanismUtils;
|
|
|
|
import mekanism.common.MekanismUtils.ResourceType;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.common.tileentity.TileEntityLogisticalTransporter;
|
2013-08-06 05:58:44 +02:00
|
|
|
import mekanism.common.TransporterUtils;
|
|
|
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraftforge.common.ForgeDirection;
|
|
|
|
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
|
|
|
public class RenderLogisticalTransporter extends TileEntitySpecialRenderer
|
2013-08-04 05:02:06 +02:00
|
|
|
{
|
2013-08-06 05:58:44 +02:00
|
|
|
private ModelTransmitter model = new ModelTransmitter();
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
|
|
|
{
|
|
|
|
renderAModelAt((TileEntityLogisticalTransporter)tileEntity, x, y, z, partialTick);
|
|
|
|
}
|
2013-08-04 05:02:06 +02:00
|
|
|
|
2013-08-06 05:58:44 +02:00
|
|
|
@SuppressWarnings("incomplete-switch")
|
|
|
|
public void renderAModelAt(TileEntityLogisticalTransporter tileEntity, double x, double y, double z, float partialTick)
|
|
|
|
{
|
2013-08-06 07:40:41 +02:00
|
|
|
func_110628_a(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalTransporter" + (tileEntity.isActive ? "Active" : "") + ".png"));
|
2013-08-06 05:58:44 +02:00
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
|
|
|
GL11.glScalef(1.0F, -1F, -1F);
|
|
|
|
GL11.glDisable(GL11.GL_CULL_FACE);
|
|
|
|
|
|
|
|
boolean[] connectable = TransporterUtils.getConnections(tileEntity);
|
|
|
|
|
|
|
|
model.renderCenter(connectable);
|
|
|
|
|
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
model.renderSide(ForgeDirection.getOrientation(i), connectable[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
GL11.glEnable(GL11.GL_CULL_FACE);
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
2013-08-04 05:02:06 +02:00
|
|
|
}
|