Files
CatServer/patches/net/minecraft/item/ItemBucketMilk.java.patch
2019-02-24 22:29:41 +08:00

35 lines
1.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/item/ItemBucketMilk.java
+++ ../src-work/minecraft/net/minecraft/item/ItemBucketMilk.java
@@ -22,6 +22,7 @@
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving)
{
+ if (!worldIn.isRemote) entityLiving.curePotionEffects(stack); // FORGE - move up so stack.shrink does not turn stack into air
if (entityLiving instanceof EntityPlayerMP)
{
EntityPlayerMP entityplayermp = (EntityPlayerMP)entityLiving;
@@ -34,11 +35,6 @@
stack.shrink(1);
}
- if (!worldIn.isRemote)
- {
- entityLiving.clearActivePotions();
- }
-
return stack.isEmpty() ? new ItemStack(Items.BUCKET) : stack;
}
@@ -52,6 +48,11 @@
return EnumAction.DRINK;
}
+ @Override
+ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, net.minecraft.nbt.NBTTagCompound nbt) {
+ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack);
+ }
+
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
{
playerIn.setActiveHand(handIn);