aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0673-Make-some-itemstacks-nonnull.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-10-27 18:11:15 +0100
committerNassim Jahnke <[email protected]>2024-10-27 18:39:30 +0100
commit02bca1e6558bf4ac0cbf928d48e90f497b10b0a3 (patch)
tree1144072e447f4c0b7e80b278fd769106227f016a /patches/server/0673-Make-some-itemstacks-nonnull.patch
parent12ed02105177f54906a7d4422b235929426bc264 (diff)
downloadPaper-02bca1e6558bf4ac0cbf928d48e90f497b10b0a3.tar.gz
Paper-02bca1e6558bf4ac0cbf928d48e90f497b10b0a3.zip
Remove timings impl
Diffstat (limited to 'patches/server/0673-Make-some-itemstacks-nonnull.patch')
-rw-r--r--patches/server/0673-Make-some-itemstacks-nonnull.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/server/0673-Make-some-itemstacks-nonnull.patch b/patches/server/0673-Make-some-itemstacks-nonnull.patch
new file mode 100644
index 0000000000..20944d9088
--- /dev/null
+++ b/patches/server/0673-Make-some-itemstacks-nonnull.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Tue, 15 Mar 2022 01:38:15 -0700
+Subject: [PATCH] Make some itemstacks nonnull
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+index 107fa1d4bd977d17dc062da280dda46eb3c5f81c..e62baea16df017f1e394e3c706157e158066eb93 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
+@@ -155,13 +155,13 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
+ case OFF_HAND:
+ return this.getItemInOffHand();
+ case FEET:
+- return this.getBoots();
++ return java.util.Objects.requireNonNullElseGet(this.getBoots(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
+ case LEGS:
+- return this.getLeggings();
++ return java.util.Objects.requireNonNullElseGet(this.getLeggings(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
+ case CHEST:
+- return this.getChestplate();
++ return java.util.Objects.requireNonNullElseGet(this.getChestplate(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
+ case HEAD:
+- return this.getHelmet();
++ return java.util.Objects.requireNonNullElseGet(this.getHelmet(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
+ default:
+ throw new IllegalArgumentException("Could not get slot " + slot + " - not a valid slot for PlayerInventory");
+ }