Clean up of Bio-Fuel render in the Bio-Generator
This commit is contained in:
DrParadox7 committed 2022-12-27 19:59:59 +01:00
1 parent 5a6839b4d3
commit 205cbf1205
2 files changed
+13 -22

No files matched your search

@@ -42,12 +42,13 @@ public class RenderBioGenerator extends TileEntitySpecialRenderer
{
push();
int gasType = tileEntity.getFuelType();
boolean isEthanol = tileEntity.getFuelType() == 1;
System.out.println("IsEthanol= " + isEthanol);
MekanismRenderer.glowOn();
GL11.glTranslatef((float)x, (float)y, (float)z);
bindTexture(MekanismRenderer.getBlocksTexture());
getDisplayList(gasType, ForgeDirection.getOrientation(tileEntity.facing)) [tileEntity.getScaledFuelLevel(stages-1)].render();
getDisplayList(isEthanol, ForgeDirection.getOrientation(tileEntity.facing)) [tileEntity.getScaledFuelLevel(stages-1)].render();
MekanismRenderer.glowOff();
pop();
@@ -71,7 +72,7 @@ public class RenderBioGenerator extends TileEntitySpecialRenderer
}
@SuppressWarnings("incomplete-switch")
private DisplayInteger[] getDisplayList(int gasType, ForgeDirection side)
private DisplayInteger[] getDisplayList(boolean isEthanol, ForgeDirection side)
{
if(energyDisplays.containsKey(side))
{
@@ -83,7 +84,7 @@ public class RenderBioGenerator extends TileEntitySpecialRenderer
Model3D model3D = new Model3D();
model3D.baseBlock = Blocks.water;
if (gasType == 1)
if (isEthanol)
model3D.setTexture(MekanismRenderer.ethanolIcon);
else
model3D.setTexture(MekanismRenderer.biomassIcon);
@@ -173,25 +173,13 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IGasH
public int getFuelType()
{
if (fuelTank.getStored() > 0) {
Gas gas = fuelTank.getGas().getGas();
if (gas != null && isValidGas(gas)) {
if (gas == GasRegistry.getGas("bioethanol"))
return 1; //Ethanol
}
if (isValidGas(gas) && gas == GasRegistry.getGas("bioethanol"))
return 1;
}
return 0; //Biogas
}
public int getTypeGas()
{
if(fuelTank.getGas().getGas() == GasRegistry.getGas("bioethanol"))
{
return 1; //Orange
}
return 0; //Green
}
/**
* Gets the scaled fuel level for the GUI.
* @param i - multiplier
@@ -229,10 +217,12 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IGasH
public boolean isValidGas(Gas gas)
{
if (gas == GasRegistry.getGas("biomass") || gas == GasRegistry.getGas("bioethanol")){
return true;}
else
return false;
if (gas != null) {
if (gas == GasRegistry.getGas("biomass") || gas == GasRegistry.getGas("bioethanol")) {
return true;
}
}
return false;
}
@Override