18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
28 Zeilen
1.1 KiB
Diff
28 Zeilen
1.1 KiB
Diff
From 85f648495e3ba44c78f3f4e31ab8d207baf9d236 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 49ebad22e..eb6987338 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
@@ -194,4 +194,11 @@ public final class CraftItemFactory implements ItemFactory {
|
|
public Color getDefaultLeatherColor() {
|
|
return DEFAULT_LEATHER_COLOR;
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public ItemStack ensureServerConversions(ItemStack item) {
|
|
+ return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
--
|
|
2.18.0
|
|
|