2018-10-05 03:18:46 +00:00
|
|
|
From 995ff17669ecc2be7d3a6b7350ec7d2e4bf7c74c Mon Sep 17 00:00:00 2001
|
2017-07-27 03:40:49 +00: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
|
2018-09-28 23:31:59 +00:00
|
|
|
index 5fc0283b22..be5f922cb6 100644
|
2017-07-27 03:40:49 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
2018-08-27 15:07:22 +00:00
|
|
|
@@ -295,4 +295,10 @@ public final class CraftItemFactory implements ItemFactory {
|
2018-07-18 00:08:13 +00:00
|
|
|
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
|
|
|
|
return ((CraftMetaItem) meta).updateMaterial(material);
|
2017-07-27 03:40:49 +00:00
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public ItemStack ensureServerConversions(ItemStack item) {
|
|
|
|
+ return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
--
|
2018-09-28 23:31:59 +00:00
|
|
|
2.19.0
|
2017-07-27 03:40:49 +00:00
|
|
|
|