Skip to content

Commit

Permalink
Fix milk bucket curing effects before advancement trigger (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD authored Nov 10, 2023
1 parent 97ae536 commit ef633ca
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions patches/net/minecraft/world/item/MilkBucketItem.java.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
--- a/net/minecraft/world/item/MilkBucketItem.java
+++ b/net/minecraft/world/item/MilkBucketItem.java
@@ -18,6 +_,7 @@

@Override
public ItemStack finishUsingItem(ItemStack p_42923_, Level p_42924_, LivingEntity p_42925_) {
+ if (!p_42924_.isClientSide) p_42925_.curePotionEffects(p_42923_); // FORGE - move up so stack.shrink does not turn stack into air
if (p_42925_ instanceof ServerPlayer serverplayer) {
@@ -22,15 +_,12 @@
CriteriaTriggers.CONSUME_ITEM.trigger(serverplayer, p_42923_);
serverplayer.awardStat(Stats.ITEM_USED.get(this));
@@ -27,10 +_,6 @@
}
+ if (!p_42924_.isClientSide) p_42925_.curePotionEffects(p_42923_); // FORGE - move up so stack.shrink does not turn stack into air

if (p_42925_ instanceof Player && !((Player)p_42925_).getAbilities().instabuild) {
p_42923_.shrink(1);
}

Expand Down

0 comments on commit ef633ca

Please sign in to comment.