aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server')
-rw-r--r--patches/server/1024-Proxy-ItemStack-to-CraftItemStack.patch12
-rw-r--r--patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch2
2 files changed, 7 insertions, 7 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;
}
diff --git a/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch b/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
index 4ee70dccd4..95338b76bf 100644
--- a/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
+++ b/patches/server/1025-Make-a-PDC-view-accessible-directly-from-ItemStack.patch
@@ -97,7 +97,7 @@ index 0000000000000000000000000000000000000000..fac401280d3f3689b00e16c19155ca75
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index 0cf6c0f6371c61d2e3ef240415d81554a81190d0..b6981c589695db7006165726d2ab5edce4a9f435 100644
+index 814e8ece6821e359b504e8c4d140cc38700f2abe..32a41c8b324aad67b9dcf74387aef299e6478a64 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -480,4 +480,63 @@ public final class CraftItemStack extends ItemStack {