3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

more cleanup and resource pack api fixes

Dieser Commit ist enthalten in:
Jake Potrebic 2023-12-08 15:13:02 -08:00
Ursprung 7606e6da39
Commit f17622cc3d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
59 geänderte Dateien mit 490 neuen und 332 gelöschten Zeilen

Datei anzeigen

@ -2134,7 +2134,7 @@ index 8532b8484d5a493c1c37ad7508597f624f1831c8..978431fd88cfb7d42fcdea8c904633df
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e55572dfd8 100644
index 8aee70e27688ff85367b3534c6ccb64aeba95d74..7a6be9c1d74fca1b03bf4c6ef804e8027201b8e7 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -52,7 +52,41 @@ import org.jetbrains.annotations.Nullable;
@ -2468,11 +2468,20 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
/**
@@ -1309,7 +1520,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the URL is null.
* @throws IllegalArgumentException Thrown if the URL is too long.
* @deprecated Minecraft no longer uses textures packs. Instead you
- * should use {@link #setResourcePack(String)}.
+ * should use {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)}.
*/
@Deprecated
public void setTexturePack(@NotNull String url);
@@ -1377,6 +1588,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
+ * @deprecated in favour of {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@ -2480,7 +2489,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
+ @Deprecated // Paper - adventure
public void setResourcePack(@NotNull String url, @Nullable byte[] hash);
/**
@ -2488,15 +2497,15 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
+ * @deprecated in favour of {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1433,8 +1647,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1433,8 +1647,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
+ @Deprecated // Paper - adventure
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt);
+ // Paper start
@ -2521,9 +2530,6 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
+ * case this method will have no affect on them. Use the
+ * {@link PlayerResourcePackStatusEvent} to figure out whether or not
+ * the player loaded the pack!
+ * <li>There is no concept of resetting resource packs back to default
+ * within Minecraft, so players will have to relog to do so or you
+ * have to send an empty pack.
+ * <li>The request is sent with empty string as the hash when the hash is
+ * not provided. This might result in newer versions not loading the
+ * pack correctly.
@ -2542,7 +2548,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
+ * @throws IllegalArgumentException Thrown if the hash is not 20 bytes
+ * long.
+ */
+ default void setResourcePack(@NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt) {
+ default void setResourcePack(final @NotNull String url, final byte @Nullable [] hash, final net.kyori.adventure.text.@Nullable Component prompt) {
+ this.setResourcePack(url, hash, prompt, false);
+ }
+ // Paper end
@ -2550,7 +2556,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1464,6 +1727,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1464,6 +1724,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
@ -2558,7 +2564,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1524,8 +1788,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1524,8 +1785,56 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
@ -2587,9 +2593,6 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
+ * case this method will have no affect on them. Use the
+ * {@link PlayerResourcePackStatusEvent} to figure out whether or not
+ * the player loaded the pack!
+ * <li>There is no concept of resetting resource packs back to default
+ * within Minecraft, so players will have to relog to do so or you
+ * have to send an empty pack.
+ * <li>The request is sent with empty string as the hash when the hash is
+ * not provided. This might result in newer versions not loading the
+ * pack correctly.
@ -2610,13 +2613,73 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
+ * @throws IllegalArgumentException Thrown if the hash is not 20 bytes
+ * long.
+ */
+ public void setResourcePack(@NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
+ default void setResourcePack(final @NotNull String url, final byte @Nullable [] hash, final net.kyori.adventure.text.@Nullable Component prompt, final boolean force) {
+ this.setResourcePack(UUID.nameUUIDFromBytes(url.getBytes(java.nio.charset.StandardCharsets.UTF_8)), url, hash, prompt, force);
+ }
+ // Paper end
+
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1707,7 +2020,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1570,9 +1879,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* length restriction is an implementation specific arbitrary value.
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
+ * @deprecated use {@link #setResourcePack(UUID, String, byte[], net.kyori.adventure.text.Component, boolean)} )}
*/
+ @Deprecated // Paper - adventure
public void setResourcePack(@NotNull UUID id, @NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force);
+ // Paper start
+ /**
+ * Request that the player's client download and switch resource packs.
+ * <p>
+ * The player's client will download the new resource pack asynchronously
+ * in the background, and will automatically switch to it once the
+ * download is complete. If the client has downloaded and cached a
+ * resource pack with the same hash in the past it will not download but
+ * directly apply the cached pack. If the hash is null and the client has
+ * downloaded and cached the same resource pack in the past, it will
+ * perform a file size check against the response content to determine if
+ * the resource pack has changed and needs to be downloaded again. When
+ * this request is sent for the very first time from a given server, the
+ * client will first display a confirmation GUI to the player before
+ * proceeding with the download.
+ * <p>
+ * Notes:
+ * <ul>
+ * <li>Players can disable server resources on their client, in which
+ * case this method will have no affect on them. Use the
+ * {@link PlayerResourcePackStatusEvent} to figure out whether or not
+ * the player loaded the pack!
+ * <li>The request is sent with empty string as the hash when the hash is
+ * not provided. This might result in newer versions not loading the
+ * pack correctly.
+ * </ul>
+ *
+ * @param uuid Unique resource pack ID.
+ * @param url The URL from which the client will download the resource
+ * pack. The string must contain only US-ASCII characters and should
+ * be encoded as per RFC 1738.
+ * @param hash The sha1 hash sum of the resource pack file which is used
+ * to apply a cached version of the pack directly without downloading
+ * if it is available. Hast to be 20 bytes long!
+ * @param prompt The optional custom prompt message to be shown to client.
+ * @param force If true, the client will be disconnected from the server
+ * when it declines to use the resource pack.
+ * @throws IllegalArgumentException Thrown if the URL is null.
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
+ * length restriction is an implementation specific arbitrary value.
+ * @throws IllegalArgumentException Thrown if the hash is not 20 bytes
+ * long.
+ */
+ void setResourcePack(@NotNull UUID uuid, @NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
+ // Paper end
+
/**
* Gets the Scoreboard displayed to this player
*
@@ -1707,7 +2064,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param title Title text
* @param subtitle Subtitle text
@ -2625,7 +2688,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
*/
@Deprecated
public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -1726,7 +2039,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1726,7 +2083,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
* @param stay time in ticks for titles to stay. Defaults to 70.
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
@ -2635,7 +2698,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
/**
@@ -1953,6 +2268,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1953,6 +2312,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public int getClientViewDistance();
@ -2650,7 +2713,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
/**
* Gets the player's estimated ping in milliseconds.
*
@@ -1978,8 +2301,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1978,8 +2345,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* they wish.
*
* @return the player's locale
@ -2661,7 +2724,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public String getLocale();
/**
@@ -2031,6 +2356,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2031,6 +2400,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isAllowingServerListings();
@ -2676,7 +2739,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
// Spigot start
public class Spigot extends Entity.Spigot {
@@ -2062,11 +2395,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2062,11 +2439,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
throw new UnsupportedOperationException("Not supported yet.");
}
@ -2690,7 +2753,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
@Override
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -2077,7 +2412,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2077,7 +2456,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param component the components to send
@ -2700,7 +2763,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2087,7 +2424,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2087,7 +2468,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param components the components to send
@ -2710,7 +2773,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2098,7 +2437,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2098,7 +2481,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param component the components to send
@ -2720,7 +2783,7 @@ index 8aee70e27688ff85367b3534c6ccb64aeba95d74..d025385f90440dc0a68f926e1777b5e5
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2109,7 +2450,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2109,7 +2494,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param components the components to send

Datei anzeigen

@ -3455,10 +3455,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d025385f90440dc0a68f926e1777b5e55572dfd8..76600c422b70370a23adc8f8c1627fabcc501f07 100644
index 7a6be9c1d74fca1b03bf4c6ef804e8027201b8e7..d642ead25eae4ba106bcfe21ff2579f58ea5135d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2455,7 +2455,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2499,7 +2499,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 76600c422b70370a23adc8f8c1627fabcc501f07..bb153b7e102410fb0631e7b9bedde84550e268f4 100644
index d642ead25eae4ba106bcfe21ff2579f58ea5135d..642a29e3a01bacfc5a36b89eb01387d768b8d5ac 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2307,6 +2307,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2351,6 +2351,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();

Datei anzeigen

@ -75,10 +75,10 @@ index 30dc2f85b60877930cab68230d3259ce92c08618..2867faf0acbbbb2e99c5b503f0c6bc83
public class Spigot {
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index bb153b7e102410fb0631e7b9bedde84550e268f4..17c3fcaca46e1e8f4c14026ee7a6a2d7a472b90c 100644
index 642a29e3a01bacfc5a36b89eb01387d768b8d5ac..7931b05ecbe2580fa9222a57792232711f3e835e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2321,6 +2321,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2365,6 +2365,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88a680d14b 100644
index dd3d0cfae07acbd6d3325d0244581e5cb2c1ee9b..36cb91ee7076f011e0e2558f858a5f9bb1281b44 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1717,7 +1717,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@ -18,11 +18,11 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
public void setResourcePack(@NotNull String url);
/**
@@ -2611,6 +2613,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
}
+
@@ -2091,6 +2093,165 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void setResourcePack(@NotNull UUID uuid, @NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
// Paper end
+ // Paper start - more resource pack API
+ /**
+ * Request that the player's client download and switch resource packs.
+ * <p>
@ -39,8 +39,6 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * <ul>
+ * <li>Players can disable server resources on their client, in which
+ * case this method will have no affect on them.
+ * <li>There is no concept of resetting resource packs back to default
+ * within Minecraft, so players will have to relog to do so.
+ * </ul>
+ *
+ * @param url The URL from which the client will download the resource
@ -52,7 +50,9 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
+ * length restriction is an implementation specific arbitrary value.
+ */
+ void setResourcePack(@NotNull String url, @NotNull String hash);
+ default void setResourcePack(final @NotNull String url, final @NotNull String hash) {
+ this.setResourcePack(url, hash, false);
+ }
+
+ /**
+ * Request that the player's client download and switch resource packs.
@ -70,8 +70,6 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * <ul>
+ * <li>Players can disable server resources on their client, in which
+ * case this method will have no affect on them.
+ * <li>There is no concept of resetting resource packs back to default
+ * within Minecraft, so players will have to relog to do so.
+ * </ul>
+ *
+ * @param url The URL from which the client will download the resource
@ -84,7 +82,9 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
+ * length restriction is an implementation specific arbitrary value.
+ */
+ void setResourcePack(@NotNull String url, @NotNull String hash, boolean required);
+ default void setResourcePack(final @NotNull String url, final @NotNull String hash, final boolean required) {
+ this.setResourcePack(url, hash, required, null);
+ }
+
+ /**
+ * Request that the player's client download and switch resource packs.
@ -102,8 +102,6 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * <ul>
+ * <li>Players can disable server resources on their client, in which
+ * case this method will have no affect on them.
+ * <li>There is no concept of resetting resource packs back to default
+ * within Minecraft, so players will have to relog to do so.
+ * </ul>
+ *
+ * @param url The URL from which the client will download the resource
@ -117,65 +115,90 @@ index fdde0f82531fba370327ff71f59c2c4722d42df2..339b3a4ebae8a522ec3932f901729f88
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
+ * length restriction is an implementation specific arbitrary value.
+ */
+ void setResourcePack(@NotNull String url, @NotNull String hash, boolean required, @Nullable net.kyori.adventure.text.Component resourcePackPrompt);
+ /**
+ * @return the most recent resource pack status received from the player,
+ * or null if no status has ever been received from this player.
+ */
+ @Nullable
+ org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus();
+
+ /**
+ * @return the most recent resource pack hash received from the player,
+ * or null if no hash has ever been received from this player.
+ *
+ * @deprecated This is no longer sent from the client and will always be null
+ */
+ @Nullable
+ @Deprecated
+ String getResourcePackHash();
+
+ /**
+ * @return true if the last resource pack status received from this player
+ * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
+ */
+ boolean hasResourcePack();
// Paper end
// Spigot start
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index e2c4f9a0456cef345772d57b4d9c6e7d9598dd53..d80191e0848e04bbfb740113b9b1646dae087ec0 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -13,14 +13,34 @@ public class PlayerResourcePackStatusEvent extends PlayerEvent {
private static final HandlerList handlers = new HandlerList();
private final UUID id;
+ @Deprecated
+ private final String hash; // Paper
private final Status status;
public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull UUID id, @NotNull Status resourcePackStatus) {
super(who);
this.id = id;
+ this.hash = null; // Paper
this.status = resourcePackStatus;
}
+ @Deprecated // Paper
+ public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull UUID id, Status resourcePackStatus, String hash) {
+ super(who);
+ this.id = id;
+ this.hash = hash; // Paper
+ this.status = resourcePackStatus;
+ default void setResourcePack(final @NotNull String url, final @NotNull String hash, final boolean required, final net.kyori.adventure.text.@Nullable Component resourcePackPrompt) {
+ this.setResourcePack(UUID.nameUUIDFromBytes(url.getBytes(java.nio.charset.StandardCharsets.UTF_8)), url, hash, resourcePackPrompt, required);
+ }
+
+ /**
+ * Request that the player's client download and switch resource packs.
+ * <p>
+ * The player's client will download the new resource pack asynchronously
+ * in the background, and will automatically switch to it once the
+ * download is complete. If the client has downloaded and cached the same
+ * resource pack in the past, it will perform a quick timestamp check
+ * over the network to determine if the resource pack has changed and
+ * needs to be downloaded again. When this request is sent for the very
+ * first time from a given server, the client will first display a
+ * confirmation GUI to the player before proceeding with the download.
+ * <p>
+ * Notes:
+ * <ul>
+ * <li>Players can disable server resources on their client, in which
+ * case this method will have no affect on them.
+ * </ul>
+ *
+ * @param uuid Unique resource pack ID.
+ * @param url The URL from which the client will download the resource
+ * pack. The string must contain only US-ASCII characters and should
+ * be encoded as per RFC 1738.
+ * @param hash A 40 character hexadecimal and lowercase SHA-1 digest of
+ * the resource pack file.
+ * @param resourcePackPrompt A Prompt to be displayed in the client request
+ * @param required Marks if the resource pack should be required by the client
+ * @throws IllegalArgumentException Thrown if the URL is null.
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
+ * length restriction is an implementation specific arbitrary value.
+ */
+ void setResourcePack(@NotNull UUID uuid, @NotNull String url, @NotNull String hash, net.kyori.adventure.text.@Nullable Component resourcePackPrompt, boolean required);
+
+ /**
+ * Gets the most recent resource pack status from the player.
+ *
+ * @return the most recent status or null
+ */
+ org.bukkit.event.player.PlayerResourcePackStatusEvent.@Nullable Status getResourcePackStatus();
+
+ /**
+ * Gets the most recent pack hash from the player.
+ *
+ * @return the most recent hash or null
+ * @deprecated This is no longer sent from the client and will always be null
+ */
+ @Deprecated(forRemoval = true)
+ @org.jetbrains.annotations.Contract("-> null")
+ default @Nullable String getResourcePackHash() {
+ return null;
+ }
+
+ /**
+ * Gets if the last resource pack status from the player
+ * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}.
+ *
+ * @return true if last status was successfully loaded
+ */
+ default boolean hasResourcePack() {
+ return this.getResourcePackStatus() == org.bukkit.event.player.PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED;
+ }
+ // Paper end - more resource pack API
+
/**
* Gets the Scoreboard displayed to this player
*
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index e2c4f9a0456cef345772d57b4d9c6e7d9598dd53..e4c32b21ab013703a6a1b07a1ad564d914ebe83f 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -21,6 +21,16 @@ public class PlayerResourcePackStatusEvent extends PlayerEvent {
this.status = resourcePackStatus;
}
+ // Paper start - add hash (not used anymore)
+ /**
+ * @deprecated Hash does not seem to ever be set
+ */
+ @Deprecated
+ @Deprecated(forRemoval = true)
+ public String getHash() {
+ return this.hash;
+ return null;
+ }
+ // Paper end
+

Datei anzeigen

@ -386,7 +386,7 @@ index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218
@Override
public int getConversionTime();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 271a6f3f527d45232f992039f6dc1d6419750821..cdc797fd351ffb261a0233e48b684dfd3bb62386 100644
index 680d8fddb6150a33f3012c348376101607ee2cb2..0b1ad0e33dd4a2b05a0c668562ed59cbf4d6a442 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -432,15 +432,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@ -445,6 +445,76 @@ index 271a6f3f527d45232f992039f6dc1d6419750821..cdc797fd351ffb261a0233e48b684dfd
* remain hidden until the other plugin calls this method too.
*
* @param plugin Plugin that wants to show the entity
@@ -1703,9 +1703,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting texture packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is send with "null" as the hash. This might result
* in newer versions not loading the pack correctly.
* </ul>
@@ -1739,9 +1736,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is send with empty string as the hash. This might result
* in newer versions not loading the pack correctly.
* </ul>
@@ -1778,9 +1772,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is sent with empty string as the hash when the hash is
* not provided. This might result in newer versions not loading the
* pack correctly.
@@ -1823,9 +1814,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is sent with empty string as the hash when the hash is
* not provided. This might result in newer versions not loading the
* pack correctly.
@@ -1914,9 +1902,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is sent with empty string as the hash when the hash is
* not provided. This might result in newer versions not loading the
* pack correctly.
@@ -1960,9 +1945,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is sent with empty string as the hash when the hash is
* not provided. This might result in newer versions not loading the
* pack correctly.
@@ -2054,9 +2036,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
- * <li>There is no concept of resetting resource packs back to default
- * within Minecraft, so players will have to relog to do so or you
- * have to send an empty pack.
* <li>The request is sent with empty string as the hash when the hash is
* not provided. This might result in newer versions not loading the
* pack correctly.
diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java
index a5ad3250cebfeb302c58e0bfd6db1295913c927e..bfac874840cf1f36afba16ae4d176c5821a68cfb 100644
--- a/src/main/java/org/bukkit/entity/Slime.java
@ -837,7 +907,7 @@ index 6782024735a885ba0b1b4dba4a576740c1410366..8977f7609431c3c46324a82de84d4a32
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index d80191e0848e04bbfb740113b9b1646dae087ec0..25ac728dac8c15c18851dde4cbcc10028552ae77 100644
index e4c32b21ab013703a6a1b07a1ad564d914ebe83f..e58fecf0fe54db06e0e944027923a352fd8005d8 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -6,8 +6,9 @@ import org.bukkit.event.HandlerList;

Datei anzeigen

@ -93,34 +93,36 @@ index aad8b2fbdbb03fbf32f99b3a533716eca9d42219..405b6a388c3593a83985f766e79b9295
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 695bdf0bca8af1360d4deeb4aadedf1fb4140223..7a24cc6617b55bdeea4cf6d70e3abb835b0697bf 100644
index 2787f205b08b9c0dc97c6a49ade01b319ef23630..985185802e0ad5d063e83ad22a1bcc735d722f04 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2787,6 +2787,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
*/
boolean hasResourcePack();
+
@@ -2853,6 +2853,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
}
// Paper end
+ // Paper start - Player Profile API
+ /**
+ * Gets a copy of this players profile
+ *
+ * @return The players profile object
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ com.destroystokyo.paper.profile.@NotNull PlayerProfile getPlayerProfile();
+
+ /**
+ * Changes the PlayerProfile for this player. This will cause this player
+ * to be reregistered to all clients that can currently see this player.
+ *
+ * to be re-registered to all clients that can currently see this player.
+ * <p>
+ * After executing this method, the player {@link java.util.UUID} won't
+ * be swapped, only their name and gameprofile properties.
+ * be swapped, only their name and profile properties.
+ *
+ * @param profile The new profile to use
+ */
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
// Paper end
+ void setPlayerProfile(com.destroystokyo.paper.profile.@NotNull PlayerProfile profile);
+ // Paper end - Player Profile API
+
// Spigot start
public class Spigot extends Entity.Spigot {
diff --git a/src/main/java/org/bukkit/profile/PlayerProfile.java b/src/main/java/org/bukkit/profile/PlayerProfile.java
index fc46add38bf59dc1a04ea566fd230dcd8ae2708c..d36b3e3c7e53840132011add365ca2a26d799064 100644
--- a/src/main/java/org/bukkit/profile/PlayerProfile.java

Datei anzeigen

@ -36,10 +36,10 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f
/**
* Make the entity drop the item in their hand.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7a24cc6617b55bdeea4cf6d70e3abb835b0697bf..9e2b93ce876ae69ec05bc55b15a4e0ebf054aa50 100644
index 985185802e0ad5d063e83ad22a1bcc735d722f04..ab7df32513667f9c73540c2d74e438daed1381b0 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2632,10 +2632,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2814,10 +2814,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*

Datei anzeigen

@ -5,14 +5,14 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 203e8555bfd410b9becfa7e0fb88728dfbd98f77..fe06d06cf97b1b020c771fb455f644d68097f1ef 100644
index 7899925a60e81e0d58a288f033d3c5d2789485ed..5466b250db43bd92137f46d249a0dd8558491567 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2963,6 +2963,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param profile The new profile to use
*/
void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+
@@ -3031,6 +3031,28 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void setPlayerProfile(com.destroystokyo.paper.profile.@NotNull PlayerProfile profile);
// Paper end - Player Profile API
+ // Paper start - attack cooldown API
+ /**
+ * Returns the amount of ticks the current cooldown lasts
+ *
@ -32,6 +32,8 @@ index 203e8555bfd410b9becfa7e0fb88728dfbd98f77..fe06d06cf97b1b020c771fb455f644d6
+ * Reset the cooldown counter to 0, effectively starting the cooldown period.
+ */
+ void resetCooldown();
// Paper end
+ // Paper end - attack cooldown API
+
// Spigot start
public class Spigot extends Entity.Spigot {

Datei anzeigen

@ -229,19 +229,20 @@ index 0000000000000000000000000000000000000000..cf67dc7d465223710adbf2b798109f52
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1afa65152f56e42793cb53a049e06b16eabe2ce4..cf2090ee92e7245c028a0e625cdb483665b3821f 100644
index 716b2023ee3e03a70f0afc0c26558fc0a2ee356b..1e52cc88dc47f2494af505d92ebe56f79780a099 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2980,6 +2980,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Reset the cooldown counter to 0, effectively starting the cooldown period.
*/
@@ -3050,6 +3050,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void resetCooldown();
+
// Paper end - attack cooldown API
+ // Paper start - client option API
+ /**
+ * @return the client option value of the player
+ */
+ @NotNull
+ <T> T getClientOption(@NotNull com.destroystokyo.paper.ClientOption<T> option);
// Paper end
+ <T> @NotNull T getClientOption(com.destroystokyo.paper.@NotNull ClientOption<T> option);
+ // Paper end - client option API
+
// Spigot start
public class Spigot extends Entity.Spigot {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index cf2090ee92e7245c028a0e625cdb483665b3821f..110d3d031ae2408e5caac2fdfd3f8f8efbeb7e05 100644
index 1e52cc88dc47f2494af505d92ebe56f79780a099..b128d2e9a2bc1629dbe650ba7d7e3a19a502de7b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3094,6 +3094,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3163,6 +3163,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
// Paper end
}

Datei anzeigen

@ -5,14 +5,14 @@ Subject: [PATCH] Player elytra boost API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 110d3d031ae2408e5caac2fdfd3f8f8efbeb7e05..9f1e3bc711e34a1a30aefc7c60068c84e3ea02ba 100644
index b128d2e9a2bc1629dbe650ba7d7e3a19a502de7b..f086585e03b6b782431abd69f163e648bc1c22b4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2986,6 +2986,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@NotNull
<T> T getClientOption(@NotNull com.destroystokyo.paper.ClientOption<T> option);
+
@@ -3057,6 +3057,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
<T> @NotNull T getClientOption(com.destroystokyo.paper.@NotNull ClientOption<T> option);
// Paper end - client option API
+ // Paper start - elytra boost API
+ /**
+ * Boost a Player that's {@link #isGliding()} using a {@link Firework}.
+ * If the creation of the entity is cancelled, no boosting is done.
@ -25,11 +25,12 @@ index 110d3d031ae2408e5caac2fdfd3f8f8efbeb7e05..9f1e3bc711e34a1a30aefc7c60068c84
+ * @deprecated use {@link HumanEntity#fireworkBoost(ItemStack)} instead. Note that this method <b>does not</b>
+ * check if the player is gliding or not.
+ */
+ @Nullable
+ default Firework boostElytra(@NotNull ItemStack firework) {
+ default @Nullable Firework boostElytra(final @NotNull ItemStack firework) {
+ com.google.common.base.Preconditions.checkState(this.isGliding(), "Player must be gliding");
+ return this.fireworkBoost(firework);
+ }
// Paper end
+ // Paper end - elytra boost API
+
// Spigot start
public class Spigot extends Entity.Spigot {

Datei anzeigen

@ -5,12 +5,12 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 9f1e3bc711e34a1a30aefc7c60068c84e3ea02ba..1efce69d16014147ae022ecf33eaed934236a7c1 100644
index f086585e03b6b782431abd69f163e648bc1c22b4..b848ef1c207797b352c2ca97c574c4cd3fe6e43a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3006,6 +3006,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3076,6 +3076,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
}
// Paper end
// Paper end - elytra boost API
+ // Paper start - sendOpLevel API
+ /**

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1efce69d16014147ae022ecf33eaed934236a7c1..7ce512072f242632f17db55224488f18c1cddcc4 100644
index b848ef1c207797b352c2ca97c574c4cd3fe6e43a..2a6879aa1b0497c485d127542ca4e526a23ecf85 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -275,6 +275,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@ -24,7 +24,7 @@ index 1efce69d16014147ae022ecf33eaed934236a7c1..7ce512072f242632f17db55224488f18
/**
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
index 997b06c19a5277656521e0e298f2958c209f1da1..2eb13c049fa917d41fa9ad17fdec9ec4c33701a8 100644
index 997b06c19a5277656521e0e298f2958c209f1da1..f7f864a2b46129e4d61bc87f3e23c343417aa094 100644
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
@@ -12,6 +12,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
@ -35,7 +35,7 @@ index 997b06c19a5277656521e0e298f2958c209f1da1..2eb13c049fa917d41fa9ad17fdec9ec4
private boolean cancel;
@Deprecated // Paper
@@ -19,14 +20,25 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
@@ -19,14 +20,26 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
super(playerKicked);
this.kickReason = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(kickReason); // Paper
this.leaveMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(leaveMessage); // Paper
@ -52,6 +52,7 @@ index 997b06c19a5277656521e0e298f2958c209f1da1..2eb13c049fa917d41fa9ad17fdec9ec4
+ this.cause = Cause.UNKNOWN;
+ }
+
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final net.kyori.adventure.text.Component kickReason, @NotNull final net.kyori.adventure.text.Component leaveMessage, @NotNull final Cause cause) {
+ super(playerKicked);
+ this.kickReason = kickReason;
@ -61,7 +62,7 @@ index 997b06c19a5277656521e0e298f2958c209f1da1..2eb13c049fa917d41fa9ad17fdec9ec4
}
/**
@@ -132,4 +144,77 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
@@ -132,4 +145,77 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
public static HandlerList getHandlerList() {
return handlers;
}

Datei anzeigen

@ -158,10 +158,10 @@ index 953bb49b7079647450d3453356d1c8a91be94c01..2ea66188468cf32bcaedc5167d4b9b0c
* Teleports this entity to the given location. If this entity is riding a
* vehicle, it will be dismounted prior to teleportation.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a6053648464d903d1f9501bbeae688240fbfd754..2b0826e3cbf684fe15f664c4d9041dc95a991ebd 100644
index 2ded556b2adca7cf8d6f6cd0c19a618f5d3ffaaf..17f78126ba815fd2c1a88e12047d5187285ada8f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3166,6 +3166,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3236,6 +3236,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
String getClientBrandName();
// Paper end

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2b0826e3cbf684fe15f664c4d9041dc95a991ebd..11294829dc3dc4523110892bb92d6bb5210e01e9 100644
index 17f78126ba815fd2c1a88e12047d5187285ada8f..d5ee046a5d410c9805924ae9d9ca3cbc1239b826 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3050,6 +3050,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3120,6 +3120,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void sendOpLevel(byte level);
// Paper end - sendOpLevel API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 11294829dc3dc4523110892bb92d6bb5210e01e9..b42693e8adce3b4dfbed17ad5f3df5ea00f3615b 100644
index d5ee046a5d410c9805924ae9d9ca3cbc1239b826..2fe7a0afa581c5f8ab2f7b1ab5703cc5976b89f4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3230,6 +3230,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3300,6 +3300,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void lookAt(@NotNull org.bukkit.entity.Entity entity, @NotNull io.papermc.paper.entity.LookAnchor playerAnchor, @NotNull io.papermc.paper.entity.LookAnchor entityAnchor);
// Paper end - Teleport API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add Player Warden Warning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b42693e8adce3b4dfbed17ad5f3df5ea00f3615b..53026b36fce2a201e81a844b115a274e9495928d 100644
index 2fe7a0afa581c5f8ab2f7b1ab5703cc5976b89f4..24d23796558dd2ff3a942b4d0ccf46c3bc7ed2bf 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3246,6 +3246,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3316,6 +3316,59 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param silent whether sound should be silenced
*/
void showElderGuardian(boolean silent);

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0909c7d1dae6192e3103f4eaeb08bf3efbbd4153..962283d336e6d53941cebbc3a995d403ff989f66 100644
index bab78593de3b8cbf939f423334ba3cfc67aea9dc..a8d3451ccfcd21a9e80adc2feab8fc9c2926c753 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3387,6 +3387,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3457,6 +3457,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void increaseWardenWarningLevel();
// Paper end

Datei anzeigen

@ -3567,7 +3567,7 @@ index 61759e8179d0f6342abf0c0294e5a024928db8d9..92e21126a9347f1ee2279ab09bb6abf2
public boolean isOp() {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3777442efd8e7d599a4f3191d85cb1be6871ad3b..336045ecb9e6b3803fdf9531b07bb72ceff0ee73 100644
index 3777442efd8e7d599a4f3191d85cb1be6871ad3b..f8fc314a0c6960125e51e6d6ed11afcdff684332 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -303,14 +303,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -3751,14 +3751,14 @@ index 3777442efd8e7d599a4f3191d85cb1be6871ad3b..336045ecb9e6b3803fdf9531b07bb72c
}
@Override
@@ -1731,6 +1797,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1731,6 +1797,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
+ // Paper start
+ // TODO UUID API
+ // Paper start - adventure
+ @Override
+ public void setResourcePack(String url, byte[] hashBytes, net.kyori.adventure.text.Component prompt, boolean force) {
+ public void setResourcePack(final UUID uuid, final String url, final byte[] hashBytes, final net.kyori.adventure.text.Component prompt, final boolean force) {
+ Preconditions.checkArgument(uuid != null, "Resource pack UUID cannot be null");
+ Preconditions.checkArgument(url != null, "Resource pack URL cannot be null");
+ final String hash;
+ if (hashBytes != null) {
@ -3767,14 +3767,15 @@ index 3777442efd8e7d599a4f3191d85cb1be6871ad3b..336045ecb9e6b3803fdf9531b07bb72c
+ } else {
+ hash = "";
+ }
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(UUID.randomUUID(), url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)));
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty()));
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)));
+ }
+ // Paper end
+ // Paper end - adventure
+
public void addChannel(String channel) {
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
channel = StandardMessenger.validateAndCorrectChannel(channel);
@@ -2126,6 +2208,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2126,6 +2209,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance();
}
@ -3787,7 +3788,7 @@ index 3777442efd8e7d599a4f3191d85cb1be6871ad3b..336045ecb9e6b3803fdf9531b07bb72c
@Override
public int getPing() {
return this.getHandle().connection.latency();
@@ -2176,6 +2264,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2176,6 +2265,252 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().allowsListing();
}

Datei anzeigen

@ -1123,7 +1123,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662
gameprofilerfiller.pop();
gameprofilerfiller.pop();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 634869a2747c655a6705deeb5fcb27d2c4754e0c..e2990302d932a5dc089a25e831e11ac6468f6381 100644
index 3bd2bddb782d29e647a1f1b362a39d224151f8b1..3851c1026b91b77a02dbb5df1a1eedb212ac2a06 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@
@ -1817,10 +1817,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 336045ecb9e6b3803fdf9531b07bb72ceff0ee73..c74428dccd9db8c4d2809bbd23f3268a16d7e282 100644
index f8fc314a0c6960125e51e6d6ed11afcdff684332..4a7199edc2c7597cba956b2427a17efa08eb8d82 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2585,6 +2585,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2586,6 +2586,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR));
}

