Upgrade fluid interfaces
9 tanks, with up to 64B/fluid with 2 capacity cards
This commit is contained in:
@@ -14,7 +14,7 @@ import java.util.Objects;
|
||||
public class AEFluidInventory implements IAEFluidTank {
|
||||
private final IAEFluidStack[] fluids;
|
||||
private final IAEFluidInventory handler;
|
||||
private final int capacity;
|
||||
private int capacity;
|
||||
private IFluidTankProperties[] props = null;
|
||||
|
||||
public AEFluidInventory(final IAEFluidInventory handler, final int slots, final int capcity) {
|
||||
@@ -23,6 +23,10 @@ public class AEFluidInventory implements IAEFluidTank {
|
||||
this.capacity = capcity;
|
||||
}
|
||||
|
||||
public void setCapacity(int capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public AEFluidInventory(final IAEFluidInventory handler, final int slots) {
|
||||
this(handler, slots, Integer.MAX_VALUE);
|
||||
}
|
||||
@@ -32,7 +36,7 @@ public class AEFluidInventory implements IAEFluidTank {
|
||||
if (slot >= 0 && slot < this.getSlots()) {
|
||||
if (Objects.equals(this.fluids[slot], fluid)) {
|
||||
if (fluid != null && fluid.getStackSize() != this.fluids[slot].getStackSize()) {
|
||||
this.fluids[slot].setStackSize(Math.min(fluid.getStackSize(), this.capacity));
|
||||
this.fluids[slot].setStackSize(fluid.getStackSize());
|
||||
this.onContentChanged(slot);
|
||||
}
|
||||
} else {
|
||||
@@ -40,7 +44,7 @@ public class AEFluidInventory implements IAEFluidTank {
|
||||
this.fluids[slot] = null;
|
||||
} else {
|
||||
this.fluids[slot] = fluid.copy();
|
||||
this.fluids[slot].setStackSize(Math.min(fluid.getStackSize(), this.capacity));
|
||||
this.fluids[slot].setStackSize(fluid.getStackSize());
|
||||
}
|
||||
|
||||
this.onContentChanged(slot);
|
||||
|
||||
Reference in New Issue
Block a user