1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-30 19:40:37 +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:
da9ef3c5 : Add methods to get/set ItemStacks in EquipmentSlots
3abebc9f : Let Tameable extend Animals rather than Entity
941111a0 : Expose ItemStack and hand used in PlayerShearEntityEvent
4fe19cae : InventoryView - Add missing Brewing FUEL_TIME

CraftBukkit Changes:
933e9094 : Add methods to get/set ItemStacks in EquipmentSlots
18722312 : Expose ItemStack and hand used in PlayerShearEntityEvent
This commit is contained in:
Aikar 2020-05-06 06:05:22 -04:00
parent 1127deb87d
commit d2a300598c
6 changed files with 4 additions and 116 deletions

View file

@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sun, 20 Mar 2016 06:44:49 -0400
Subject: [PATCH] Access items by EquipmentSlot
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -0,0 +0,0 @@ public interface PlayerInventory extends Inventory {
@Override
@Nullable
public HumanEntity getHolder();
+
+ // Paper start
+ /**
+ * Gets the {@link ItemStack} found in the slot.
+ *
+ * @param slot The slot
+ * @return The item stack in the slot
+ */
+ @Nullable
+ ItemStack getItem(@NotNull EquipmentSlot slot);
+
+ /**
+ * Sets the {@link ItemStack} at the given {@link EquipmentSlot}.
+ *
+ * @param slot The slot for the stack
+ * @param stack The item stack to set
+ */
+ void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack stack);
+ // Paper end
}

View file

@ -448,16 +448,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ com.destroystokyo.paper.entity.ai.MobGoals getMobGoals();
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Tameable.java
+++ b/src/main/java/org/bukkit/entity/Tameable.java
@@ -0,0 +0,0 @@ package org.bukkit.entity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-public interface Tameable extends Entity {
+public interface Tameable extends Animals { // Paper
/**
* Check if this is tamed

View file

@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface Tameable extends Entity {
@@ -0,0 +0,0 @@ public interface Tameable extends Entity {
public interface Tameable extends Animals {
@@ -0,0 +0,0 @@ public interface Tameable extends Animals {
*/
public void setTamed(boolean tame);

View file

@ -1,65 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sun, 20 Mar 2016 06:45:01 -0400
Subject: [PATCH] Access items by EquipmentSlot
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
@@ -0,0 +0,0 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
public void setBootsDropChance(float chance) {
throw new UnsupportedOperationException("Cannot set drop chance for PlayerInventory");
}
+
+ // Paper start
+ @Override
+ public ItemStack getItem(org.bukkit.inventory.EquipmentSlot slot) {
+ Preconditions.checkNotNull(slot, "slot");
+ switch (slot) {
+ case HAND:
+ return this.getItemInMainHand();
+ case OFF_HAND:
+ return this.getItemInOffHand();
+ case HEAD:
+ return this.getHelmet();
+ case CHEST:
+ return this.getChestplate();
+ case LEGS:
+ return this.getLeggings();
+ case FEET:
+ return this.getBoots();
+ }
+
+ throw new UnsupportedOperationException(slot.name());
+ }
+
+ @Override
+ public void setItem(org.bukkit.inventory.EquipmentSlot slot, ItemStack stack) {
+ Preconditions.checkNotNull(slot, "slot");
+ switch (slot) {
+ case HAND:
+ this.setItemInMainHand(stack);
+ return;
+ case OFF_HAND:
+ this.setItemInOffHand(stack);
+ return;
+ case HEAD:
+ this.setHelmet(stack);
+ return;
+ case CHEST:
+ this.setChestplate(stack);
+ return;
+ case LEGS:
+ this.setLeggings(stack);
+ return;
+ case FEET:
+ this.setBoots(stack);
+ return;
+ }
+
+ throw new UnsupportedOperationException(slot.name());
+ }
+ // Paper end
}

@ -1 +1 @@
Subproject commit b999860d432f4ba1bc70c6b5a18918fd43716165
Subproject commit da9ef3c55fa3bce91f7fdcd77d50171be7297d7d

@ -1 +1 @@
Subproject commit 77fd87e4d053a82b1a733a773b235c25c2a6c6a7
Subproject commit 933e9094bfef3b0758f62342f06163bbba1bb6a1