aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0286-Improve-death-events.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0286-Improve-death-events.patch')
-rw-r--r--Spigot-Server-Patches/0286-Improve-death-events.patch38
1 files changed, 14 insertions, 24 deletions
diff --git a/Spigot-Server-Patches/0286-Improve-death-events.patch b/Spigot-Server-Patches/0286-Improve-death-events.patch
index c7eecbad86..149c1819fd 100644
--- a/Spigot-Server-Patches/0286-Improve-death-events.patch
+++ b/Spigot-Server-Patches/0286-Improve-death-events.patch
@@ -119,7 +119,7 @@ index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e2
public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
-index 4b249a644c680a7cc64b0d31cf453f94ff2b6a0c..d6a98bb7fc107649c179cded2d37c06a41146a89 100644
+index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8a142125e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -95,7 +95,7 @@ public abstract class EntityLiving extends Entity {
@@ -227,25 +227,15 @@ index 4b249a644c680a7cc64b0d31cf453f94ff2b6a0c..d6a98bb7fc107649c179cded2d37c06a
Entity entity = damagesource.getEntity();
int i;
-@@ -1454,22 +1481,26 @@ public abstract class EntityLiving extends Entity {
- boolean flag = this.lastDamageByPlayerTime > 0;
-
- this.dropInventory(); // CraftBukkit - from below
-+ org.bukkit.event.entity.EntityDeathEvent deathEvent; // Paper
- if (this.cV() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
- this.a(damagesource, flag);
+@@ -1459,15 +1486,18 @@ public abstract class EntityLiving extends Entity {
this.dropDeathLoot(damagesource, i, flag);
- // CraftBukkit start - Call death event
-- CraftEventFactory.callEntityDeathEvent(this, this.drops);
-- this.drops = new ArrayList<org.bukkit.inventory.ItemStack>();
-+ deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
- } else {
-- CraftEventFactory.callEntityDeathEvent(this);
-+ deathEvent = CraftEventFactory.callEntityDeathEvent(this); // Paper
- // CraftBukkit end
}
+ // CraftBukkit start - Call death event
+- CraftEventFactory.callEntityDeathEvent(this, this.drops);
++ org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
+ this.postDeathDropItems(deathEvent); // Paper
-+ this.drops = new ArrayList<>(); // Paper
+ this.drops = new ArrayList<>();
+ // CraftBukkit end
// this.dropInventory();// CraftBukkit - moved up
this.dropExperience();
@@ -257,7 +247,7 @@ index 4b249a644c680a7cc64b0d31cf453f94ff2b6a0c..d6a98bb7fc107649c179cded2d37c06a
// CraftBukkit start
public int getExpReward() {
-@@ -1554,6 +1585,7 @@ public abstract class EntityLiving extends Entity {
+@@ -1552,6 +1582,7 @@ public abstract class EntityLiving extends Entity {
return SoundEffects.ENTITY_GENERIC_HURT;
}
@@ -265,7 +255,7 @@ index 4b249a644c680a7cc64b0d31cf453f94ff2b6a0c..d6a98bb7fc107649c179cded2d37c06a
@Nullable
protected SoundEffect getSoundDeath() {
return SoundEffects.ENTITY_GENERIC_DEATH;
-@@ -2073,10 +2105,12 @@ public abstract class EntityLiving extends Entity {
+@@ -2071,10 +2102,12 @@ public abstract class EntityLiving extends Entity {
}
@@ -357,7 +347,7 @@ index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 41f0a9159f2e92d43fbca112050198bd7f5e0eb7..b7253ab42447faa36abdbe3190f82f8673cc8ce6 100644
+index 7828241b4ab42fd684e62950ddac85b3e43e45be..139ea71a17a014be2be735395c99c1d5354a4383 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1768,7 +1768,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -378,10 +368,10 @@ index 41f0a9159f2e92d43fbca112050198bd7f5e0eb7..b7253ab42447faa36abdbe3190f82f86
public void injectScaledMaxHealth(Collection<AttributeModifiable> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index f6c8c371e22272983f80268dab8009ee029bed2a..37f6fdf1be6d0f8a4ec4b9998fa710876b5515c9 100644
+index a86939235a1a5624710744ec3550e6131482c284..59205a848524f281edcab388a9ca40b3e08a9556 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -783,9 +783,16 @@ public class CraftEventFactory {
+@@ -784,9 +784,16 @@ public class CraftEventFactory {
public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim, List<org.bukkit.inventory.ItemStack> drops) {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
@@ -398,7 +388,7 @@ index f6c8c371e22272983f80268dab8009ee029bed2a..37f6fdf1be6d0f8a4ec4b9998fa71087
victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
-@@ -801,8 +808,15 @@ public class CraftEventFactory {
+@@ -802,8 +809,15 @@ public class CraftEventFactory {
CraftPlayer entity = victim.getBukkitEntity();
PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage);
event.setKeepInventory(keepInventory);
@@ -414,7 +404,7 @@ index f6c8c371e22272983f80268dab8009ee029bed2a..37f6fdf1be6d0f8a4ec4b9998fa71087
victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel();
-@@ -819,6 +833,31 @@ public class CraftEventFactory {
+@@ -820,6 +834,31 @@ public class CraftEventFactory {
return event;
}