Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCov
if ((aTileEntity instanceof IFluidHandler)) {
int tMax = 0;
int tUsed = 0;
FluidTankInfo tTank = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0];
if (tTank != null) {
tMax = tTank.capacity;
FluidStack tLiquid = tTank.fluid;
if (tLiquid != null) {
tUsed = tLiquid.amount;
FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN);
if (tTanks != null) {
for (FluidTankInfo tTank : tTanks) {
if (tTank != null) {
tMax = tTank.capacity;
FluidStack tLiquid = tTank.fluid;
if (tLiquid != null) {
tUsed = tLiquid.amount;
}
}
}
}
if (tMax < aCoverVariable) {
Expand Down Expand Up @@ -130,9 +134,13 @@ public GUI(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity)
fBox.setMaxStringLength(12);
this.pBox = new GT_GuiIntegerTextBox(this, 2, startX, startY + spaceY + 2, spaceX * 4 - 3, 12);
if ((aTileEntity instanceof IFluidHandler)) {
FluidTankInfo tTank = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0];
if (tTank != null) {
maxCapacity = tTank.capacity;
FluidTankInfo[] tTanks = ((IFluidHandler) aTileEntity).getTankInfo(ForgeDirection.UNKNOWN);
if (tTanks != null) {
for (FluidTankInfo tTank : tTanks) {
if (tTank != null) {
maxCapacity = tTank.capacity;
}
}
}
}
percent = (int) ((double) coverVariable / (double) maxCapacity * 100d);
Expand Down Expand Up @@ -210,4 +218,4 @@ public void resetTextBox(GT_GuiIntegerTextBox box) {
box.setText(String.valueOf(coverVariable));
}
}
}
}