Datei anzeigen

@ -137,10 +137,10 @@ index 2ec2b1d9d987c7f31c685aec3d3c87f42758c94b..36d793b492d9776ee36f8285b5bab09e
for(Player player : this.players()) {
if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 24c282c0727fa814c403716837b2d44b216c5b16..e6f67e770f97f239e545c2d4396c86b546c712e0 100644
index 41a4f6126f24848a26ff0f928a23b5be13783c90..4bdcff78393b618b2201753bbffbd9001d5ad2d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2266,6 +2266,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2267,6 +2267,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().language;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e6f67e770f97f239e545c2d4396c86b546c712e0..eb0409c01d8e1259414803495c48ec14179f457b 100644
index 4bdcff78393b618b2201753bbffbd9001d5ad2d1..188daf2ff7766d39b62b763bab7e4ad79f85449f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1937,12 +1937,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1938,12 +1938,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setFlying(boolean value) {

Datei anzeigen

@ -39,10 +39,10 @@ index bf89ea0f7506434848cb9c1cbfb3fe6dd2eb3212..686b42a9b4475fe3d530a9b950c1cc8f
// CraftBukkit end
this.language = clientOptions.language();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index eb0409c01d8e1259414803495c48ec14179f457b..1e395d14382c79231dc81d6cf7ea864e45906add 100644
index 188daf2ff7766d39b62b763bab7e4ad79f85449f..6cf9ca72f042b1b936f8ba04e9582cf4da4bcb6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2264,7 +2264,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2265,7 +2265,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getLocale() {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 56f6f65ceb1271e9273b1ee6658773eb3445beed..a26db4bd859ef52dadf03f1b62155bcc54b7a740 100644
index 56f6f65ceb1271e9273b1ee6658773eb3445beed..771db61f81d7a3cd763efb5febf6008fd2ba1232 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -15,58 +15,38 @@ index 56f6f65ceb1271e9273b1ee6658773eb3445beed..a26db4bd859ef52dadf03f1b62155bcc
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
+ // Paper start
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()];
+ player.getBukkitEntity().setResourcePackStatus(packStatus);
+ player.getBukkitEntity().resourcePackStatus = packStatus;
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), packStatus)); // CraftBukkit
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a58b0d10d73310587a05e40e072029ee258063e1..6da1b2f54317ddc84a1fbff037560e402b02f771 100644
index b64d3ad29235c8483bbb4ae108821137cbe13e3f..5d624f73a5b47efc3b117023a58176fe35454a84 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -44,6 +44,7 @@ import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.PlayerChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket;
+import net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket;
import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.network.protocol.game.ClientboundBlockDestructionPacket;
@@ -192,6 +193,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -192,6 +192,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double healthScale = 20;
private CraftWorldBorder clientWorldBorder = null;
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
+ // Paper start
+ private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
+ private String resourcePackHash;
+ // Paper end
+ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
@@ -2387,6 +2392,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean getAffectsSpawning() {
return this.getHandle().affectsSpawning;
@@ -1964,6 +1965,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
+
// Paper end - adventure
+ // Paper start - more resource pack API
+ @Override
+ public void setResourcePack(@NotNull String url, @NotNull String hash) {
+ this.setResourcePack(url, hash, false, null);
+ }
+
+ @Override
+ public void setResourcePack(@NotNull String url, @NotNull String hash, boolean required) {
+ this.setResourcePack(url, hash, required, null);
+ }
+
+ @Override
+ public void setResourcePack(@NotNull String url, @NotNull String hash, boolean required, net.kyori.adventure.text.Component resourcePackPrompt) {
+ public void setResourcePack(@NotNull UUID uuid, @NotNull String url, @NotNull String hash, net.kyori.adventure.text.Component resourcePackPrompt, boolean required) {
+ Preconditions.checkArgument(uuid != null, "Resource pack UUID cannot be null");
+ Preconditions.checkArgument(url != null, "Resource pack URL cannot be null");
+ Preconditions.checkArgument(hash != null, "Hash cannot be null");
+ net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ?
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) :
+ null;
+ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty()));
+ final net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ?
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) :
+ null;
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty()));
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(UUID.randomUUID(), url, hash, required, promptComponent));
+ }
+
@ -74,20 +54,8 @@ index a58b0d10d73310587a05e40e072029ee258063e1..6da1b2f54317ddc84a1fbff037560e40
+ public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus() {
+ return this.resourcePackStatus;
+ }
+ // Paper end - more resource pack API
+
+ @Override
+ public String getResourcePackHash() {
+ return this.resourcePackHash;
+ }
+
+ @Override
+ public boolean hasResourcePack() {
+ return this.resourcePackStatus == org.bukkit.event.player.PlayerResourcePackStatusEvent.Status.SUCCESSFULLY_LOADED;
+ }
+
+ public void setResourcePackStatus(org.bukkit.event.player.PlayerResourcePackStatusEvent.Status status) {
+ this.resourcePackStatus = status;
+ }
// Paper end
@Override
public void addChannel(String channel) {
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
channel = StandardMessenger.validateAndCorrectChannel(channel);

Datei anzeigen

@ -44,10 +44,10 @@ index b76ac10fe0d4b860a4b30fae365cf38400afb456..1e2d3040bb3e8b1901fbc933caa5ad3b
protected void internalSetAbsorptionAmount(float absorptionAmount) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6da1b2f54317ddc84a1fbff037560e402b02f771..0599752a23363405b6af1e89521badf3bf6643f3 100644
index 5d624f73a5b47efc3b117023a58176fe35454a84..77d836f33db291eeb214a833169da9cd1f22e4bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2183,6 +2183,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2199,6 +2199,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setRealHealth(double health) {

Datei anzeigen

@ -26,10 +26,10 @@ index cb88a3a4e4c87a6d6c838183c1640b13d82c9344..0b391b0dc6262ef482c4a253a074b593
// Paper end
buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0599752a23363405b6af1e89521badf3bf6643f3..ab0b31a41b9a35f3ff19c73a99d0392a303c2b53 100644
index 77d836f33db291eeb214a833169da9cd1f22e4bb..6c46977874eac7d88ad87f655c0f6ad5159ce98c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -350,6 +350,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -346,6 +346,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper start

Datei anzeigen

@ -90,10 +90,10 @@ index 0d9658b1c6b5912a34058c0ce53b8e7f8c28afac..203fc53142bb0c9b6e2d1876fe8dfbe3
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ab0b31a41b9a35f3ff19c73a99d0392a303c2b53..7115d71cfd514a4cdc2b0d2b17b87fb6fff21ee7 100644
index 6c46977874eac7d88ad87f655c0f6ad5159ce98c..31e107a0641276b2f00fd219f2095e15e0544285 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -296,6 +296,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -292,6 +292,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

Datei anzeigen

@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7115d71cfd514a4cdc2b0d2b17b87fb6fff21ee7..352c16b89f0e33aefef141fea0bf8067208cffcf 100644
index 31e107a0641276b2f00fd219f2095e15e0544285..9255edcd67e2cdd2fab31ae881ca88b6a5beb8e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1550,7 +1550,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1546,7 +1546,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override

Datei anzeigen

@ -55,10 +55,10 @@ index 477d3245facb5ae59c786d4f696f64226cb540a6..e8490a58dd4d9bc39a5bb2f9fc109526
public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc8631d32632d 100644
index 9255edcd67e2cdd2fab31ae881ca88b6a5beb8e3..a343157512ca145b3e5ab1a0fcaeae0ae7aeb2e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -279,11 +279,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -275,11 +275,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.server.getPlayer(this.getUniqueId()) != null;
}
@ -70,7 +70,7 @@ index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc863
@Override
public InetSocketAddress getAddress() {
if (this.getHandle().connection == null) return null;
@@ -1700,8 +1695,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1696,8 +1691,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
// Remove this entity from the hidden player's EntityTrackerEntry
@ -87,7 +87,7 @@ index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc863
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) {
entry.removePlayer(this.getHandle());
@@ -1714,8 +1716,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1710,8 +1712,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
}
}
@ -96,7 +96,7 @@ index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc863
}
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
@@ -1780,12 +1780,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1776,12 +1776,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
private void trackAndShowEntity(org.bukkit.entity.Entity entity) {
@ -122,7 +122,7 @@ index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc863
}
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
@@ -1795,6 +1808,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1791,6 +1804,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
}
@ -162,7 +162,7 @@ index 352c16b89f0e33aefef141fea0bf8067208cffcf..f4a6a3f9c6c8972f482a53ee434dc863
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
// SPIGOT-7312: Can't show/hide self
@@ -1806,6 +1852,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1802,6 +1848,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.trackAndShowEntity(entity);
}
}

