Fix KIBE Entangled Bucket bug. Thanks to aria1th.
Also, this fixes creative tank not being actually creative when its used without item slots.
This commit is contained in:
parent
07547dfd6d
commit
c1983f7a2d
1 changed files with 19 additions and 9 deletions
|
@ -108,17 +108,27 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
|
|||
return;
|
||||
}
|
||||
|
||||
if ((canDrainTransfer() && FluidUtils.drainContainers(tank, inventory, 0, 1))
|
||||
|| FluidUtils.fillContainers(tank, inventory, 0, 1)) {
|
||||
|
||||
if (type == TRContent.TankUnit.CREATIVE) {
|
||||
if (!tank.isEmpty() && !tank.isFull()) {
|
||||
tank.setFluidAmount(tank.getFluidValueCapacity());
|
||||
}
|
||||
if (canDrainTransfer() && FluidUtils.isContainer(inventory.getStack(0))) {
|
||||
boolean didSomething = false;
|
||||
if(FluidUtils.drainContainers(tank, inventory, 0, 1)){
|
||||
didSomething = true;
|
||||
}
|
||||
if(!didSomething && FluidUtils.fillContainers(tank, inventory, 0, 1)){
|
||||
didSomething = true;
|
||||
}
|
||||
if(didSomething){
|
||||
if(inventory.getStack(1).isEmpty() && !inventory.getStack(0).isEmpty() && inventory.getStack(0).getCount() == 1){
|
||||
inventory.setStack(1, inventory.getStack(0));
|
||||
inventory.setStack(0, ItemStack.EMPTY);
|
||||
}
|
||||
syncWithAll();
|
||||
}
|
||||
}
|
||||
if (type == TRContent.TankUnit.CREATIVE) {
|
||||
if (!tank.isEmpty() && !tank.isFull()) {
|
||||
tank.setFluidAmount(tank.getFluidValueCapacity());
|
||||
}
|
||||
syncWithAll();
|
||||
}
|
||||
|
||||
// Void excessive fluid in creative tank (#2205)
|
||||
if (type == TRContent.TankUnit.CREATIVE && tank.isFull()) {
|
||||
FluidUtils.drainContainers(tank, inventory, 0, 1, true);
|
||||
|
|
Loading…
Add table
Reference in a new issue