From 0227fe783a5558ab79f9d2da2a5470d9f89dd63e Mon Sep 17 00:00:00 2001 From: khjxiaogu <54445543+khjxiaogu@users.noreply.github.com> Date: Thu, 19 Sep 2024 00:35:26 +0800 Subject: [PATCH] fix container handling --- src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java b/src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java index a5b45a18..5d66fc64 100644 --- a/src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java +++ b/src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java @@ -256,11 +256,12 @@ protected ItemStack execute(BlockSource bp, ItemStack is) { ItemStack its=cont.getInternal(i); IFluidHandlerItem ifhi=FluidHandler.ITEM.getCapability(its, null); if(ifhi!=null) { - FluidStack fs=ifhi.getFluidInTank(0); + FluidStack fs=ifhi.drain(1000, FluidAction.SIMULATE); if(!fs.isEmpty()) { if(iptar.fill(fs, FluidAction.SIMULATE)==fs.getAmount()) { + fs=ifhi.drain(1000, FluidAction.EXECUTE); iptar.fill(fs, FluidAction.EXECUTE); - cont.setInternal(i,its.getCraftingRemainingItem()); + cont.setInternal(i,ifhi.getContainer()); break; } }