Files
LuminolMC/luminol-api/paper-patches/features/0008-Leaves-Fix-SculkCatalyst-exp-skip.patch
2025-05-24 01:53:09 +08:00

56 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
Date: Sat, 24 May 2025 01:25:10 +0800
Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
index 76c08499b704a6cb0cb95ce69b9a9248d69cc127..d516595a8675a9f3d9c14658b66160ba4b3c4278 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java
@@ -27,6 +27,7 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
@Nullable private org.bukkit.SoundCategory deathSoundCategory;
private float deathSoundVolume;
private float deathSoundPitch;
+ private int rewardExp; // Leaves - exp fix
private boolean cancelled;
@@ -35,13 +36,20 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
this(livingEntity, damageSource, drops, 0);
}
- @ApiStatus.Internal
public EntityDeathEvent(@NotNull final LivingEntity livingEntity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp) {
+ // Leaves start - exp fix
+ this(livingEntity, damageSource, drops, droppedExp, droppedExp);
+ }
+
+ @ApiStatus.Internal
+ public EntityDeathEvent(@NotNull final LivingEntity livingEntity, @NotNull DamageSource damageSource, @NotNull final List<ItemStack> drops, final int droppedExp, final int rewardExp) {
super(livingEntity);
this.damageSource = damageSource;
this.drops = drops;
this.dropExp = droppedExp;
+ this.rewardExp = rewardExp;
}
+ // Leaves end - exp fix
@NotNull
@Override
@@ -230,4 +238,14 @@ public class EntityDeathEvent extends EntityEvent implements Cancellable {
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
+
+ // Leaves start - exp fix
+ public int getRewardExp() {
+ return rewardExp;
+ }
+
+ public void setRewardExp(int rewardExp) {
+ this.rewardExp = rewardExp;
+ }
+ // Leaves end - exp fix
}