Add PlayerProfile API to replace GameProfile

This simply provides the base API to create the objects. Further commits will come that adds
adds usage of this API to existing GameProfile based API's, as well as new API's.
This commit is contained in:
Aikar
2018-01-15 22:13:17 -05:00
parent 2f0e48c89a
commit 71c18fd5c9
76 changed files with 661 additions and 241 deletions

View File

@@ -0,0 +1,27 @@
From aae8be84bd2b26b5a192bd5f1b6cdc2eb220d051 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.15.1