aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch')
-rw-r--r--patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch76
1 files changed, 76 insertions, 0 deletions
diff --git a/patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch
new file mode 100644
index 0000000000..ff14019e55
--- /dev/null
+++ b/patches/api/0209-Create-HoverEvent-from-ItemStack-Entity.patch
@@ -0,0 +1,76 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: ysl3000 <[email protected]>
+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
+index e34c89a945a0f12cdc4be8cc232c8de986474372..dbebaf8172ec6872f56958b9583affde4f8400a4 100644
+--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
++++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
+@@ -265,4 +265,65 @@ public interface ItemFactory {
+ @NotNull
+ ItemStack ensureServerConversions(@NotNull ItemStack item);
+ // Paper end - ensure server conversions API
++
++ // Paper start - bungee hover events
++ /**
++ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack for displaying.
++ *
++ * @param itemStack the itemstack
++ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack
++ * @deprecated use {@link ItemStack#asHoverEvent()}
++ */
++ @NotNull
++ @Deprecated // Paper
++ 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 - bungee hover events
+ }