Datei anzeigen

@ -9,19 +9,19 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f4a6a3f9c6c8972f482a53ee434dc8631d32632d..90de9ce49cf067335ce881a2806fa18ef9e5d556 100644
index a343157512ca145b3e5ab1a0fcaeae0ae7aeb2e0..a5b82436d929c17007cf55d12686ecdd948bdee3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -196,6 +196,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash;
@@ -193,6 +193,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private CraftWorldBorder clientWorldBorder = null;
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
+ private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
// Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -2112,7 +2113,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
super(server, entity);
@@ -2128,7 +2129,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end - more resource pack API
public void addChannel(String channel) {
- Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);

Datei anzeigen

@ -173,10 +173,10 @@ index 7d6301ae9ee2added007b0c68ffabe5d79f7be62..801dca6bbafd6e1825a1291fc128efc1
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 90de9ce49cf067335ce881a2806fa18ef9e5d556..9718d1f36db4f41140e3b7b2ff008038ca4f9cb8 100644
index a5b82436d929c17007cf55d12686ecdd948bdee3..9e34575c8ffff57d692349a4a05db3d1f769c687 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1201,7 +1201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1197,7 +1197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9718d1f36db4f41140e3b7b2ff008038ca4f9cb8..c7aed877d5e1976da8407075e69a75eb2837bff3 100644
index 9e34575c8ffff57d692349a4a05db3d1f769c687..8417da1eb3a440adcd425ffbda9fdcb768857afd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2864,6 +2864,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2840,6 +2840,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.adventure$pointers;
}

