mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 00:07:29 +00:00
Fix fluid containers with null empty items not deleting in fluid terminal (#267)
This commit is contained in:
1 file changed
+10
-6
@@ -332,10 +332,15 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
|
||||
if (targetStack.getItem() instanceof IFluidContainerItem fcItem) {
|
||||
if (emptiedTanks > 0) {
|
||||
emptiedTanksStack = targetStack.copy();
|
||||
emptiedTanksStack.stackSize = 1;
|
||||
fcItem.drain(emptiedTanksStack, fluidPerContainer, true);
|
||||
emptiedTanksStack.stackSize = emptiedTanks;
|
||||
final ItemStack testDrainStack = targetStack.copy();
|
||||
testDrainStack.stackSize = 1;
|
||||
fcItem.drain(testDrainStack, fluidPerContainer, true);
|
||||
if (testDrainStack.stackSize == 0) {
|
||||
emptiedTanksStack = null;
|
||||
} else {
|
||||
emptiedTanksStack = testDrainStack.copy();
|
||||
emptiedTanksStack.stackSize = emptiedTanks;
|
||||
}
|
||||
} else {
|
||||
emptiedTanksStack = null;
|
||||
}
|
||||
@@ -390,8 +395,7 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
} else if (partialTanksStack != null) {
|
||||
player.inventory.setInventorySlotContents(slotIndex, partialTanksStack);
|
||||
} else {
|
||||
player.inventory.setItemStack(null);
|
||||
shouldSendStack = false;
|
||||
player.inventory.setInventorySlotContents(slotIndex, null);
|
||||
}
|
||||
}
|
||||
if (shouldSendStack) {
|
||||
|
||||
Reference in new issue
Block a user