Skip to content

Commit

Permalink
fix container handling
Browse files Browse the repository at this point in the history
  • Loading branch information
khjxiaogu committed Sep 18, 2024
1 parent ca9c89c commit 0227fe7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/teammoeg/caupona/CPCommonBootStrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0227fe7

Please sign in to comment.