Datei anzeigen

@ -392,10 +392,10 @@ index 948ba97e318506dad96e59121297b5bf8340d2e6..810bead2f19de70786027b190137f743
this.gameEvent(GameEvent.ENTITY_DIE);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c7aed877d5e1976da8407075e69a75eb2837bff3..e7c81627e8e9a959b2db521a30e16dcda98ef145 100644
index 8417da1eb3a440adcd425ffbda9fdcb768857afd..e55d31783396e87ef18f5b6dfc27742c0b4e3465 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2361,7 +2361,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2377,7 +2377,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendHealthUpdate() {
FoodData foodData = this.getHandle().getFoodData();

Datei anzeigen

@ -106,37 +106,37 @@ index e8490a58dd4d9bc39a5bb2f9fc109526e031b971..5f590575f95eff8bf0cdcafde7dee0e3
public Location getLastDeathLocation() {
if (this.getData().contains("LastDeathLocation", 10)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e7c81627e8e9a959b2db521a30e16dcda98ef145..00a5e27fc3e2e566642c5f5c730c3c4c97abe2cb 100644
index e55d31783396e87ef18f5b6dfc27742c0b4e3465..6ec80e3a838f8f7479ee965561043586d64c649a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -197,6 +197,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash;
@@ -194,6 +194,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
+ private long lastSaveTime;
// Paper end
+ private long lastSaveTime; // Paper - getLastPlayed replacement API
public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1962,6 +1963,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
super(server, entity);
@@ -1958,6 +1959,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.firstPlayed = firstPlayed;
}
+ // Paper start
+ // Paper start - getLastPlayed replacement API
+ @Override
+ public long getLastLogin() {
+ return getHandle().loginTime;
+ return this.getHandle().loginTime;
+ }
+
+ @Override
+ public long getLastSeen() {
+ return isOnline() ? System.currentTimeMillis() : this.lastSaveTime;
+ return this.isOnline() ? System.currentTimeMillis() : this.lastSaveTime;
+ }
+ // Paper end
+ // Paper end - getLastPlayed replacement API
+
public void readExtraData(CompoundTag nbttagcompound) {
this.hasPlayedBefore = true;
if (nbttagcompound.contains("bukkit")) {
@@ -1984,6 +1997,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1980,6 +1993,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setExtraData(CompoundTag nbttagcompound) {
@ -145,7 +145,7 @@ index e7c81627e8e9a959b2db521a30e16dcda98ef145..00a5e27fc3e2e566642c5f5c730c3c4c
if (!nbttagcompound.contains("bukkit")) {
nbttagcompound.put("bukkit", new CompoundTag());
}
@@ -1998,6 +2013,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1994,6 +2009,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
data.putLong("firstPlayed", this.getFirstPlayed());
data.putLong("lastPlayed", System.currentTimeMillis());
data.putString("lastKnownName", handle.getScoreboardName());

Datei anzeigen

@ -8,10 +8,10 @@ We just add a check to ensure that the CraftPlayer's handle
is a ServerPlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 00a5e27fc3e2e566642c5f5c730c3c4c97abe2cb..553c5b65f4cc42e915196fa60a939f020b935e3a 100644
index 6ec80e3a838f8f7479ee965561043586d64c649a..49da25428fa35a935bab2ca5a28081682284a79a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -254,8 +254,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -250,8 +250,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void remove() {

Datei anzeigen

@ -136,10 +136,10 @@ index 3a026f766e2d67e005ae8a06337d465f92c8d1f3..352fbab070ccdb683e9a7558292c86cc
this.adventure$locale = net.kyori.adventure.translation.Translator.parseLocale(this.language); // Paper
this.requestedViewDistance = clientOptions.viewDistance();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 553c5b65f4cc42e915196fa60a939f020b935e3a..74b36a42971976c4205f0638dee5eb78e1014bcd 100644
index 49da25428fa35a935bab2ca5a28081682284a79a..e10cad5e2b078ff6ff7cba84dfa105ea5704d019 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -616,6 +616,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -612,6 +612,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
}
}

Datei anzeigen

@ -17,7 +17,7 @@ index 25c5f23b859961c792b2ec08404171eea1aedba7..478abaffd1a80949b96f1c1774c98134
// Paper start - replace player chunk loader
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 595086133c687d2f9752cbda475123063f22df42..9647f6a274f4a4d2a940759b9cbd00569ac3bb18 100644
index 698fc66f8c232644f2d747c81f8ac2e39204fd7f..8cb7e9d67fc4713dc327ad0459518f062dc9264e 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -54,6 +54,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -57,10 +57,10 @@ index 595086133c687d2f9752cbda475123063f22df42..9647f6a274f4a4d2a940759b9cbd0056
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 74b36a42971976c4205f0638dee5eb78e1014bcd..49994f8fc11c41052305dd8722c0abe51160ee64 100644
index e10cad5e2b078ff6ff7cba84dfa105ea5704d019..630f98fc58579c0a900d8ff6712a463742f90338 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3023,6 +3023,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2999,6 +2999,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
};

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 49994f8fc11c41052305dd8722c0abe51160ee64..37efca4dcd1504e3dab231f516cc9e455f70effb 100644
index 630f98fc58579c0a900d8ff6712a463742f90338..32c51de77dcd278f895969c513e38075dad83ace 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2546,7 +2546,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2562,7 +2562,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (data != null) {
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
}

Datei anzeigen

@ -32,10 +32,10 @@ index 1131ee88f35c3898f0119c414c8376b0d9130169..bf361396bc2ec5d5c7b45d425af990c0
public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 37efca4dcd1504e3dab231f516cc9e455f70effb..7134590b3ecef49dac5f9660f8870b1f2814ba5b 100644
index 32c51de77dcd278f895969c513e38075dad83ace..f556375e1081039f38d2e2e5c0fb48c3f77dd387 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -640,6 +640,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -636,6 +636,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end

Datei anzeigen

@ -144,10 +144,10 @@ index ba65b69e967ad933fec5e87da1ccfba25a42a372..eb04b74e2d71bf1842a19b346576f0ff
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7134590b3ecef49dac5f9660f8870b1f2814ba5b..8c5aa99068b5f67e55fd3af9e9abea2612ee84d5 100644
index f556375e1081039f38d2e2e5c0fb48c3f77dd387..785f218d1a56a22b9d01a4423ac0100a05758241 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1566,7 +1566,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1562,7 +1562,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(mode != null, "GameMode cannot be null");
if (this.getHandle().connection == null) return;

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..b96bf00bc6cd10ced89939424150bd3c5baf12c3 100644
index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..85a8a687b1568a56e3e646b37ef78b562c1b8a82 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -35,16 +35,16 @@ public class SignedMessageChain {
@ -13,7 +13,7 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..b96bf00bc6cd10ced89939424150bd3c
SignedMessageLink signedMessageLink = this.advanceLink();
if (signedMessageLink == null) {
- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false);
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - TODO 1.20.3 - new kick cause?
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - diff on change (if disconnects, need a new kick event cause)
} else if (playerPublicKey.data().hasExpired()) {
- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false);
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey", org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY), false); // Paper - kick event causes
@ -100,7 +100,7 @@ index b9560b4ae5c0867396006119c5dadd7f3b47f78b..f3e32da770f379d46c65a0ba5a100b5f
return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason);
}, true);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index e9b46bc0650050595f9db503c747350dc1997a5d..c0ed5bfcbd17b61c16484cad4b42eb1365a0556b 100644
index 4a2ff42950a9c15a3dbbf9ca7e3c43cad4c77404..312b7a446453cf0859538cb10e6e98a8188d9094 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -94,7 +94,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -491,10 +491,10 @@ index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f62
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8c5aa99068b5f67e55fd3af9e9abea2612ee84d5..a777484bf2c625545e008eb1a22068e7a770b22c 100644
index 785f218d1a56a22b9d01a4423ac0100a05758241..aacd811da1e7b091e218054e9404242a2d2ac6c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -598,7 +598,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -594,7 +594,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot
if (this.getHandle().connection == null) return;
@ -503,7 +503,7 @@ index 8c5aa99068b5f67e55fd3af9e9abea2612ee84d5..a777484bf2c625545e008eb1a22068e7
}
// Paper start
@@ -610,10 +610,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -606,10 +606,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void kick(final net.kyori.adventure.text.Component message) {
@ -520,7 +520,7 @@ index 8c5aa99068b5f67e55fd3af9e9abea2612ee84d5..a777484bf2c625545e008eb1a22068e7
}
}
@@ -672,7 +677,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -668,7 +673,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start - Improve chat handling
if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) {

Datei anzeigen

@ -187,10 +187,10 @@ index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..c83ffba568f33323b0f8b9a03fa0b7bb
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a777484bf2c625545e008eb1a22068e7a770b22c..41107ebfe9d517e04ef787f3fb9487ad6ac74314 100644
index aacd811da1e7b091e218054e9404242a2d2ac6c1..f6eb66b0e8e442cf72aa6ea4507e550c1dcb9615 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1325,9 +1325,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1321,9 +1321,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setBedSpawnLocation(Location location, boolean override) {
if (location == null) {

Datei anzeigen

@ -24,10 +24,10 @@ index f96d61bdeb556665d6e6e5023f9d77fd82204e89..e3f355c85eb7cc8c1683e3009502c10a
public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 41107ebfe9d517e04ef787f3fb9487ad6ac74314..b0b5d0d7730f0150823dc4600775608fc6eb875b 100644
index f6eb66b0e8e442cf72aa6ea4507e550c1dcb9615..2699f90a0fbe5397fb057ce59cadf0a64913659f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -893,6 +893,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -889,6 +889,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}

Datei anzeigen

@ -72,10 +72,10 @@ index d4fffcc5bb746df8dc177780f15ff4dbca64c018..ed30e079c23f564cbd0a45b38586bd12
// Let the server handle cross world teleports
if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b0b5d0d7730f0150823dc4600775608fc6eb875b..75c277f3b5323d5d813c1bdfff3731d1b403b50a 100644
index 2699f90a0fbe5397fb057ce59cadf0a64913659f..d8791e8b79b0aa430c0d451353e02a7ce8825893 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1214,13 +1214,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1210,13 +1210,101 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setRotation(float yaw, float pitch) {
@ -178,7 +178,7 @@ index b0b5d0d7730f0150823dc4600775608fc6eb875b..75c277f3b5323d5d813c1bdfff3731d1
location.checkFinite();
ServerPlayer entity = this.getHandle();
@@ -1233,7 +1321,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1229,7 +1317,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return false;
}
@ -187,7 +187,7 @@ index b0b5d0d7730f0150823dc4600775608fc6eb875b..75c277f3b5323d5d813c1bdfff3731d1
return false;
}
@@ -1251,7 +1339,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1247,7 +1335,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// If this player is riding another entity, we must dismount before teleporting.
@ -196,7 +196,7 @@ index b0b5d0d7730f0150823dc4600775608fc6eb875b..75c277f3b5323d5d813c1bdfff3731d1
// SPIGOT-5509: Wakeup, similar to riding
if (this.isSleeping()) {
@@ -1267,13 +1355,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1263,13 +1351,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle();
// Close any foreign inventory

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 75c277f3b5323d5d813c1bdfff3731d1b403b50a..ca3c35e486743cc0c2425a86836d398af25f5f89 100644
index d8791e8b79b0aa430c0d451353e02a7ce8825893..047b5a4b0d942726422f7025768dca5b00526d3c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -654,6 +654,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -650,6 +650,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end - sendOpLevel API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ca3c35e486743cc0c2425a86836d398af25f5f89..8a3213818fe57b08b730efb0b490c2ca2a8e60f7 100644
index 047b5a4b0d942726422f7025768dca5b00526d3c..e05b3033b64672a9afe316fca49674f38f2830d5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3176,6 +3176,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3152,6 +3152,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8a3213818fe57b08b730efb0b490c2ca2a8e60f7..ff8fdcd407238061104625dd780e5236f9f8c78b 100644
index e05b3033b64672a9afe316fca49674f38f2830d5..e15a9558e1525081025c1363e218f6b4bd312c59 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3181,6 +3181,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3157,6 +3157,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
}

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ff8fdcd407238061104625dd780e5236f9f8c78b..d905ad840c049a8f95dbed8679626b6d45bf4aed 100644
index e15a9558e1525081025c1363e218f6b4bd312c59..0911c5ca8f2ea1a0f99567b1621c80064ee81ce8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -731,7 +731,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -727,7 +727,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Sound instrumentSound = instrument.getSound();
if (instrumentSound == null) return;

Datei anzeigen

@ -26,10 +26,10 @@ index 28fa46f29639a6b643b475912133d601028facb2..7f3466340891b4409d1399ebeb2ca865
} else {
if (fallDistance >= 2.0F) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d905ad840c049a8f95dbed8679626b6d45bf4aed..7d40c698ec2aff93c0ee7f211c74a3daab7c5ca2 100644
index 0911c5ca8f2ea1a0f99567b1621c80064ee81ce8..79105c8525b8087e4121814f99f3a8b8ae285bb5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2418,6 +2418,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2434,6 +2434,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().onUpdateAbilities();
}

