Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@4fdda9e Keep newlines in outdated client/server message (#10042)
PaperMC/Paper@f483b38 fix NPE on EntityTeleportEvent getTo (#10016)
PaperMC/Paper@dc62150 Catch async usage of playsound (#10021)
PaperMC/Paper@0d6a0c3 Fix command block async message (again) (#10082)
PaperMC/Paper@d1f507f Don't fire 2 game events for certain cauldron interactions (#8904)
PaperMC/Paper@a401585 Fix campfire recipes not always outputting full result (#8754)
PaperMC/Paper@88d28d6 Fix long loading screen when refreshing skins (#10026)
PaperMC/Paper@c081104 Add experience points api (#9688)
PaperMC/Paper@8221b08 Fix global sound event gamerule not being respected (#8727)
PaperMC/Paper@3c0d6aa Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10085)
PaperMC/Paper@2c3ccb8 Add drops to shear events (#5678)
PaperMC/Paper@b2ffb1b Add PlayerShieldDisableEvent (#9177)
PaperMC/Paper@2951732 Add HiddenPotionEffect API (#9910)
PaperMC/Paper@e4ab50d Properly disallow async Player#chat (#8123)
PaperMC/Paper@5e978d3 Fix Folia scheduler tasks not canceling when plugin disable (#10091)
  • Loading branch information
granny committed Dec 29, 2023
1 parent 6f17a3d commit 04ee5e7
Show file tree
Hide file tree
Showing 47 changed files with 377 additions and 371 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = org.purpurmc.purpur
version = 1.20.4-R0.1-SNAPSHOT

mcVersion = 1.20.4
paperCommit = c215ce185861af0fd123a91a79ad8907d9a7951a
paperCommit = 5e978d3a3d2c8068ea152ea5a38938f1f8c15d94

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0005-Purpur-client-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 c09f423fe2a029c933bd2697c8ff104fc4230cf0..0246fdcb873c50cf15581899b951ecb23b51d226 100644
index ae61a39b25267b84fe0b8766e4b12d9b24b44ded..515f1d5d6a5674e5667d61651f27ca6bb6823ad5 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3535,4 +3535,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3574,4 +3574,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0008-Allow-inventory-resizing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Allow inventory resizing


diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index 64e59fe706b0bb37fc2439fa88fd40c3167c9fb5..333ba8a730d01b6baa980f34aa03f3db90c8f255 100644
index daa1306a7324d946d66ad5a674bbc84371d8d4d6..f3b2d7b6fda051211add2b3215f120fb6911aeed 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -159,7 +159,7 @@ public enum InventoryType {
@@ -165,7 +165,7 @@ public enum InventoryType {
SMITHING_NEW(4, "Upgrade Gear"),
;

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0010-AFK-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 0246fdcb873c50cf15581899b951ecb23b51d226..8749e76035350908bbf2d8debd28ea5a2eb2d7ac 100644
index 515f1d5d6a5674e5667d61651f27ca6bb6823ad5..65dfe7600a7aa7e7cc30915f04f39fde2afba688 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3543,5 +3543,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3582,5 +3582,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return True if Player uses Purpur Client
*/
public boolean usesPurpurClient();
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0013-LivingEntity-safeFallDistance.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity safeFallDistance


diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index e68c71047b2bc1b456c380db25b3ff376852b4a9..ddcfa6a4f678801bb09716c0c7bcc06e37add26d 100644
index 47b0154928b3d36e2602da202df07defbcf82108..d34ef2581a7f51eb484994253e3307b7952751cc 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1270,4 +1270,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1276,4 +1276,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0020-LivingEntity-broadcastItemBreak.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity#broadcastItemBreak


diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index ddcfa6a4f678801bb09716c0c7bcc06e37add26d..880b2b045e34eb52a2efcaea4ac4bdfade4c353a 100644
index d34ef2581a7f51eb484994253e3307b7952751cc..11493047fd7bbceed1b566bf0aae8790e4291601 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1285,5 +1285,12 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1291,5 +1291,12 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param safeFallDistance Safe fall distance
*/
void setSafeFallDistance(float safeFallDistance);
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0030-API-for-any-mob-to-burn-daylight.patch
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ index 566c74756c66db859a4f738a7716a61d012c6df1..c20f29e1ddfd1d73df19f6d6f730fa23
// Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 880b2b045e34eb52a2efcaea4ac4bdfade4c353a..6b025794c34e1b4b47b4b5ae1375705bdedad078 100644
index 11493047fd7bbceed1b566bf0aae8790e4291601..7498179f6df47008c4da6ad6d67b2ce16f49e7a6 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1292,5 +1292,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1298,5 +1298,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param slot Equipment slot to play break animation for
*/
void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
Expand Down
120 changes: 62 additions & 58 deletions patches/api/0037-Potion-NamespacedKey.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,57 @@ Subject: [PATCH] Potion NamespacedKey


diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf235eba7e89 100644
index c8ab330ef171795d08fa201cf8320703c7f1c66b..93e2ea220dc03c122f82af65d5e9fda5b582290c 100644
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
@@ -32,12 +32,14 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -33,6 +33,7 @@ public class PotionEffect implements ConfigurationSerializable {
private static final String AMBIENT = "ambient";
private static final String PARTICLES = "has-particles";
private static final String ICON = "has-icon";
+ private static final String KEY = "namespacedKey"; // Purpur
private final int amplifier;
private final int duration;
private final PotionEffectType type;
private final boolean ambient;
@@ -40,6 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
private final boolean particles;
private final boolean icon;
private final PotionEffect hiddenEffect; // Paper
+ @Nullable private final NamespacedKey key; // Purpur

/**
* Creates a potion effect.
@@ -50,6 +52,36 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -50,11 +52,12 @@ public class PotionEffect implements ConfigurationSerializable {
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
* @param hiddenEffect the hidden PotionEffect
* @hidden Internal-- hidden effects are only shown internally
*/
@org.jetbrains.annotations.ApiStatus.Internal // Paper
- public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect) { // Paper
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect, @Nullable NamespacedKey key) { // Paper // Purpur
Preconditions.checkArgument(type != null, "effect type cannot be null");
this.type = type;
this.duration = duration;
@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable {
this.ambient = ambient;
this.particles = particles;
this.icon = icon;
+ this.key = key; // Purpur
// Paper start
this.hiddenEffect = hiddenEffect;
}
@@ -77,10 +81,27 @@ public class PotionEffect implements ConfigurationSerializable {
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
*/
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
+ // Purpur start
+ this(type, duration, amplifier, ambient, particles, icon, null);
+ }
+
+ /**
+ * Create a potion effect.
+ * @param duration measured in ticks, see {@link
+ * PotionEffect#getDuration()}
+ * @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
+ * @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
+ * @param particles the particle status, see {@link PotionEffect#hasParticles()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
+ */
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, @Nullable NamespacedKey key) {
+ this(type, duration, amplifier, ambient, particles, particles, key);
+ }
+
- this(type, duration, amplifier, ambient, particles, icon, null);
+ this(type, duration, amplifier, ambient, particles, icon, null, null); // Purpur
// Paper end
}

+ // Purpur start
+ /**
+ * Creates a potion effect.
+ * @param type effect type
Expand All @@ -56,24 +68,19 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
+ */
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable NamespacedKey key) {
+ // Purpur end
Preconditions.checkArgument(type != null, "effect type cannot be null");
this.type = type;
this.duration = duration;
@@ -57,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable {
this.ambient = ambient;
this.particles = particles;
this.icon = icon;
+ this.key = key; // Purpur - add key
}

+ this(type, duration, amplifier, ambient, particles, icon, null, key);
+ }
+ // Purpur end
+
/**
@@ -104,36 +137,43 @@ public class PotionEffect implements ConfigurationSerializable {
* Creates a potion effect with no defined color.
*
@@ -126,33 +147,33 @@ public class PotionEffect implements ConfigurationSerializable {
* @param map the map to deserialize from
*/
public PotionEffect(@NotNull Map<String, Object> map) {
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)));
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), getKey(map)); // Purpur - getKey
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT)); // Paper
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT), getKey(map)); // Paper // Purpur - getKey
}

// Paper start
Expand Down Expand Up @@ -107,6 +114,10 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}

/**
@@ -169,6 +190,13 @@ public class PotionEffect implements ConfigurationSerializable {
}
// Paper end

+ // Purpur start
Expand All @@ -119,7 +130,7 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
PotionEffectType effect;
@@ -166,17 +206,33 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -201,6 +229,17 @@ public class PotionEffect implements ConfigurationSerializable {
return def;
}

Expand All @@ -137,35 +148,28 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23
@Override
@NotNull
public Map<String, Object> serialize() {
- return ImmutableMap.<String, Object>builder()
+ // Purpur start - add key, don't serialize if null.
+ ImmutableMap.Builder<String, Object> builder = ImmutableMap.<String, Object>builder()
.put(TYPE, type.getKey().toString())
.put(DURATION, duration)
.put(AMPLIFIER, amplifier)
.put(AMBIENT, ambient)
.put(PARTICLES, particles)
- .put(ICON, icon)
- .build();
+ .put(ICON, icon);
+ if(key != null) {
@@ -215,6 +254,11 @@ public class PotionEffect implements ConfigurationSerializable {
if (this.hiddenEffect != null) {
builder.put(HIDDEN_EFFECT, this.hiddenEffect);
}
+ // Purpur start
+ if (key != null) {
+ builder.put(KEY, key.toString());
+ }
+ return builder.build();
+ // Purpur end
return builder.build();
// Paper end
}

/**
@@ -200,7 +256,7 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -243,7 +287,7 @@ public class PotionEffect implements ConfigurationSerializable {
return false;
}
PotionEffect that = (PotionEffect) obj;
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon;
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && this.key == that.key; // Purpur - add key
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect); // Paper
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect) && this.key == that.key; // Paper // Purpur - add key
}

/**
@@ -296,6 +352,24 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -339,6 +383,24 @@ public class PotionEffect implements ConfigurationSerializable {
return icon;
}

Expand All @@ -190,11 +194,11 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23
@Override
public int hashCode() {
int hash = 1;
@@ -310,6 +384,6 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -354,6 +416,6 @@ public class PotionEffect implements ConfigurationSerializable {

@Override
public String toString() {
- return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "");
+ return type.getName() + (ambient ? ":(" : ":") + duration + "t-x" + amplifier + (ambient ? ")" : "") + (hasKey() ? "(" + key + ")" : ""); // Purpur - add key if not null
- return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + '}'; // Paper
+ return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + ", key=" + key + '}'; // Paper // Purpur - add key
}
}
4 changes: 2 additions & 2 deletions patches/api/0044-Debug-Marker-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ index 1173081896ca95ab001175ddf6e269ab5e791896..e4f0d5ee85371374453b837947c7f84c

/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 8749e76035350908bbf2d8debd28ea5a2eb2d7ac..ac9f3b74a2c0d2fadb52cc3f3e11d635f9088cf8 100644
index 65dfe7600a7aa7e7cc30915f04f39fde2afba688..73415adcdd161b3b3b79be14967f805df2733030 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3563,5 +3563,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3602,5 +3602,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated Use {@link #resetIdleDuration()} instead
*/
void resetIdleTimer();
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0045-Add-death-screen-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Add death screen API


diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ac9f3b74a2c0d2fadb52cc3f3e11d635f9088cf8..ee76f84c8e341e4939ed0082a6ed889b701533cb 100644
index 73415adcdd161b3b3b79be14967f805df2733030..3aa79be25d63f704170baaf799482ccdde6a2830 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3633,5 +3633,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3672,5 +3672,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Clears all debug block highlights
*/
void clearBlockHighlights();
Expand Down
Loading

0 comments on commit 04ee5e7

Please sign in to comment.