3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0342-Implement-getters-and-setters-for-EntityItem-owner-a.patch
Mariell Hoversholm 654b792caf Updated Upstream (CraftBukkit)
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:
a339310c #755: Fix NPE when calling getInventory() for virtual EnderChests
2577f9bf Increase outdated build delay
1dabfdc8 #754: Fix pre-1.16 serialized SkullMeta being broken on 1.16+, losing textures
2020-09-27 11:04:51 -04:00

53 Zeilen
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 20:54:23 -0500
Subject: [PATCH] Implement getters and setters for EntityItem owner and
thrower
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 3f552b5905e5ed51c887ad02410297dd5e2e165f..cb756b1ba0438045904a1b3fe8e827e8f1e105bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@@ -8,6 +8,11 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
+// Paper start
+import javax.annotation.Nullable;
+import java.util.UUID;
+// Paper end
+
public class CraftItem extends CraftEntity implements Item {
private final EntityItem item;
@@ -56,6 +61,28 @@ public class CraftItem extends CraftEntity implements Item {
public void setCanMobPickup(boolean canMobPickup) {
item.canMobPickup = canMobPickup;
}
+
+ @Nullable
+ @Override
+ public UUID getOwner() {
+ return item.getOwner();
+ }
+
+ @Override
+ public void setOwner(@Nullable UUID owner) {
+ item.setOwner(owner);
+ }
+
+ @Nullable
+ @Override
+ public UUID getThrower() {
+ return item.getThrower();
+ }
+
+ @Override
+ public void setThrower(@Nullable UUID thrower) {
+ item.setThrower(thrower);
+ }
// Paper End
@Override