ExperienceOrbs API for Reason/Source/Triggering player
Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too.
This commit is contained in:
@@ -205,8 +205,9 @@
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
- if (this.dragonDeathTime > 150 && this.dragonDeathTime % 5 == 0 && worldserver.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
- ExperienceOrb.award(worldserver, this.position(), Mth.floor((float) short0 * 0.08F));
|
||||
+ if (this.dragonDeathTime > 150 && this.dragonDeathTime % 5 == 0 && true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp
|
||||
ExperienceOrb.award(worldserver, this.position(), Mth.floor((float) short0 * 0.08F));
|
||||
+ ExperienceOrb.award(worldserver, this.position(), Mth.floor((float) short0 * 0.08F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper
|
||||
}
|
||||
|
||||
if (this.dragonDeathTime == 1 && !this.isSilent()) {
|
||||
@@ -233,16 +234,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +704,7 @@
|
||||
@@ -592,15 +704,15 @@
|
||||
if (world1 instanceof ServerLevel) {
|
||||
ServerLevel worldserver1 = (ServerLevel) world1;
|
||||
|
||||
- if (worldserver1.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
||||
- ExperienceOrb.award(worldserver1, this.position(), Mth.floor((float) short0 * 0.2F));
|
||||
+ if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp
|
||||
ExperienceOrb.award(worldserver1, this.position(), Mth.floor((float) short0 * 0.2F));
|
||||
+ ExperienceOrb.award(worldserver1, this.position(), Mth.floor((float) short0 * 0.2F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper
|
||||
}
|
||||
|
||||
@@ -600,7 +712,7 @@
|
||||
if (this.dragonFight != null) {
|
||||
this.dragonFight.setDragonKilled(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user