--- a/net/minecraft/world/item/consume_effects/ConsumeEffect.java +++ b/net/minecraft/world/item/consume_effects/ConsumeEffect.java @@ -12,6 +12,10 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.World; +// CraftBukkit start +import org.bukkit.event.entity.EntityPotionEffectEvent; +// CraftBukkit end + public interface ConsumeEffect { Codec CODEC = BuiltInRegistries.CONSUME_EFFECT_TYPE.byNameCodec().dispatch(ConsumeEffect::getType, ConsumeEffect.a::codec); @@ -19,7 +23,15 @@ ConsumeEffect.a getType(); - boolean apply(World world, ItemStack itemstack, EntityLiving entityliving); + // CraftBukkit start + default boolean apply(World world, ItemStack itemstack, EntityLiving entityliving) { + return this.apply(world, itemstack, entityliving, EntityPotionEffectEvent.Cause.UNKNOWN); + } + + default boolean apply(World world, ItemStack itemstack, EntityLiving entityliving, EntityPotionEffectEvent.Cause cause) { + return this.apply(world, itemstack, entityliving); + } + // CraftBukkit end public static record a(MapCodec codec, StreamCodec streamCodec) {