aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch')
-rw-r--r--patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch12
1 files changed, 6 insertions, 6 deletions
diff --git a/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch b/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
index bc216c4936..aba1d9b341 100644
--- a/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
+++ b/patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Proxy ItemStack to CraftItemStack
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554a81190d0 100644
+index be36336a3c7d1ae88277f4ee1be70075001de7a7..814e8ece6821e359b504e8c4d140cc38700f2abe 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -25,15 +25,57 @@ import org.bukkit.material.MaterialData;
@@ -29,7 +29,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554
+ }
+ }
+
-+ private static CraftItemStack convertToCraftStack(final ItemStack bukkit) {
++ private static CraftItemStack getCraftStack(final ItemStack bukkit) {
+ if (bukkit instanceof final CraftItemStack craftItemStack) {
+ return craftItemStack;
} else {
@@ -52,7 +52,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554
+ @Override
+ public boolean equals(final Object obj) {
+ if (!(obj instanceof final org.bukkit.inventory.ItemStack bukkit)) return false;
-+ final CraftItemStack craftStack = convertToCraftStack(bukkit);
++ final CraftItemStack craftStack = getCraftStack(bukkit);
+ if (this.handle == craftStack.handle) return true;
+ else if (this.handle == null || craftStack.handle == null) return false;
+ else if (this.handle.isEmpty() && craftStack.handle.isEmpty()) return true;
@@ -63,7 +63,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554
+ // Paper start - MC Utils
+ public static net.minecraft.world.item.ItemStack unwrap(ItemStack bukkit) {
+ // Paper start - re-implement after delegating all api ItemStack calls to CraftItemStack
-+ final CraftItemStack craftItemStack = convertToCraftStack(bukkit);
++ final CraftItemStack craftItemStack = getCraftStack(bukkit);
+ return craftItemStack.handle == null ? net.minecraft.world.item.ItemStack.EMPTY : craftItemStack.handle;
+ // Paper end - re-implement after delegating all api ItemStack calls to CraftItemStack
+ }
@@ -96,7 +96,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554
- CraftItemStack.setItemMeta(stack, original.getItemMeta());
- }
- return stack;
-+ final CraftItemStack stack = convertToCraftStack(original);
++ final CraftItemStack stack = getCraftStack(original);
+ return stack.handle == null ? net.minecraft.world.item.ItemStack.EMPTY : stack.handle.copy();
+ // Paper end - re-implement after delegating all api ItemStack calls to CraftItemStack
}
@@ -143,7 +143,7 @@ index be36336a3c7d1ae88277f4ee1be70075001de7a7..0cf6c0f6371c61d2e3ef240415d81554
- }
-
- CraftItemStack that = (CraftItemStack) stack;
-+ final CraftItemStack that = convertToCraftStack(stack); // Paper - re-implement after delegating all api ItemStack calls to CraftItemStack
++ final CraftItemStack that = getCraftStack(stack); // Paper - re-implement after delegating all api ItemStack calls to CraftItemStack
if (this.handle == that.handle) {
return true;
}