Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
b3f265d1b1
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 0ca45a21 #503: Add PlayerHarvestBlockEvent dfa80a52 SPIGOT-5930: Add PlayerRespawnEvent#isAnchorSpawn CraftBukkit Changes:145921e2
#676: Add PlayerHarvestBlockEvent47abffa2
SPIGOT-5929: Angered zombified piglins do not inherit killed_by_player status7f6b4f58
SPIGOT-5930: Add PlayerRespawnEvent#isAnchorSpawn94eff632
SPIGOT-5867, MC-193339: NPE during shutdown when rcon enabled with no password068618eb
SPIGOT-5927: Some items NBT data disappears Spigot Changes: beb7d47c Rebuild patches Fixes #3738
50 Zeilen
2.6 KiB
Diff
50 Zeilen
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaBlend <whizkid3000@hotmail.com>
|
|
Date: Thu, 8 Sep 2016 08:48:33 -0700
|
|
Subject: [PATCH] Add source to PlayerExpChangeEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
index 2e25aba27993608ed7ee1cfb7ae8ee60bc74feda..c13a47382d0a7456fa5035a64f42a6ed5e9f1c8e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
|
@@ -188,7 +188,7 @@ public class EntityExperienceOrb extends Entity {
|
|
}
|
|
|
|
if (this.value > 0) {
|
|
- entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value -> event.getAmount()
|
|
+ entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this).getAmount()); // CraftBukkit - this.value -> event.getAmount() // Paper - supply experience orb object
|
|
}
|
|
|
|
this.die();
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index 47f8c995025f26607baf3b80b8465f6df78a08ff..9a4d74f6e241dd4e1785ed5bad0eac74b3130fca 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -120,6 +120,7 @@ import org.bukkit.entity.ThrownPotion;
|
|
import org.bukkit.entity.Vehicle;
|
|
import org.bukkit.entity.Villager;
|
|
import org.bukkit.entity.Villager.Profession;
|
|
+import org.bukkit.entity.ExperienceOrb; // Paper
|
|
import org.bukkit.event.Cancellable;
|
|
import org.bukkit.event.Event;
|
|
import org.bukkit.event.Event.Result;
|
|
@@ -1039,6 +1040,17 @@ public class CraftEventFactory {
|
|
return event;
|
|
}
|
|
|
|
+ // Paper start - Add orb
|
|
+ public static PlayerExpChangeEvent callPlayerExpChangeEvent(EntityHuman entity, EntityExperienceOrb entityOrb) {
|
|
+ Player player = (Player) entity.getBukkitEntity();
|
|
+ ExperienceOrb source = (ExperienceOrb) entityOrb.getBukkitEntity();
|
|
+ int expAmount = source.getExperience();
|
|
+ PlayerExpChangeEvent event = new PlayerExpChangeEvent(player, source, expAmount);
|
|
+ Bukkit.getPluginManager().callEvent(event);
|
|
+ return event;
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
public static boolean handleBlockGrowEvent(World world, BlockPosition pos, IBlockData block) {
|
|
return handleBlockGrowEvent(world, pos, block, 3);
|
|
}
|