Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
9259558b58 Fix remapping issue with RangedAttackMob and RangedEntity (#7167)
3d9385e665 Add material tags for copper blocks (#7141)
75f4cb074a Move setShouldBurnInDay to AbstractSkeleton (#7120)
9adc0b243b Fix breakNaturally for fluid-logged blocks (#7134)
76f327471d Move VehicleCollisionEvent HandlerList up (#7112)
d4c819056d Forward CraftEntity in teleport command (#7025)
9012ae8880 Improve scoreboard entries (#6871)
264b11d9f3 Entity powdered snow API (#6833)
a6a6a3db24 [ci skip] Revert change to apatch script
2cf6a57bca Fix entity type tags suggestions in selectors (#6468)
8a21c1742b Add API for item entity health (#6514)
26fbb02aae Adventure changes for Java 17 and Component support for resourcepack prompt
10bfb63f6c Configurable max block light for monster spawning (#7129)
6e5ceb34eb Fix ChunkMap distanceManager field reobf
82eaf4ee15 Fix duplicated BlockPistonRetractEvent call (#7111)
cf621c5eb3 Load effect amplifiers greater than 127 correctly (#7175)
1ce4281666 Fix ABI breakage for plainSerializer (#7178)
bf826b3fac [ci skip] Update Gradle wrapper to 7.3.3
464b1715bb Add uncaught exception handler using logger to usages of ThreadFactoryBuilder (#7179)
This commit is contained in:
BillyGalbreath
2021-12-23 22:43:54 -06:00
parent 91e3be5ac6
commit b7f623afe5
47 changed files with 75 additions and 239 deletions

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Purpur client support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1b4b54741719252892a3a51491d49cd5423de499..f9d46d0ba72e84c58c5165227875396000f22f4a 100644
index 5e4a9ce5f899624255e806152c59f60664bcf701..3428757d62a449411f909c4e2a50bf7ec19936ef 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2507,4 +2507,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2603,4 +2603,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end

View File

@@ -21,12 +21,12 @@ index 2405254739a83b2fb517da7fa4ea0721c68f9f6d..825c02793e3aaff45a8a0a9da01d72da
* @deprecated removed in 1.16
*/
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index bafad5764cc3933fcd9602d37bd2e68424cbd575..f1740d0d50e251fa029f22eeaacf2a68b3cd2e96 100644
index 51ec2e4ec4239659272bba3d6ba2ad73926ebb88..a032bc5aaa0d7abffa9ec91fca397c47b2dac4a8 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -795,4 +795,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -802,4 +802,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
public boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason);
boolean isInPowderedSnow();
// Paper end
+
+ // Purpur start

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] AFK API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index f9d46d0ba72e84c58c5165227875396000f22f4a..2d9a25bfd7a1468d139f98b01feceb6553663c24 100644
index 3428757d62a449411f909c4e2a50bf7ec19936ef..52fc606dc7c88fd5ef8dd2f888f65a780ba93f6f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2515,5 +2515,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2611,5 +2611,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return True if Player uses Purpur Client
*/
public boolean usesPurpurClient();

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Player invulnerabilities
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2d9a25bfd7a1468d139f98b01feceb6553663c24..e92de95ec40518006db6c5d098b334c7f854fcea 100644
index 52fc606dc7c88fd5ef8dd2f888f65a780ba93f6f..414997a2496fececd375fd4ac8f7601d03cfb1b0 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2534,5 +2534,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2630,5 +2630,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Reset the idle timer back to 0
*/
void resetIdleTimer();

View File

@@ -5,12 +5,12 @@ Subject: [PATCH] Item entity immunities
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
index 0ee072645ecf1bf5feb74de6960947ef76db366e..5b9a20e0695218f1239d2bf1d0368291e2a10c06 100644
index 87dbc00ab565377b8ae0eb6e73799ae6e2e3a376..38ebf0f60113c5eff9d83e6a22ccdade651f419a 100644
--- a/src/main/java/org/bukkit/entity/Item.java
+++ b/src/main/java/org/bukkit/entity/Item.java
@@ -120,4 +120,62 @@ public interface Item extends Entity {
@@ -139,4 +139,62 @@ public interface Item extends Entity {
*/
public void setWillAge(boolean willAge);
public void setHealth(int health);
// Paper end
+
+ // Purpur start

View File

@@ -503,10 +503,10 @@ index fa2a5c8ed947cd2beed01df82fcc5e450e3e5782..d5e7538f7c7f288e1710fb383b57683f
@NotNull
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 014c9984018ad5e51a26228a137e1ba4eb3e80c8..a39c0da1663f53b828bb35e662dd81df63b9d045 100644
index 81e17ebb54f8b5c085842f223081f3d6d33a317d..9b17e6920dc3612e1787be1b74988a24bb6ad5a7 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -87,6 +87,8 @@ public interface UnsafeValues {
@@ -88,6 +88,8 @@ public interface UnsafeValues {
/**
* Called once by the version command on first use, then cached.
@@ -515,7 +515,7 @@ index 014c9984018ad5e51a26228a137e1ba4eb3e80c8..a39c0da1663f53b828bb35e662dd81df
*/
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
@@ -113,6 +115,8 @@ public interface UnsafeValues {
@@ -114,6 +116,8 @@ public interface UnsafeValues {
/**
* Return the translation key for the Material, so the client can translate it into the active
* locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.
@@ -524,7 +524,7 @@ index 014c9984018ad5e51a26228a137e1ba4eb3e80c8..a39c0da1663f53b828bb35e662dd81df
* @return the translation key
*/
String getTranslationKey(Material mat);
@@ -120,6 +124,8 @@ public interface UnsafeValues {
@@ -121,6 +125,8 @@ public interface UnsafeValues {
/**
* Return the translation key for the Block, so the client can translate it into the active
* locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.
@@ -533,7 +533,7 @@ index 014c9984018ad5e51a26228a137e1ba4eb3e80c8..a39c0da1663f53b828bb35e662dd81df
* @return the translation key
*/
String getTranslationKey(org.bukkit.block.Block block);
@@ -128,6 +134,8 @@ public interface UnsafeValues {
@@ -129,6 +135,8 @@ public interface UnsafeValues {
* Return the translation key for the EntityType, so the client can translate it into the active
* locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.<br>
* This is <code>null</code>, when the EntityType isn't known to NMS (custom entities)
@@ -542,7 +542,7 @@ index 014c9984018ad5e51a26228a137e1ba4eb3e80c8..a39c0da1663f53b828bb35e662dd81df
* @return the translation key
*/
String getTranslationKey(org.bukkit.entity.EntityType type);
@@ -143,6 +151,8 @@ public interface UnsafeValues {
@@ -144,6 +152,8 @@ public interface UnsafeValues {
* Creates and returns the next EntityId available.
* <p>
* Use this when sending custom packets, so that there are no collisions on the client or server.
@@ -787,7 +787,7 @@ index 9e7f42caab1204036f4203354c115fd40c6def92..f76ddd80f9fc926f73b1cc50f0a2767a
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index f1740d0d50e251fa029f22eeaacf2a68b3cd2e96..6fdb484f7eda40155898849cb5ae963f75fafa40 100644
index a032bc5aaa0d7abffa9ec91fca397c47b2dac4a8..568836b589f4f81d8b3e715b39b90e5172215273 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -668,6 +668,9 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -921,10 +921,10 @@ index a6a7429ed2e1eefb2b12b7480ed74fcc3963a864..e8027e1d505dda6effbb1698550016e8
NORMAL(false),
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index e92de95ec40518006db6c5d098b334c7f854fcea..809827d41ca42a665cd7b9c23a6361dc10d22ccf 100644
index 414997a2496fececd375fd4ac8f7601d03cfb1b0..d87bb346bc2f7153d7bf4582e8dddd0ad52e480d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2337,6 +2337,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2433,6 +2433,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void resetCooldown();
/**
@@ -933,7 +933,7 @@ index e92de95ec40518006db6c5d098b334c7f854fcea..809827d41ca42a665cd7b9c23a6361dc
* @return the client option value of the player
*/
@NotNull
@@ -2368,6 +2370,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2464,6 +2466,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
// Paper end
// Spigot start

View File

@@ -170,7 +170,7 @@ index c8d37184d8e882a4084a1bfef85faa330588600b..46bae5c13ce2b973b114682f6a338981
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 809827d41ca42a665cd7b9c23a6361dc10d22ccf..38762db5c3383c3663a328ac591b0f6b25ac7f5a 100644
index d87bb346bc2f7153d7bf4582e8dddd0ad52e480d..7c720a1d210f165b9e3577232af655d3d9b3de34 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -76,7 +76,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -281,7 +281,7 @@ index 809827d41ca42a665cd7b9c23a6361dc10d22ccf..38762db5c3383c3663a328ac591b0f6b
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
/**
@@ -2063,7 +2063,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2159,7 +2159,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #locale()}
*/
@NotNull
@@ -746,7 +746,7 @@ index ed0bc2024a0bb85837e25f75ae89d1fe257b2e60..f6e831f844e1fe99a2617bd64c2290d1
this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
}
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index 75acd6f8f3d774bb79e8e513125e801c5569a244..1eccadd957867e0c5d59a157e16bd4e5557caf68 100644
index b93b1b0428d11589605c8edf5c053369e1031076..140ac3ebdb0aab58093429faf67a31f7e527e625 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java
+++ b/src/main/java/org/bukkit/scoreboard/Objective.java
@@ -47,7 +47,7 @@ public interface Objective {
@@ -768,7 +768,7 @@ index 75acd6f8f3d774bb79e8e513125e801c5569a244..1eccadd957867e0c5d59a157e16bd4e5
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
index f7754ab421c7b452a53c28d1e2fafdccfbba24bf..05026b8bc3d41f0391f7c7a59b56aab899537a3e 100644
index 9a395b138be3f6fa9a52639f0ac4070c23f7d77c..3e1cddb86fd721683220c2a2d1e016c921cc3016 100644
--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java
+++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
@@ -89,7 +89,7 @@ public interface Scoreboard {
@@ -790,7 +790,7 @@ index f7754ab421c7b452a53c28d1e2fafdccfbba24bf..05026b8bc3d41f0391f7c7a59b56aab8
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index d5b39fb4fc16a342b5661e08df1506858168d20d..723eb266fe1f965d2f08c6f3e8c652d0a0e52d58 100644
index 2b93692204a74ea0def513a54ddf77a40c64d3d2..918a572328971b6dc864de276475c0403fdbd879 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -108,7 +108,7 @@ public interface Team {

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
Co-authored by: Encode42 <me@encode42.dev>
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 6fdb484f7eda40155898849cb5ae963f75fafa40..52b3ba61bd58bdee339ecabeb047564aeaa46bdc 100644
index 568836b589f4f81d8b3e715b39b90e5172215273..b2504a24ee2cc142f7b07fa5a908c0c693f18b8b 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -842,5 +842,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -849,5 +849,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if ridable in water
*/
boolean isRidableInWater();

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Flying Fall Damage API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 38762db5c3383c3663a328ac591b0f6b25ac7f5a..d093d43380e09426f9430460a8626f8dcd675f22 100644
index 7c720a1d210f165b9e3577232af655d3d9b3de34..d71a81d4891813ad8a36736a3d08dcc569b30dbc 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2560,5 +2560,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2656,5 +2656,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param invulnerableTicks Invulnerable ticks remaining
*/
void setSpawnInvulnerableTicks(int invulnerableTicks);

View File

@@ -1,114 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 17 Aug 2021 17:39:14 -0500
Subject: [PATCH] Add component support to resource pack api
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d093d43380e09426f9430460a8626f8dcd675f22..a1d0302deb4e002d18264883f5ce1c1a17a6089d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1570,6 +1570,50 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt);
+ /**
+ * 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>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.
+ * </ul>
+ *
+ * @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.
+ * @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.
+ */
+ public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable net.kyori.adventure.text.Component prompt);
+
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1661,6 +1705,52 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force);
+ /**
+ * 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>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.
+ * </ul>
+ *
+ * @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.
+ */
+ public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable net.kyori.adventure.text.Component prompt, boolean force);
+
/**
* Gets the Scoreboard displayed to this player
*