2020-01-22 03:02:07 +01:00
|
|
|
From e2ec596f328db2922bc58371a5af7e215905d352 Mon Sep 17 00:00:00 2001
|
2017-07-27 05:40:49 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 4 May 2016 22:43:12 -0400
|
|
|
|
Subject: [PATCH] Implement 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
|
2020-01-22 03:02:07 +01:00
|
|
|
index 01ab19434..8b219b5fa 100644
|
2017-07-27 05:40:49 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
2019-12-13 15:08:40 +01:00
|
|
|
@@ -335,4 +335,10 @@ public final class CraftItemFactory implements ItemFactory {
|
2018-07-18 02:08:13 +02:00
|
|
|
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
|
|
|
|
return ((CraftMetaItem) meta).updateMaterial(material);
|
2017-07-27 05:40:49 +02:00
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public ItemStack ensureServerConversions(ItemStack item) {
|
|
|
|
+ return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
--
|
2020-01-22 03:02:07 +01:00
|
|
|
2.25.0.windows.1
|
2017-07-27 05:40:49 +02:00
|
|
|
|