mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2024-11-22 11:16:17 +00:00
31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
--- a/net/minecraft/world/item/consume_effects/RemoveStatusEffectsConsumeEffect.java
|
|
+++ b/net/minecraft/world/item/consume_effects/RemoveStatusEffectsConsumeEffect.java
|
|
@@ -15,6 +15,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) -> {
|
|
@@ -32,14 +36,14 @@
|
|
}
|
|
|
|
@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;
|
|
Iterator iterator = this.effects.iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
Holder<MobEffectList> holder = (Holder) iterator.next();
|
|
|
|
- if (entityliving.removeEffect(holder)) {
|
|
+ if (entityliving.removeEffect(holder, cause)) { // CraftBukkit
|
|
flag = true;
|
|
}
|
|
}
|