Make PlayerPickupExperienceEvent extend PlayerEvent

This commit is contained in:
Aikar 2017-12-19 22:08:28 -05:00
parent 9f204c2a91
commit 0fcd0b5c52
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE

View file

@ -1,4 +1,4 @@
From c35ec3d0d0ad4bab56dc760a99a53bdff3c2e4a7 Mon Sep 17 00:00:00 2001
From d8a66c3b1137626639c052ccb0a1735431f7c576 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 22:00:41 -0500
Subject: [PATCH] PlayerPickupExperienceEvent
@ -7,10 +7,10 @@ Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java
new file mode 100644
index 00000000..0b1b5ae7
index 00000000..f9ef95cd
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java
@@ -0,0 +1,83 @@
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License
+ *
@ -41,27 +41,20 @@ index 00000000..0b1b5ae7
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+
+/**
+ * Fired when a player is attempting to pick up an experience orb
+ */
+public class PlayerPickupExperienceEvent extends Event implements Cancellable {
+ private final Player player;
+public class PlayerPickupExperienceEvent extends PlayerEvent implements Cancellable {
+ private final ExperienceOrb experienceOrb;
+
+ public PlayerPickupExperienceEvent(Player player, ExperienceOrb experienceOrb) {
+ this.player = player;
+ super(player);
+ this.experienceOrb = experienceOrb;
+ }
+
+ /**
+ * @return The player picking up an experience orb
+ */
+ public Player getPlayer() {
+ return player;
+ }
+
+ /**
+ * @return Returns the Orb that the player is picking up
+ */
+ public ExperienceOrb getExperienceOrb() {