use of forestry.core.utils.EnumTankLevel in project ForestryMC by ForestryMC.
the class RenderMachine method render.
public void render(int waterLevelInt, int melangeLevelInt, ForgeDirection orientation, double x, double y, double z) {
EnumTankLevel waterLevel = EnumTankLevel.values()[waterLevelInt];
EnumTankLevel melangeLevel = EnumTankLevel.values()[melangeLevelInt];
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glTranslatef((float) x, (float) y, (float) z);
float[] angle = { 0, 0, 0 };
if (orientation == null) {
orientation = ForgeDirection.WEST;
}
switch(orientation) {
case EAST:
angle[1] = (float) Math.PI;
angle[2] = (float) -Math.PI / 2;
break;
case WEST:
angle[2] = (float) Math.PI / 2;
break;
case UP:
break;
case DOWN:
angle[2] = (float) Math.PI;
break;
case SOUTH:
angle[0] = (float) Math.PI / 2;
angle[2] = (float) Math.PI / 2;
break;
case NORTH:
default:
angle[0] = (float) -Math.PI / 2;
angle[2] = (float) Math.PI / 2;
break;
}
basefront.rotateAngleX = angle[0];
basefront.rotateAngleY = angle[1];
basefront.rotateAngleZ = angle[2];
baseback.rotateAngleX = angle[0];
baseback.rotateAngleY = angle[1];
baseback.rotateAngleZ = angle[2];
resourceTank.rotateAngleX = angle[0];
resourceTank.rotateAngleY = angle[1];
resourceTank.rotateAngleZ = angle[2];
productTank.rotateAngleX = angle[0];
productTank.rotateAngleY = angle[1];
productTank.rotateAngleZ = angle[2];
float factor = (float) (1.0 / 16.0);
Proxies.common.bindTexture(textures[Textures.BASE.ordinal()]);
basefront.render(factor);
Proxies.common.bindTexture(textures[Textures.BASE.ordinal()]);
baseback.render(factor);
ResourceLocation texture;
switch(waterLevel) {
case LOW:
texture = textures[Textures.TANK_R_LOW.ordinal()];
break;
case MEDIUM:
texture = textures[Textures.TANK_R_MEDIUM.ordinal()];
break;
case HIGH:
texture = textures[Textures.TANK_R_HIGH.ordinal()];
break;
case MAXIMUM:
texture = textures[Textures.TANK_R_MAXIMUM.ordinal()];
break;
case EMPTY:
default:
texture = textures[Textures.TANK_R_EMPTY.ordinal()];
break;
}
Proxies.common.bindTexture(texture);
resourceTank.render(factor);
switch(melangeLevel) {
case LOW:
texture = textures[Textures.TANK_P_LOW.ordinal()];
break;
case MEDIUM:
texture = textures[Textures.TANK_P_MEDIUM.ordinal()];
break;
case HIGH:
texture = textures[Textures.TANK_P_HIGH.ordinal()];
break;
case MAXIMUM:
texture = textures[Textures.TANK_P_MAXIMUM.ordinal()];
break;
case EMPTY:
default:
texture = textures[Textures.TANK_P_EMPTY.ordinal()];
break;
}
Proxies.common.bindTexture(texture);
productTank.render(factor);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
use of forestry.core.utils.EnumTankLevel in project ForestryMC by ForestryMC.
the class GuiEngineTin method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
EngineTin engine = inventory;
int storageHeight = engine.getStorageScaled(46);
int storageMaxHeight = engine.getStorageScaled(100);
EnumTankLevel rated = engine.rateLevel(storageMaxHeight);
drawHealthMeter(guiLeft + 74, guiTop + 25, storageHeight, rated);
}
Aggregations