mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 01:41:05 +01:00
2f782a6652
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 CraftBukkit Changes:17543ecf
SPIGOT-5035: Error Using Virtual Merchant GUI0fc6922b
SPIGOT-5028: Villager#setVillagerExperience() doesn't workbdbdbe44
SPIGOT-5024: Fox error - Unknown target reason
57 lines
1.9 KiB
Diff
57 lines
1.9 KiB
Diff
From f772280393bb1d4abe8ee41528c4dde92691509e Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
Date: Sun, 7 May 2017 06:26:01 -0500
|
|
Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
|
index 951ea2cc7..18d82c111 100644
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java
|
|
@@ -17,6 +17,7 @@ import org.jetbrains.annotations.NotNull;
|
|
public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private final Item item;
|
|
+ private boolean flyAtPlayer = true; // Paper
|
|
private boolean cancel = false;
|
|
private final int remaining;
|
|
|
|
@@ -45,6 +46,27 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
|
|
return remaining;
|
|
}
|
|
|
|
+ // Paper Start
|
|
+ /**
|
|
+ * Set if the item will fly at the player
|
|
+ * <p>Cancelling the event will set this value to false.</p>
|
|
+ *
|
|
+ * @param flyAtPlayer True for item to fly at player
|
|
+ */
|
|
+ public void setFlyAtPlayer(boolean flyAtPlayer) {
|
|
+ this.flyAtPlayer = flyAtPlayer;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Gets if the item will fly at the player
|
|
+ *
|
|
+ * @return True if the item will fly at the player
|
|
+ */
|
|
+ public boolean getFlyAtPlayer() {
|
|
+ return flyAtPlayer;
|
|
+ }
|
|
+ // Paper End
|
|
+
|
|
@Override
|
|
public boolean isCancelled() {
|
|
return cancel;
|
|
@@ -53,6 +75,7 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
|
|
@Override
|
|
public void setCancelled(boolean cancel) {
|
|
this.cancel = cancel;
|
|
+ this.flyAtPlayer = !cancel; // Paper
|
|
}
|
|
|
|
@NotNull
|
|
--
|
|
2.21.0
|
|
|