geforkt von Mirrors/Paper
Call entity_die game event after event cancel check (#10096)
Dieser Commit ist enthalten in:
Ursprung
c4e0d81696
Commit
e1faa8e814
@ -34,6 +34,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// CraftBukkit start
|
||||
public String displayName;
|
||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||
|
||||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
- this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
+ // this.gameEvent(GameEvent.ENTITY_DIE); // Paper - move below event cancellation check
|
||||
boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES);
|
||||
// CraftBukkit start - fire PlayerDeathEvent
|
||||
if (this.isRemoved()) {
|
||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||
String deathmessage = defaultMessage.getString();
|
||||
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
|
||||
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, PaperAdventure.asAdventure(defaultMessage), defaultMessage.getString(), keepInventory); // Paper - Adventure
|
||||
@ -45,6 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ this.gameEvent(GameEvent.ENTITY_DIE); // moved from the top of this method
|
||||
+ // Paper end
|
||||
|
||||
// SPIGOT-943 - only call if they have an inventory open
|
||||
|
@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
// this.gameEvent(GameEvent.ENTITY_DIE); // Paper - move below event cancellation check
|
||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||
this.dropExperience();
|
||||
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren