2024-10-23 02:15:00 +11:00
|
|
|
--- a/net/minecraft/world/item/component/DeathProtection.java
|
|
|
|
+++ b/net/minecraft/world/item/component/DeathProtection.java
|
2025-03-26 03:05:00 +11:00
|
|
|
@@ -14,6 +14,10 @@
|
2024-10-23 02:15:00 +11:00
|
|
|
import net.minecraft.world.item.consume_effects.ClearAllStatusEffectsConsumeEffect;
|
|
|
|
import net.minecraft.world.item.consume_effects.ConsumeEffect;
|
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.event.entity.EntityPotionEffectEvent;
|
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
|
|
|
public record DeathProtection(List<ConsumeEffect> deathEffects) {
|
|
|
|
|
|
|
|
public static final Codec<DeathProtection> CODEC = RecordCodecBuilder.create((instance) -> {
|
2025-03-26 03:05:00 +11:00
|
|
|
@@ -24,7 +28,7 @@
|
2024-10-23 02:15:00 +11:00
|
|
|
|
2025-03-26 03:05:00 +11:00
|
|
|
public void applyEffects(ItemStack itemstack, EntityLiving entityliving) {
|
|
|
|
for (ConsumeEffect consumeeffect : this.deathEffects) {
|
2024-10-23 02:15:00 +11:00
|
|
|
- consumeeffect.apply(entityliving.level(), itemstack, entityliving);
|
|
|
|
+ consumeeffect.apply(entityliving.level(), itemstack, entityliving, EntityPotionEffectEvent.Cause.TOTEM); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|