mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-20 02:08:15 +02:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@babffb5 Undeprecate and fix Boat#getBoatMaterial (#8217) PaperMC/Paper@d60497e Updated Upstream (Bukkit/CraftBukkit) PaperMC/Paper@dd3e4e7 Initial support for signed messages (#8198) PaperMC/Paper@ceef4b9 Don't call AsyncTabCompleteEvent from netty IO thread (#8218) PaperMC/Paper@e0486ae Fix suggest command message for brigadier syntax exceptions (#8221)
This commit is contained in:
@@ -389,7 +389,7 @@ index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
index 8e6ad6ffb6918742d47b58d6cb1ad646d5e3df5f..331adbaf782c00d801a36c0c9551451a817daf6d 100644
|
||||
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..9584e245144b561b4f6745b2f26a4f69a6f92891 100644
|
||||
--- a/src/main/java/org/bukkit/map/MapPalette.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapPalette.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -400,16 +400,16 @@ index 8e6ad6ffb6918742d47b58d6cb1ad646d5e3df5f..331adbaf782c00d801a36c0c9551451a
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
@@ -35,7 +36,7 @@ public final class MapPalette {
|
||||
@@ -40,7 +41,7 @@ public final class MapPalette {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
- static final Color[] colors = {
|
||||
+ public static final Color[] colors = { // Pufferfish - public access
|
||||
c(0, 0, 0), c(0, 0, 0), c(0, 0, 0), c(0, 0, 0),
|
||||
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
|
||||
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
|
||||
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
|
||||
@@ -206,9 +207,15 @@ public final class MapPalette {
|
||||
@@ -211,9 +212,15 @@ public final class MapPalette {
|
||||
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
|
||||
|
||||
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Mon, 11 Jul 2022 21:09:14 -0500
|
||||
Subject: [PATCH] Chat Preview API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/player/PlayerPreviewChatEvent.java b/src/main/java/org/purpurmc/purpur/event/player/PlayerPreviewChatEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..94ccdf11201774f9bea3ba56c4dde148ff5199f8
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/player/PlayerPreviewChatEvent.java
|
||||
@@ -0,0 +1,91 @@
|
||||
+package org.purpurmc.purpur.event.player;
|
||||
+
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
+
|
||||
+public class PlayerPreviewChatEvent extends PlayerEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final String originalQuery;
|
||||
+ private Component query;
|
||||
+
|
||||
+ public PlayerPreviewChatEvent(@NotNull Player who, @Nullable Component query) {
|
||||
+ super(who, !Bukkit.isPrimaryThread());
|
||||
+ this.originalQuery = query == null ? "" : LegacyComponentSerializer.legacySection().serialize(query);
|
||||
+ this.query = query;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * The original query string as sent from the client
|
||||
+ *
|
||||
+ * @return The original query string
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getOriginalQuery() {
|
||||
+ return originalQuery;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the current query.
|
||||
+ * <p>
|
||||
+ * Null queries represent "no changes".
|
||||
+ *
|
||||
+ * @return Current query
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Component getQuery() {
|
||||
+ return this.query;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the current query.
|
||||
+ * <p>
|
||||
+ * Null queries represent "no changes".
|
||||
+ *
|
||||
+ * @param query The current query
|
||||
+ */
|
||||
+ public void setQuery(@Nullable Component query) {
|
||||
+ this.query = query;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the cancellation state of this event.
|
||||
+ * <p>
|
||||
+ * A cancelled event tells the client there are "no changes"
|
||||
+ * to the chat, the same as setting the query to null.
|
||||
+ *
|
||||
+ * @return true if this event is cancelled
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return this.query == null;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the cancellation state of this event.
|
||||
+ * <p>
|
||||
+ * A cancelled event tells the client there are "no changes"
|
||||
+ * to the chat, the same as setting the query to null.
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.query = null;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
Reference in New Issue
Block a user