Fixed Fluid Barrel container item definition (issue #178).

This commit is contained in:
stfwi 2021-05-07 19:45:14 +02:00
parent c6529cf5ed
commit eaac51b9ff
4 changed files with 7 additions and 3 deletions

View file

@ -411,11 +411,12 @@ public class EdFluidBarrel
@Override
public boolean hasContainerItem(ItemStack stack)
{ return true; }
{ return (stack.getCount()==1) && (!getFluid(stack).isEmpty()); }
@Override
public ItemStack getContainerItem(ItemStack stack)
{
if(stack.getCount()!=1) return ItemStack.EMPTY;
FluidStack fs = getFluid(stack);
if(fs.getAmount() > 1000) fs.shrink(1000); else fs = FluidStack.EMPTY;
return setFluid(stack, fs);