fix external storage showing as overfull (#2529)
This commit is contained in:
@@ -24,5 +24,5 @@ public interface IExternalStorage<T> extends IStorage<T> {
|
|||||||
/**
|
/**
|
||||||
* @return the capacity of the connected storage
|
* @return the capacity of the connected storage
|
||||||
*/
|
*/
|
||||||
int getCapacity();
|
long getCapacity();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ public class FluidExternalStorage implements IExternalStorage<FluidStack> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCapacity() {
|
public long getCapacity() {
|
||||||
IFluidHandler fluidHandler = handlerSupplier.get();
|
IFluidHandler fluidHandler = handlerSupplier.get();
|
||||||
|
|
||||||
if (fluidHandler != null) {
|
if (fluidHandler != null) {
|
||||||
int cap = 0;
|
long cap = 0;
|
||||||
|
|
||||||
for (int i = 0; i < fluidHandler.getTanks(); ++i) {
|
for (int i = 0; i < fluidHandler.getTanks(); ++i) {
|
||||||
cap += fluidHandler.getTankCapacity(i);
|
cap += fluidHandler.getTankCapacity(i);
|
||||||
|
|||||||
@@ -44,17 +44,17 @@ public class ItemExternalStorage implements IExternalStorage<ItemStack> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCapacity() {
|
public long getCapacity() {
|
||||||
IItemHandler handler = handlerSupplier.get();
|
IItemHandler handler = handlerSupplier.get();
|
||||||
|
|
||||||
if (handler == null) {
|
if (handler == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int capacity = 0;
|
long capacity = 0;
|
||||||
|
|
||||||
for (int i = 0; i < handler.getSlots(); ++i) {
|
for (int i = 0; i < handler.getSlots(); ++i) {
|
||||||
capacity += Math.min(handler.getSlotLimit(i), handler.getStackInSlot(i).getMaxStackSize());
|
capacity += handler.getSlotLimit(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return capacity;
|
return capacity;
|
||||||
|
|||||||
Reference in New Issue
Block a user