28 lines
1.1 KiB
Diff
28 lines
1.1 KiB
Diff
--- a/net/minecraft/world/item/consume_effects/RemoveStatusEffectsConsumeEffect.java
|
|
+++ b/net/minecraft/world/item/consume_effects/RemoveStatusEffectsConsumeEffect.java
|
|
@@ -14,6 +14,10 @@
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.level.World;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityPotionEffectEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public record RemoveStatusEffectsConsumeEffect(HolderSet<MobEffectList> effects) implements ConsumeEffect {
|
|
|
|
public static final MapCodec<RemoveStatusEffectsConsumeEffect> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
|
|
@@ -31,11 +35,11 @@
|
|
}
|
|
|
|
@Override
|
|
- public boolean apply(World world, ItemStack itemstack, EntityLiving entityliving) {
|
|
+ public boolean apply(World world, ItemStack itemstack, EntityLiving entityliving, EntityPotionEffectEvent.Cause cause) { // CraftBukkit
|
|
boolean flag = false;
|
|
|
|
for (Holder<MobEffectList> holder : this.effects) {
|
|
- if (entityliving.removeEffect(holder)) {
|
|
+ if (entityliving.removeEffect(holder, cause)) { // CraftBukkit
|
|
flag = true;
|
|
}
|
|
}
|