mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 10:27:55 +01:00
Updated Upstream (Bukkit/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 Bukkit Changes: e461dcfe #555: Item - add getters/setters for owner/thrower CraftBukkit Changes: 055870c4 #758: Item - add getters/setters for owner/thrower
This commit is contained in:
parent
ffe68e8875
commit
74f507f4e3
@ -5,13 +5,13 @@ Subject: [PATCH] Item#canEntityPickup
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index 4f0caf5a7084f2be1ce1a4b49318e78597b45846..ae3880491682067d4c5baef0a8c90b1036d67ac0 100644
|
||||
index 3f2736fbddd8661e764bc2f8d0499bd13ca91df5..c404a5b8efea7c780db5ddae19456753808abb3d 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -36,4 +36,20 @@ public interface Item extends Entity {
|
||||
* @param delay New delay
|
||||
@@ -75,4 +75,20 @@ public interface Item extends Entity {
|
||||
*/
|
||||
public void setPickupDelay(int delay);
|
||||
@Nullable
|
||||
public UUID getThrower();
|
||||
+
|
||||
+ // Paper Start
|
||||
+ /**
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sat, 6 Oct 2018 20:54:13 -0500
|
||||
Subject: [PATCH] Implement getters and setters for EntityItem owner and
|
||||
thrower
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index ae3880491682067d4c5baef0a8c90b1036d67ac0..acd80d812fe88dee3978d19b24149e9fe0ac596b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -3,6 +3,11 @@ package org.bukkit.entity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
+// Paper start
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+import java.util.UUID;
|
||||
+// Paper end
|
||||
+
|
||||
/**
|
||||
* Represents a dropped item.
|
||||
*/
|
||||
@@ -51,5 +56,35 @@ public interface Item extends Entity {
|
||||
* @param canMobPickup True to allow non-player entity pickup
|
||||
*/
|
||||
public void setCanMobPickup(boolean canMobPickup);
|
||||
+
|
||||
+ /**
|
||||
+ * The owner of this item. Only the owner can pick up the item until it is within 10 seconds of despawning
|
||||
+ *
|
||||
+ * @return The owner's UUID
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public UUID getOwner();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the owner of this item. Only the owner can pick up the item until it is within 10 seconds of despawning
|
||||
+ *
|
||||
+ * @param owner The owner's UUID
|
||||
+ */
|
||||
+ public void setOwner(@Nullable UUID owner);
|
||||
+
|
||||
+ /**
|
||||
+ * Get the thrower of this item.
|
||||
+ *
|
||||
+ * @return The thrower's UUID
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public UUID getThrower();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the thrower of this item.
|
||||
+ *
|
||||
+ * @param thrower The thrower's UUID
|
||||
+ */
|
||||
+ public void setThrower(@Nullable UUID thrower);
|
||||
// Paper end
|
||||
}
|
@ -33,10 +33,10 @@ index 13416bf95869987919e1fcd6b331c3fe2c2b5cee..2ca3886f532050ba7d360efd20a617ef
|
||||
public EntityItem(EntityTypes<? extends EntityItem> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
index cc593fbc995dfc11f8006588059d67c42a7429cd..3f552b5905e5ed51c887ad02410297dd5e2e165f 100644
|
||||
index d7da0cf2e7b9e669635b469f87e8da4d7fdecb35..d6a64e4ecf9225f9a93523c50b2f1375296b406e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
|
||||
@@ -48,6 +48,16 @@ public class CraftItem extends CraftEntity implements Item {
|
||||
@@ -49,6 +49,16 @@ public class CraftItem extends CraftEntity implements Item {
|
||||
item.age = value;
|
||||
}
|
||||
|
||||
@ -51,5 +51,5 @@ index cc593fbc995dfc11f8006588059d67c42a7429cd..3f552b5905e5ed51c887ad02410297dd
|
||||
+ // Paper End
|
||||
+
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftItem";
|
||||
public void setOwner(UUID uuid) {
|
||||
item.setOwner(uuid);
|
||||
|
@ -1,52 +0,0 @@
|
||||
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
|
@ -8,7 +8,7 @@ Exposes a mutable array on items a player should keep on death
|
||||
Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 433140dc33fe2a9eb8241afc2aabf97378dcefdd..05d73610dc1e0e0c411f9cd6c1118ab5a6bb81ab 100644
|
||||
index 585e0f8007ff7e73e5b9f363ed4a977b48a3fafc..81ac825acd266329392bf2ebecb73162942d3a21 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -560,6 +560,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
@ -40,7 +40,7 @@ index dd4d12f4e3ab5385b85504bde962adce2981dfb5..1511212cbfbece279d9f66473bd6b5bc
|
||||
double deltaZ = this.locZ() - player.locZ();
|
||||
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d43ada6dccb45060ea37acf7a2a8ea6a4d74ab18..747dd3c06d24b395d9d940413fe47a63b66e65d0 100644
|
||||
index 16edb26f9e66e26e5f26b83301613cd1486c7700..748b1c12ccee67a35232cf7a48e68ef7f34147c7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2024,6 +2024,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user