Fix milk bucket is fillable with water or lava when milk is unregistered (#3039)

This commit is contained in:
mezz 2016-06-26 12:19:04 -07:00 committed by LexManos
parent 1a8ad6bbee
commit 18b2eeef90

View file

@ -23,6 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBucketMilk;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.ForgeModContainer; import net.minecraftforge.common.ForgeModContainer;
@ -118,7 +119,7 @@ public class FluidBucketWrapper implements IFluidHandler, ICapabilityProvider
@Override @Override
public int fill(FluidStack resource, boolean doFill) public int fill(FluidStack resource, boolean doFill)
{ {
if (container.stackSize != 1 || resource == null || resource.amount < Fluid.BUCKET_VOLUME || getFluid() != null || !canFillFluidType(resource)) if (container.stackSize != 1 || resource == null || resource.amount < Fluid.BUCKET_VOLUME || container.getItem() instanceof ItemBucketMilk || getFluid() != null || !canFillFluidType(resource))
{ {
return 0; return 0;
} }