2021-06-11 14:02:28 +02: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
|
2022-02-12 14:20:33 +01:00
|
|
|
index 9ba084c0aefb8d8d654880268cdb7266b4237bbb..96f9481ca2f79dca525e0720e41a716bcebe0baf 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
2022-01-17 01:53:26 +01:00
|
|
|
@@ -187,5 +187,62 @@ public interface ItemFactory {
|
2021-06-11 14:02:28 +02:00
|
|
|
*/
|
2021-06-14 15:45:16 +02:00
|
|
|
@NotNull
|
|
|
|
ItemStack ensureServerConversions(@NotNull ItemStack item);
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack for displaying.
|
|
|
|
+ *
|
|
|
|
+ * @param itemStack
|
|
|
|
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
|
|
|
+ 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);
|
|
|
|
// Paper end
|
|
|
|
}
|