aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0133-PlayerAttemptPickupItemEvent.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-11-28 17:39:40 -0800
committerSpottedleaf <[email protected]>2024-11-28 18:27:59 -0800
commitda9d110d5bf8ffb090d63cd6a443b22ef1ab9d64 (patch)
tree9dbb88d122e6c21827c230041f0b7c93d5a03bf0 /patches/server/0133-PlayerAttemptPickupItemEvent.patch
parent0cc7bd485760dd0abd387f64d193ffef7aa019ee (diff)
downloadPaper-da9d110d5bf8ffb090d63cd6a443b22ef1ab9d64.tar.gz
Paper-da9d110d5bf8ffb090d63cd6a443b22ef1ab9d64.zip
Remove chunk save reattempt patch
This patch does not appear to be doing anything useful, and may hide errors. Currently, the save logic does not run through this path either so it did not do anything. Additionally, properly implement support for handling RegionFileSizeException in Moonrise.
Diffstat (limited to 'patches/server/0133-PlayerAttemptPickupItemEvent.patch')
-rw-r--r--patches/server/0133-PlayerAttemptPickupItemEvent.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/patches/server/0133-PlayerAttemptPickupItemEvent.patch b/patches/server/0133-PlayerAttemptPickupItemEvent.patch
new file mode 100644
index 0000000000..11b2bbe078
--- /dev/null
+++ b/patches/server/0133-PlayerAttemptPickupItemEvent.patch
@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Sun, 11 Jun 2017 16:30:30 -0500
+Subject: [PATCH] PlayerAttemptPickupItemEvent
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+index 92b52ccca3ec7aaab1ffcdc1b85bf6b3e507087f..75ebf09777e19645eee296a9edabac39c858ffb9 100644
+--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
++++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+@@ -40,6 +40,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent;
+ import org.bukkit.event.entity.EntityRemoveEvent;
+ import org.bukkit.event.player.PlayerPickupItemEvent;
+ // CraftBukkit end
++import org.bukkit.event.player.PlayerAttemptPickupItemEvent; // Paper
+
+ public class ItemEntity extends Entity implements TraceableEntity {
+
+@@ -454,6 +455,22 @@ public class ItemEntity extends Entity implements TraceableEntity {
+ int remaining = i - canHold;
+ boolean flyAtPlayer = false; // Paper
+
++ // Paper start - PlayerAttemptPickupItemEvent
++ if (this.pickupDelay <= 0) {
++ PlayerAttemptPickupItemEvent attemptEvent = new PlayerAttemptPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
++ this.level().getCraftServer().getPluginManager().callEvent(attemptEvent);
++
++ flyAtPlayer = attemptEvent.getFlyAtPlayer();
++ if (attemptEvent.isCancelled()) {
++ if (flyAtPlayer) {
++ player.take(this, i);
++ }
++
++ return;
++ }
++ }
++ // Paper end - PlayerAttemptPickupItemEvent
++
+ if (this.pickupDelay <= 0 && canHold > 0) {
+ itemstack.setCount(canHold);
+ // Call legacy event