Fixed Solar Evaporation Controller crash
This commit is contained in:
parent
40f7373819
commit
650224bdd8
2 changed files with 18 additions and 10 deletions
|
@ -1,9 +1,5 @@
|
||||||
package mekanism.client.gui.element;
|
package mekanism.client.gui.element;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
import mekanism.api.Coord4D;
|
import mekanism.api.Coord4D;
|
||||||
import mekanism.api.transmitters.TransmissionType;
|
import mekanism.api.transmitters.TransmissionType;
|
||||||
import mekanism.client.gui.GuiMekanism;
|
import mekanism.client.gui.GuiMekanism;
|
||||||
|
@ -19,6 +15,9 @@ import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.fluids.Fluid;
|
import net.minecraftforge.fluids.Fluid;
|
||||||
import net.minecraftforge.fluids.FluidTank;
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class GuiFluidGauge extends GuiGauge<Fluid>
|
public class GuiFluidGauge extends GuiGauge<Fluid>
|
||||||
{
|
{
|
||||||
|
@ -82,7 +81,12 @@ public class GuiFluidGauge extends GuiGauge<Fluid>
|
||||||
return height-2;
|
return height-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return infoHandler.getTank().getFluid() != null ? infoHandler.getTank().getFluidAmount()*(height-2) / infoHandler.getTank().getCapacity() : 0;
|
if(infoHandler.getTank().getFluid() == null || infoHandler.getTank().getCapacity() == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return infoHandler.getTank().getFluidAmount()*(height-2) / infoHandler.getTank().getCapacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package mekanism.client.gui.element;
|
package mekanism.client.gui.element;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
import mekanism.api.Coord4D;
|
import mekanism.api.Coord4D;
|
||||||
import mekanism.api.gas.Gas;
|
import mekanism.api.gas.Gas;
|
||||||
import mekanism.api.gas.GasTank;
|
import mekanism.api.gas.GasTank;
|
||||||
|
@ -19,6 +15,9 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class GuiGasGauge extends GuiGauge<Gas>
|
public class GuiGasGauge extends GuiGauge<Gas>
|
||||||
{
|
{
|
||||||
|
@ -82,7 +81,12 @@ public class GuiGasGauge extends GuiGauge<Gas>
|
||||||
return height-2;
|
return height-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return infoHandler.getTank().getGas() != null ? infoHandler.getTank().getStored()*(height-2) / infoHandler.getTank().getMaxGas() : 0;
|
if(infoHandler.getTank().getGas() == null || infoHandler.getTank().getMaxGas() == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return infoHandler.getTank().getStored()*(height-2) / infoHandler.getTank().getMaxGas();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue