Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +01:00
4104545b11
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
25 Zeilen
1.3 KiB
Diff
25 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] 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 8f05c6832fc968666f0e6e0a19f6dd74d92d0c28..69852a3801439db075e522aa2e2dc51e84c3deda 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
|
@@ -349,5 +349,11 @@ public final class CraftItemFactory implements ItemFactory {
|
|
public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) {
|
|
return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName());
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public ItemStack ensureServerConversions(ItemStack item) {
|
|
+ return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
|
+ }
|
|
// Paper end
|
|
}
|