3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Paper/patches/server/0143-ensureServerConversions-API.patch
Bjarne Koll f1649d702b
Work it
2024-10-22 23:30:51 +02:00

26 Zeilen
1.3 KiB
Diff

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
index 5d7e6b61102a6244c5426917c4ff280fa9e12cf1..91010267b8c4df582415a8f7cd7386723b556cc0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -226,4 +226,12 @@ public final class CraftItemFactory implements ItemFactory {
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
}