RenderBlocks renderBlocks = new RenderBlocks();
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y,
double z, float f) {
TileEntityTurbineRotorBearing bearing = (TileEntityTurbineRotorBearing)tileentity;
if(bearing == null || !bearing.isConnected()) { return; }
MultiblockTurbine turbine = bearing.getTurbine();
if(!turbine.isAssembled() || !turbine.getActive() || !turbine.hasGlass()) { return; }
Integer displayList = bearing.getDisplayList();
ForgeDirection rotorDir = bearing.getOutwardsDir().getOpposite();
if(displayList == null) {
RotorInfo info = bearing.getRotorInfo();
displayList = generateRotor(info);
bearing.setDisplayList(displayList);
}
float angle = bearing.getAngle();
long elapsedTime = Minecraft.getSystemTime() - ClientProxy.lastRenderTime;
float speed = turbine.getRotorSpeed();
if(speed > 0.001f) {
angle += speed * ((float)elapsedTime / 60000f) * 360f; // RPM * time in minutes * 360 degrees per rotation
angle = angle % 360f;
bearing.setAngle(angle);
}
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE);