more cleanup and resource pack api fixes
This commit is contained in:
parent
7606e6da39
commit
f17622cc3d
59 changed files with 490 additions and 332 deletions
|
@ -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
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
+
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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
|
||||
+ /**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue