2024-04-24 03:25:14 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 4 May 2016 22:43:12 -0400
|
|
|
|
Subject: [PATCH] ensureServerConversions API
|
|
|
|
|
|
|
|
This will take a Bukkit ItemStack and run it through any conversions a server process would perform on it,
|
|
|
|
to ensure it meets latest minecraft expectations.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
2024-06-13 16:45:27 +02:00
|
|
|
index e8dd4ba93c09c514f3594f0d4b5f1167b719a17d..aa1d144dfffc780284fc0a955ff18b711dc8c7bf 100644
|
2024-04-24 03:25:14 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
2024-06-13 16:45:27 +02:00
|
|
|
@@ -516,4 +516,12 @@ public final class CraftItemFactory implements ItemFactory {
|
2024-04-24 03:25:14 +02:00
|
|
|
return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName());
|
|
|
|
}
|
|
|
|
// Paper end - Adventure
|
|
|
|
+
|
|
|
|
+ // Paper start - ensure server conversions API
|
|
|
|
+ // TODO: DO WE NEED THIS?
|
|
|
|
+ @Override
|
|
|
|
+ public ItemStack ensureServerConversions(ItemStack item) {
|
|
|
|
+ return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
|
|
|
+ }
|
|
|
|
+ // Paper end - ensure server conversions API
|
|
|
|
}
|