2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: ysl3000 <yannicklamprecht@live.de>
|
|
|
|
Date: Mon, 6 Jul 2020 22:17:37 +0200
|
|
|
|
Subject: [PATCH] Create HoverEvent from ItemStack Entity
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
2024-01-14 09:46:04 +00:00
|
|
|
index 6aeae6b78106b8fd434614591adb5ead41dec8e1..198eebd45a2efa6986a8f4b613424eb8b6d3a039 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
2024-01-14 09:46:04 +00:00
|
|
|
@@ -265,4 +265,65 @@ public interface ItemFactory {
|
2021-06-14 13:45:16 +00:00
|
|
|
@NotNull
|
|
|
|
ItemStack ensureServerConversions(@NotNull ItemStack item);
|
2023-08-06 00:21:59 +00:00
|
|
|
// Paper end - ensure server conversions API
|
2021-06-11 12:02:28 +00:00
|
|
|
+
|
2023-08-06 00:21:59 +00:00
|
|
|
+ // Paper start - bungee hover events
|
2021-06-11 12:02:28 +00:00
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack for displaying.
|
|
|
|
+ *
|
2023-04-16 01:13:59 +00:00
|
|
|
+ * @param itemStack the itemstack
|
2021-06-11 12:02:28 +00:00
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack
|
2023-04-16 01:13:59 +00:00
|
|
|
+ * @deprecated use {@link ItemStack#asHoverEvent()}
|
2021-06-11 12:02:28 +00:00
|
|
|
+ */
|
|
|
|
+ @NotNull
|
2023-04-16 01:13:59 +00:00
|
|
|
+ @Deprecated // Paper
|
2021-06-11 12:02:28 +00:00
|
|
|
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull ItemStack itemStack);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
|
|
|
+ * Uses the display name of the entity, if present.
|
|
|
|
+ *
|
|
|
|
+ * @param entity Entity to create the HoverEvent for
|
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
|
|
|
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent()}
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ @Deprecated
|
|
|
|
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
|
|
|
+ *
|
|
|
|
+ * @param entity Entity to create the HoverEvent for
|
|
|
|
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
|
|
|
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ @Deprecated
|
|
|
|
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @Nullable String customName);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
|
|
|
+ *
|
|
|
|
+ * @param entity Entity to create the HoverEvent for
|
|
|
|
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
|
|
|
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ @Deprecated
|
|
|
|
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @Nullable net.md_5.bungee.api.chat.BaseComponent customName);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
|
|
|
+ *
|
|
|
|
+ * @param entity Entity to create the HoverEvent for
|
|
|
|
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
|
|
|
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ @Deprecated
|
|
|
|
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName);
|
2023-08-06 00:21:59 +00:00
|
|
|
+ // Paper end - bungee hover events
|
2021-06-11 12:02:28 +00:00
|
|
|
}
|