mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
57dd397155
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: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
58 lines
1.7 KiB
Diff
58 lines
1.7 KiB
Diff
From 6d38fdc5d943c374318c7d0d3c008d6b21b5ffdb Mon Sep 17 00:00:00 2001
|
|
From: AlphaBlend <whizkid3000@hotmail.com>
|
|
Date: Thu, 8 Sep 2016 08:47:08 -0700
|
|
Subject: [PATCH] Add source to PlayerExpChangeEvent
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java
|
|
index c99c9281e..7c340f539 100644
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java
|
|
@@ -1,21 +1,43 @@
|
|
package org.bukkit.event.player;
|
|
|
|
+import org.bukkit.entity.Entity; // Paper
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.HandlerList;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.Nullable; // Paper
|
|
+
|
|
/**
|
|
* Called when a players experience changes naturally
|
|
*/
|
|
public class PlayerExpChangeEvent extends PlayerEvent {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
+ // Paper start
|
|
+ @Nullable
|
|
+ private final Entity source;
|
|
private int exp;
|
|
|
|
public PlayerExpChangeEvent(@NotNull final Player player, final int expAmount) {
|
|
+ this(player, null, expAmount);
|
|
+ }
|
|
+
|
|
+ public PlayerExpChangeEvent(@NotNull final Player player, @Nullable final Entity sourceEntity, final int expAmount) {
|
|
super(player);
|
|
+ source = sourceEntity;
|
|
exp = expAmount;
|
|
}
|
|
|
|
+ /**
|
|
+ * Get the source that provided the experience.
|
|
+ *
|
|
+ * @return The source of the experience
|
|
+ */
|
|
+ @Nullable
|
|
+ public Entity getSource() {
|
|
+ return source;
|
|
+ }
|
|
+ // Paper end
|
|
+
|
|
/**
|
|
* Get the amount of experience the player will receive
|
|
*
|
|
--
|
|
2.26.2
|
|
|