Datei anzeigen

@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API
public net.minecraft.server.level.ServerPlayer seenCredits
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7d40c698ec2aff93c0ee7f211c74a3daab7c5ca2..0a0eefdeead3dba7881b2bd21618de2173e46e81 100644
index 79105c8525b8087e4121814f99f3a8b8ae285bb5..849fa10a831b83061a974c284b4e42cbf9d812cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1233,6 +1233,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1229,6 +1229,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}

Datei anzeigen

@ -33,10 +33,10 @@ index cab5636fe6be9ee7f23ffbd5a399d2aeea1cd538..fb74f13ab2a977224e843a468ea8c72d
return k > 0 ? this.repairPlayerItems(player, k) : 0;
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0a0eefdeead3dba7881b2bd21618de2173e46e81..2b20ddfbd599d157f3a3658957407040c992e68d 100644
index 849fa10a831b83061a974c284b4e42cbf9d812cc..104a46702686340fafd25b80a1f5a7c1a69076a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1755,11 +1755,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1751,11 +1751,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());
int i = Math.min(orb.xpToDurability(amount), itemstack.getDamageValue());

Datei anzeigen

@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2b20ddfbd599d157f3a3658957407040c992e68d..c1cc6f615e90a6dcb071b3e731cfaa76d2d2ae23 100644
index 104a46702686340fafd25b80a1f5a7c1a69076a6..2453a6930c37b7596844d5355fc2aa99518f683a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1653,23 +1653,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1649,23 +1649,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
@ -240,7 +240,7 @@ index 2b20ddfbd599d157f3a3658957407040c992e68d..c1cc6f615e90a6dcb071b3e731cfaa76
if (kickPlayer) {
this.kickPlayer(reason);
}
@@ -1677,12 +1677,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1673,12 +1673,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override

Datei anzeigen

@ -73,10 +73,10 @@ index c77fec78636805a496ecea3e56f26290dbcbffff..abb14719496971a780650782bdce17c6
// Special case: the axis is optional for ELECTRIC_SPARK
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c1cc6f615e90a6dcb071b3e731cfaa76d2d2ae23..712cc70a536d8a332c3c1f8573ccbd4e0ff8f640 100644
index 2453a6930c37b7596844d5355fc2aa99518f683a..1a0d57c849b059d781cda9617c163bf6830c063a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -880,7 +880,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -876,7 +876,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(effect != null, "Effect cannot be null");
if (data != null) {
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);

Datei anzeigen

@ -113,10 +113,10 @@ index 098bb36a66e022da30302936aba10d296587ac88..a35638a92479b90afa89cf201fc45b49
// Paper end
player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 712cc70a536d8a332c3c1f8573ccbd4e0ff8f640..22470d74ea644bac933e94fcf08b13066793f02c 100644
index 1a0d57c849b059d781cda9617c163bf6830c063a..a86f389034825b200bec799c03464541a9f4df87 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -186,6 +186,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -185,6 +185,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private final ConversationTracker conversationTracker = new ConversationTracker();
private final Set<String> channels = new HashSet<String>();
private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
@ -124,7 +124,7 @@ index 712cc70a536d8a332c3c1f8573ccbd4e0ff8f640..22470d74ea644bac933e94fcf08b1306
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
private double health = 20;
@@ -1993,7 +1994,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1989,7 +1990,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
otherPlayer.setUUID(uuidOverride);
}
// Paper end
@ -133,7 +133,7 @@ index 712cc70a536d8a332c3c1f8573ccbd4e0ff8f640..22470d74ea644bac933e94fcf08b1306
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
}
@@ -2102,6 +2103,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2098,6 +2099,43 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
}

Datei anzeigen

@ -23,10 +23,10 @@ index 9daec0782774ab51ea8091cb8ed9d0a106e34cfa..2bbc39c257965ad91ee360cdfcd3538a
public String getName() {
Player player = this.getPlayer();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 22470d74ea644bac933e94fcf08b13066793f02c..e075baed83a4ab3142ee41cbb49de7ceb004ac56 100644
index a86f389034825b200bec799c03464541a9f4df87..abcde413e2fe22b14994b2f5b15fd7db1a257465 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -286,6 +286,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -282,6 +282,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.server.getPlayer(this.getUniqueId()) != null;
}

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API
Implements API for getting and resetting a player's idle duration.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e075baed83a4ab3142ee41cbb49de7ceb004ac56..b0e2f0a9155e43c113142840bb8198fb84a31cb6 100644
index abcde413e2fe22b14994b2f5b15fd7db1a257465..9073edd4c0baa82f2b340d1898a89cf285262484 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3298,6 +3298,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -3274,6 +3274,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b0e2f0a9155e43c113142840bb8198fb84a31cb6..ed41decbf0522c516b3608569d5719687105e25b 100644
index 9073edd4c0baa82f2b340d1898a89cf285262484..2f65d85b35eec863dabf05eff2230ee513d341d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1090,7 +1090,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1086,7 +1086,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) {

Datei anzeigen

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 8 Dec 2023 15:06:16 -0800
Subject: [PATCH] Keep previous behavior for setResourcePack
Before multiple packs were allowed, setResourcePack
resulted in the client's existing server pack being
replaced. To keep this behavior, we will remove all
packs before sending the new pack. Other API exists
for adding a new pack to the existing packs on a client.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2f65d85b35eec863dabf05eff2230ee513d341d3..036b31cbfda8bac02205d99c1eff8a08f4da1250 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2350,8 +2350,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (hash != null) {
Preconditions.checkArgument(hash.length == 20, "Resource pack hash should be 20 bytes long but was %s", hash.length);
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty())); // Paper - keep previous behavior of clearing packs
this.getHandle().connection.send(new ClientboundResourcePackPushPacket(id, url, BaseEncoding.base16().lowerCase().encode(hash), force, CraftChatMessage.fromStringOrNull(prompt, true)));
} else {
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty())); // Paper - keep previous behavior of clearing packs
this.getHandle().connection.send(new ClientboundResourcePackPushPacket(id, url, "", force, CraftChatMessage.fromStringOrNull(prompt, true)));
}
}