From 8d3051557675e6790233345e87bb244343ecfb76 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 28 Jul 2022 04:00:00 +1000 Subject: [PATCH] Update to Minecraft 1.19.1 By: md_5 --- paper-api/pom.xml | 2 +- .../src/main/java/org/bukkit/GameEvent.java | 2 ++ .../main/java/org/bukkit/entity/Player.java | 7 ++++ .../player/AsyncPlayerChatPreviewEvent.java | 36 +++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatPreviewEvent.java diff --git a/paper-api/pom.xml b/paper-api/pom.xml index 483ccdfeda..f01e77a358 100644 --- a/paper-api/pom.xml +++ b/paper-api/pom.xml @@ -5,7 +5,7 @@ org.bukkit bukkit - 1.19-R0.1-SNAPSHOT + 1.19.1-R0.1-SNAPSHOT jar Bukkit diff --git a/paper-api/src/main/java/org/bukkit/GameEvent.java b/paper-api/src/main/java/org/bukkit/GameEvent.java index 97858a8d09..4808824a55 100644 --- a/paper-api/src/main/java/org/bukkit/GameEvent.java +++ b/paper-api/src/main/java/org/bukkit/GameEvent.java @@ -62,6 +62,8 @@ public final class GameEvent implements Keyed { public static final GameEvent INSTRUMENT_PLAY = getEvent("instrument_play"); public static final GameEvent ITEM_INTERACT_FINISH = getEvent("item_interact_finish"); public static final GameEvent ITEM_INTERACT_START = getEvent("item_interact_start"); + public static final GameEvent JUKEBOX_PLAY = getEvent("jukebox_play"); + public static final GameEvent JUKEBOX_STOP_PLAY = getEvent("jukebox_stop_play"); public static final GameEvent LIGHTNING_STRIKE = getEvent("lightning_strike"); @Deprecated public static final GameEvent MOB_INTERACT = getEvent("entity_interact"); diff --git a/paper-api/src/main/java/org/bukkit/entity/Player.java b/paper-api/src/main/java/org/bukkit/entity/Player.java index 3931b70b7a..d86c5320c7 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Player.java +++ b/paper-api/src/main/java/org/bukkit/entity/Player.java @@ -38,6 +38,13 @@ import org.jetbrains.annotations.Nullable; */ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient { + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getName(); + /** * Gets the "friendly" name to display of this player. This may include * color. diff --git a/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatPreviewEvent.java b/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatPreviewEvent.java new file mode 100644 index 0000000000..9bb17fde6c --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/event/player/AsyncPlayerChatPreviewEvent.java @@ -0,0 +1,36 @@ +package org.bukkit.event.player; + +import java.util.Set; +import org.bukkit.Warning; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; + +/** + * Used to format chat for chat preview. If this event is used, then the result + * of the corresponding {@link AsyncPlayerChatEvent} must be formatted in + * the same way. + * + * @deprecated draft API + */ +@Deprecated +@Warning(false) +public class AsyncPlayerChatPreviewEvent extends AsyncPlayerChatEvent { + + private static final HandlerList handlers = new HandlerList(); + + public AsyncPlayerChatPreviewEvent(final boolean async, @NotNull final Player who, @NotNull final String message, @NotNull final Set players) { + super(async, who, message, players); + } + + @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + + @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +}