From 24eea0768fdeafc2556b6b776e545d9246ec6409 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sun, 14 Jan 2024 05:30:00 -0500 Subject: [PATCH] Updated Upstream (Gale/Purpur/Dependencies) --- .github/workflows/auto-update.yml | 4 +- build.gradle.kts | 2 +- gradle.properties | 2 +- patches/api/0002-Pufferfish-Sentry.patch | 4 +- patches/api/0003-Purpur-API-Changes.patch | 145 ++--- patches/api/0005-Bump-Dependencies.patch | 9 +- patches/api/0007-KeYi-Player-Skull-API.patch | 4 +- patches/api/0008-Slice-Smooth-Teleports.patch | 4 +- patches/server/0001-Rebrand.patch | 4 +- ...005-Pufferfish-Optimize-mob-spawning.patch | 6 +- ...fferfish-Dynamic-Activation-of-Brain.patch | 12 +- .../server/0008-Pufferfish-Entity-TTL.patch | 6 +- .../server/0009-Purpur-Server-Changes.patch | 571 +++++++++--------- ...-Purpur-Configurable-server-mod-name.patch | 4 +- patches/server/0011-Remove-Timings.patch | 94 +-- patches/server/0012-Bump-Dependencies.patch | 8 +- ...Remove-UseItemOnPacket-Too-Far-Check.patch | 4 +- .../server/0017-KeYi-Player-Skull-API.patch | 4 +- patches/server/0025-Leaves-Server-Utils.patch | 8 +- .../server/0026-Leaves-Protocol-Core.patch | 6 +- .../0029-Leaves-Xaero-Map-Protocol.patch | 4 +- .../0030-Leaves-Syncmatica-Protocol.patch | 4 +- patches/server/0036-Reduce-canSee-work.patch | 6 +- ...able-movement-speed-of-more-entities.patch | 14 +- ...oleAppender-NPE-error-on-server-clos.patch | 6 +- ...4-PandaSpigot-Configurable-knockback.patch | 6 +- settings.gradle.kts | 6 +- 27 files changed, 475 insertions(+), 472 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index aac154b4..e38d9780 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -10,13 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Leaf repository - uses: actions/checkout@v3 + uses: actions/checkout@main with: path: 'Leaf' token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout Gale repository - uses: actions/checkout@v3 + uses: actions/checkout@main with: path: 'Gale' repository: "Dreeam-qwq/Gale" diff --git a/build.gradle.kts b/build.gradle.kts index fca3a799..cad6583e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ repositories { } dependencies { - remapper("net.fabricmc:tiny-remapper:0.9.0:fat") + remapper("net.fabricmc:tiny-remapper:0.10.0:fat") decompiler("org.vineflower:vineflower:1.9.3") paperclip("io.papermc:paperclip:3.0.4-SNAPSHOT") } diff --git a/gradle.properties b/gradle.properties index ee3f2951..e72652be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = org.dreeam.leaf version = 1.20.4-R0.1-SNAPSHOT -galeCommit = 993b4ec0aca9326ed9910c237d656673e83a3edb +galeCommit = d4340c647e85de9bdf5f29eb56b25e1b04fd1f66 org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0002-Pufferfish-Sentry.patch b/patches/api/0002-Pufferfish-Sentry.patch index 78b73214..2132173e 100644 --- a/patches/api/0002-Pufferfish-Sentry.patch +++ b/patches/api/0002-Pufferfish-Sentry.patch @@ -7,14 +7,14 @@ Original license: GPL v3 Original project: https://github.com/pufferfish-gg/Pufferfish diff --git a/build.gradle.kts b/build.gradle.kts -index 3f11b99f87eb380daeb1f660f63a8347958e1e0f..3f01a142439616c88c3b5da4d6cab80bfdaa2a76 100644 +index 3f11b99f87eb380daeb1f660f63a8347958e1e0f..0d9531a62d7667b98a57bd6b8e627a3e2f105001 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,6 +51,7 @@ dependencies { apiAndDocs("net.kyori:adventure-text-logger-slf4j") api("org.apache.logging.log4j:log4j-api:$log4jVersion") api("org.slf4j:slf4j-api:$slf4jVersion") -+ api("io.sentry:sentry:7.1.0") // Pufferfish ++ api("io.sentry:sentry:7.2.0") // Pufferfish implementation("org.ow2.asm:asm:9.5") implementation("org.ow2.asm:asm-commons:9.5") diff --git a/patches/api/0003-Purpur-API-Changes.patch b/patches/api/0003-Purpur-API-Changes.patch index f0545273..87702b12 100644 --- a/patches/api/0003-Purpur-API-Changes.patch +++ b/patches/api/0003-Purpur-API-Changes.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes Original license: MIT Original project: https://github.com/PurpurMC/Purpur -Commit: 6f17a3da52ca57ed1647593b8b37e4306fff8b70 +Commit: de54530c93353462042e18e37f791298257ce2f7 Patches below are removed in this patch: Pufferfish-API-Changes.patch @@ -956,10 +956,10 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a + // Purpur end } diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index e68c71047b2bc1b456c380db25b3ff376852b4a9..6b025794c34e1b4b47b4b5ae1375705bdedad078 100644 +index 47b0154928b3d36e2602da202df07defbcf82108..7498179f6df47008c4da6ad6d67b2ce16f49e7a6 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -1270,4 +1270,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -1276,4 +1276,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ void setBodyYaw(float bodyYaw); // Paper end @@ -1027,10 +1027,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc + // Purpur end } diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 2238cbe3f7680e759baa8c91e4db6ad5202e3cab..32fc5a73c79858e31c3de45e16179714d3bea667 100644 +index caa24af01ee57c8d1917818c1063d2fa75f1ae4a..5579fe9823d13be13d501cd0e3383b5763e2a4ed 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -3545,4 +3545,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -3584,4 +3584,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Override Spigot spigot(); // Spigot end @@ -1266,10 +1266,10 @@ index c9f395064656dd0126410eb3c6e197baa450c063..13156a12e5df50cdc1e465dc0bd9d941 * When a player gets bad omen after killing a patrol captain. */ 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"), ; @@ -2063,10 +2063,10 @@ index cd3296fea01648592d2af89b3d80135acb6d0958..45797a6fbae1d8edc4211cb30def24ad permissions.put(lname, new PermissionAttachmentInfo(parent, lname, attachment, value)); 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..ea656ed39ebc9875f93f99bea274b0ea4456fcf5 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"; @@ -2074,64 +2074,72 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23 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 */ - 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); -+ } -+ -+ /** -+ * Creates a potion effect. -+ * @param type effect type -+ * @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 icon the icon status, see {@link PotionEffect#hasIcon()} -+ * @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 + @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; -@@ -57,6 +89,7 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable { this.ambient = ambient; this.particles = particles; this.icon = icon; -+ this.key = key; // Purpur - add key ++ this.key = key; // Purpur + // Paper start + this.hiddenEffect = hiddenEffect; + } +@@ -77,10 +81,28 @@ 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) { +- 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 ++ * @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 icon the icon status, see {@link PotionEffect#hasIcon()} ++ * @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) { ++ 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 +148,33 @@ public class PotionEffect implements ConfigurationSerializable { * @param map the map to deserialize from */ public PotionEffect(@NotNull Map 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 @@ -2165,6 +2173,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 +191,13 @@ public class PotionEffect implements ConfigurationSerializable { + } // Paper end + // Purpur start @@ -2177,7 +2189,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 +230,17 @@ public class PotionEffect implements ConfigurationSerializable { return def; } @@ -2195,35 +2207,28 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23 @Override @NotNull public Map serialize() { -- return ImmutableMap.builder() -+ // Purpur start - add key, don't serialize if null. -+ ImmutableMap.Builder builder = ImmutableMap.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 +255,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 +288,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 +384,24 @@ public class PotionEffect implements ConfigurationSerializable { return icon; } @@ -2248,12 +2253,12 @@ index 037af5fd6d71a526c0e6620f2db0cd6df9625261..939ed1931492854c5854cab06730cf23 @Override public int hashCode() { int hash = 1; -@@ -310,6 +384,6 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -354,6 +417,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 } } diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java diff --git a/patches/api/0005-Bump-Dependencies.patch b/patches/api/0005-Bump-Dependencies.patch index 6b10914d..2c8dfdd9 100644 --- a/patches/api/0005-Bump-Dependencies.patch +++ b/patches/api/0005-Bump-Dependencies.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies diff --git a/build.gradle.kts b/build.gradle.kts -index 3f01a142439616c88c3b5da4d6cab80bfdaa2a76..dee13c231683420cc5e1c5bbae280020b40c36ae 100644 +index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..bd863ad35b4ed1da320ab6276ebedbaf52ab2d67 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,11 +9,11 @@ java { @@ -16,9 +16,10 @@ index 3f01a142439616c88c3b5da4d6cab80bfdaa2a76..dee13c231683420cc5e1c5bbae280020 +val annotationsVersion = "24.1.0" // Leaf - Bump Dependencies val bungeeCordChatVersion = "1.20-R0.1" val adventureVersion = "4.15.0" - val slf4jVersion = "2.0.9" +-val slf4jVersion = "2.0.9" -val log4jVersion = "2.17.1" -+val log4jVersion = "2.22.0" // Leaf - Bump Dependencies ++val slf4jVersion = "2.0.11" ++val log4jVersion = "2.22.1" // Leaf - Bump Dependencies val apiAndDocs: Configuration by configurations.creating { attributes { attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) @@ -42,7 +43,7 @@ index 3f01a142439616c88c3b5da4d6cab80bfdaa2a76..dee13c231683420cc5e1c5bbae280020 apiAndDocs("net.kyori:adventure-text-minimessage") @@ -53,11 +53,12 @@ dependencies { api("org.slf4j:slf4j-api:$slf4jVersion") - api("io.sentry:sentry:7.1.0") // Pufferfish + api("io.sentry:sentry:7.2.0") // Pufferfish - implementation("org.ow2.asm:asm:9.5") - implementation("org.ow2.asm:asm-commons:9.5") diff --git a/patches/api/0007-KeYi-Player-Skull-API.patch b/patches/api/0007-KeYi-Player-Skull-API.patch index 49f3fb8f..16d3815e 100644 --- a/patches/api/0007-KeYi-Player-Skull-API.patch +++ b/patches/api/0007-KeYi-Player-Skull-API.patch @@ -7,7 +7,7 @@ Original license: MIT Original project: https://github.com/KeYiMC/KeYi diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 32fc5a73c79858e31c3de45e16179714d3bea667..a1584415383708b3e9693c91f21a7bf9daab1b25 100644 +index 5579fe9823d13be13d501cd0e3383b5763e2a4ed..e13f778a5a44c4eb352779cfca389ccfa570556a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -9,6 +9,10 @@ import java.util.Date; @@ -21,7 +21,7 @@ index 32fc5a73c79858e31c3de45e16179714d3bea667..a1584415383708b3e9693c91f21a7bf9 import org.bukkit.DyeColor; import org.bukkit.Effect; import org.bukkit.GameMode; -@@ -3664,4 +3668,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -3703,4 +3707,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM sendDeathScreen(message); } // Purpur end diff --git a/patches/api/0008-Slice-Smooth-Teleports.patch b/patches/api/0008-Slice-Smooth-Teleports.patch index d925250c..f1e030eb 100644 --- a/patches/api/0008-Slice-Smooth-Teleports.patch +++ b/patches/api/0008-Slice-Smooth-Teleports.patch @@ -7,10 +7,10 @@ Original license: MIT Original project: https://github.com/Cryptite/Slice diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index a1584415383708b3e9693c91f21a7bf9daab1b25..a262d8bf4b6f17141246ecaa0cee4c778629f424 100644 +index e13f778a5a44c4eb352779cfca389ccfa570556a..93d6dd81777969df34d1cf55d3c7a4af777a5974 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -3412,6 +3412,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -3451,6 +3451,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM String getClientBrandName(); // Paper end diff --git a/patches/server/0001-Rebrand.patch b/patches/server/0001-Rebrand.patch index 7034e5a4..14d69964 100644 --- a/patches/server/0001-Rebrand.patch +++ b/patches/server/0001-Rebrand.patch @@ -73,10 +73,10 @@ index e45e6b44b2a8f2cdae6e0048a812b92126aa17ca..b5f3f213da8a40d5184098af017c8e26 .completer(new ConsoleCommandCompleter(this.server)) .option(LineReader.Option.COMPLETE_IN_WORD, true); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f1bf143d5a97a4afbba6b2e7c07a5f46678c3260..69d7ffeae56f4e9e8bd33b23c9322f1cd9d09272 100644 +index c712427d5eda3b4c1f6968836da594f193f189b4..22734bad2fd73fbac5cc3e62de36a5c2cbfde9dc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -944,7 +944,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b19571f838469dcaba5ecee06fe43de23bcdc776..1c9ba5d25d521126a912522aed8d220cc1bb68b4 100644 +index 56ee1c3061c854d9b3fdd096c4c70eee909f0f74..628c553e0580400a8e08396def8c4db3ed1682a9 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -881,6 +881,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -886,6 +886,7 @@ public class ServerLevel extends Level implements WorldGenLevel { org.spigotmc.ActivationRange.activateEntities(this); // Spigot this.timings.entityTick.startTiming(); // Spigot this.entityTickList.forEach((entity) -> { @@ -42,7 +42,7 @@ index b19571f838469dcaba5ecee06fe43de23bcdc776..1c9ba5d25d521126a912522aed8d220c if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed entity.discard(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a2d778cd804362e03ddc73d5e35569c3d5b8d187..e32c97853eb7e94c06a97ec1b1ac0e88dd4126f5 100644 +index 8684e769b1658aa2d8fe598b77c3f99129a1962d..83a0767d4f285b944471b3dddac70270792d10f5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -440,6 +440,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -58,7 +58,7 @@ index a2d778cd804362e03ddc73d5e35569c3d5b8d187..e32c97853eb7e94c06a97ec1b1ac0e88 return this.yRot; } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 940b8d0b89d7e55c938aefbe80ee71b0db3dacb8..3e89a633b57fd206216b65f704ea8c0243e02c52 100644 +index 6cfce9755dd464a7afb01f9032e567ce3bcd5bc5..d1201c4f6625d56bfa9f329fbb32bea1ff2bcb56 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -305,6 +305,7 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -70,7 +70,7 @@ index 940b8d0b89d7e55c938aefbe80ee71b0db3dacb8..3e89a633b57fd206216b65f704ea8c02 private String descriptionId; @Nullable diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index db9aee68b644d318f65df010027b40628ea84ea2..88cccee4152d18db34818a37c7a2c19dcb6ef596 100644 +index ad6a159f5472059c1550c36dd98d83af01bbe31a..0fa8fc1cbedf0b65c7695d604bfc78c7ef2c2c41 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -227,10 +227,10 @@ public abstract class Mob extends LivingEntity implements Targeting { @@ -357,7 +357,7 @@ index 5d161351e7517acf57e98203bab8c9f9ab9d4005..634a4e46022f1d63a67c64f19f255538 private static void network() { diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 7f9efe9429f9dcceb52d72f231a7a4bbae0f9738..4295d8257616628727e7dc4aaf6d20b7eb18dc76 100644 +index c7058fb8dc39a534e9403b3392547f6d925f2851..1275d4ecc7c2dca1d82b2da883717ef7561d520d 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -40,6 +40,9 @@ import net.minecraft.world.level.Level; diff --git a/patches/server/0008-Pufferfish-Entity-TTL.patch b/patches/server/0008-Pufferfish-Entity-TTL.patch index 20ec66b6..d5f9cf37 100644 --- a/patches/server/0008-Pufferfish-Entity-TTL.patch +++ b/patches/server/0008-Pufferfish-Entity-TTL.patch @@ -7,10 +7,10 @@ Original license: GPL v3 Original project: https://github.com/pufferfish-gg/Pufferfish diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e32c97853eb7e94c06a97ec1b1ac0e88dd4126f5..80f210c04d3ae3a36ff46273b5cb7b4a95408ce3 100644 +index 83a0767d4f285b944471b3dddac70270792d10f5..e62d19bb841779684bb3a3ffb34f7bb0939303be 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -809,6 +809,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -813,6 +813,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void tick() { @@ -24,7 +24,7 @@ index e32c97853eb7e94c06a97ec1b1ac0e88dd4126f5..80f210c04d3ae3a36ff46273b5cb7b4a } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 3e89a633b57fd206216b65f704ea8c0243e02c52..a63399eedb896c06e96c7fba5cac7102e1c40ba6 100644 +index d1201c4f6625d56bfa9f329fbb32bea1ff2bcb56..cf90ecefea3586d0ce236288ab515bfa67239814 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -306,6 +306,7 @@ public class EntityType implements FeatureElement, EntityTypeT diff --git a/patches/server/0009-Purpur-Server-Changes.patch b/patches/server/0009-Purpur-Server-Changes.patch index 6d16a1fb..93a4daf1 100644 --- a/patches/server/0009-Purpur-Server-Changes.patch +++ b/patches/server/0009-Purpur-Server-Changes.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur Server Changes Original license: MIT Original project: https://github.com/PurpurMC/Purpur -Commit: 6f17a3da52ca57ed1647593b8b37e4306fff8b70 +Commit: de54530c93353462042e18e37f791298257ce2f7 Patches below are removed in this patch: Metrics change in Purpur-config-files.patch @@ -418,10 +418,10 @@ index 0000000000000000000000000000000000000000..a7d1ae53eac94bc2dcf8bc78ef1da0d3 + } +} diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 14f4c0a93372a58cf36dc95265b5e210ea1605e5..e75a5caa06a1a92a7ab4c70b1d4ab512f645022d 100644 +index 37ba8fd69a0099f80bdf7c28b593241f1f5d681f..288e3cf7d522232aeb40090537a55a2cf06d92e2 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java -@@ -217,6 +217,19 @@ public class CommandSourceStack implements ExecutionCommandSource entityType, Direction direction) { diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -index e17090003988ad2c890d48666c2234b14d511345..433f1f11b8b92c7d48352416f79ab5a394c33287 100644 +index 887e75c940ab5089f4e42e4553ab95adf172df46..8db955ae0c7eb6f1e53701d9199798e6412e6c69 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -@@ -107,7 +107,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { +@@ -104,7 +104,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { + if (ishearable.readyForShearing()) { + // CraftBukkit start + // Paper start +- org.bukkit.event.block.BlockShearEntityEvent event = CraftEventFactory.callBlockShearEntityEvent(entityliving, bukkitBlock, craftItem, ishearable.generateDefaultDrops()); ++ org.bukkit.event.block.BlockShearEntityEvent event = CraftEventFactory.callBlockShearEntityEvent(entityliving, bukkitBlock, craftItem, ishearable.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.MOB_LOOTING, CraftItemStack.asNMSCopy(craftItem)))); // Purpur + if (event.isCancelled()) { + // Paper end continue; - } - // CraftBukkit end -- ishearable.shear(SoundSource.BLOCKS); -+ ishearable.shear(SoundSource.BLOCKS, net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.MOB_LOOTING, CraftItemStack.asNMSCopy(craftItem))); // Purpur - worldserver.gameEvent((Entity) null, GameEvent.SHEAR, blockposition); - return true; - } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java index 79ff5a76b382581c4125b859d9f00ee19d784100..ad203f259d8fbef6157d5580a1ee6950d0594f57 100644 --- a/src/main/java/net/minecraft/network/Connection.java @@ -659,7 +659,7 @@ index 79ff5a76b382581c4125b859d9f00ee19d784100..ad203f259d8fbef6157d5580a1ee6950 } // Paper end diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index b13bc90b28b02f5e80d935bfcba727f92c5e4c4f..0cdc68722552a464fb828016eb93f865bc8bde54 100644 +index a5bcad412fb1ac3b6a3eee3f4618dc6c1ca66936..3b301945a08dc2162bfae76ea8c3b04bb65f53dd 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -95,6 +95,8 @@ public class FriendlyByteBuf extends ByteBuf { @@ -671,7 +671,7 @@ index b13bc90b28b02f5e80d935bfcba727f92c5e4c4f..0cdc68722552a464fb828016eb93f865 public FriendlyByteBuf(ByteBuf parent) { this.source = parent; } -@@ -635,6 +637,17 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -640,6 +642,17 @@ public class FriendlyByteBuf extends ByteBuf { this.writeBoolean(false); } else { this.writeBoolean(true); @@ -703,10 +703,10 @@ index 9ec6145fe04ec64bbee8ec6a837719caebdbc6f5..358d610ad020cada1bb83e393deeeaae public ClientboundSetTimePacket(long time, long timeOfDay, boolean doDaylightCycle) { this.gameTime = time; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 01d8446b4019562a2e68b14236a85277639d6728..7418860e8d25d6eeab33a617a7365c608e1454d2 100644 +index 824004849ef389d629ddca7e60f664f5f465ff90..fe3ad5d2acec094e9f363acb418233a2756fd0c3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -279,6 +279,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -288,11 +289,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper @@ -812,7 +812,7 @@ index 01d8446b4019562a2e68b14236a85277639d6728..7418860e8d25d6eeab33a617a7365c60 /* Drop global time updates if (this.tickCount % 20 == 0) { -@@ -2723,6 +2749,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> consumer, Set trackedPlayers) { this.trackedPlayers = trackedPlayers; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde1766f70ce84 100644 +index 628c553e0580400a8e08396def8c4db3ed1682a9..20be339c5a6e6b012d21604dadfe214787067287 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -215,6 +215,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1148,7 +1148,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 public static Throwable getAddToWorldStackTrace(Entity entity) { final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); -@@ -709,7 +712,24 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -714,7 +717,24 @@ public class ServerLevel extends Level implements WorldGenLevel { this.dragonParts = new Int2ObjectOpenHashMap(); this.tickTime = flag1; this.server = minecraftserver; @@ -1174,7 +1174,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 this.serverLevelData = iworlddataserver; ChunkGenerator chunkgenerator = worlddimension.generator(); // CraftBukkit start -@@ -771,6 +791,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -776,6 +796,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.chunkTaskScheduler = new io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler(this, io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.workerThreads); // Paper - rewrite chunk system this.entityLookup = new io.papermc.paper.chunk.system.entity.EntityLookup(this, new EntityCallbacks()); // Paper - rewrite chunk system @@ -1182,7 +1182,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 } // Paper start -@@ -817,7 +838,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -822,7 +843,7 @@ public class ServerLevel extends Level implements WorldGenLevel { int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); long j; @@ -1191,7 +1191,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 // CraftBukkit start j = this.levelData.getDayTime() + 24000L; TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime()); -@@ -939,6 +960,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -944,6 +965,13 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setGameTime(i); this.serverLevelData.getScheduledEvents().tick(this.server, i); if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) { @@ -1205,7 +1205,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 this.setDayTime(this.levelData.getDayTime() + 1L); } -@@ -947,8 +975,22 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -952,8 +980,22 @@ public class ServerLevel extends Level implements WorldGenLevel { public void setDayTime(long timeOfDay) { this.serverLevelData.setDayTime(timeOfDay); @@ -1228,7 +1228,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) { Iterator iterator = this.customSpawners.iterator(); -@@ -991,10 +1033,18 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -996,10 +1038,18 @@ public class ServerLevel extends Level implements WorldGenLevel { boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper if (flag1) { @@ -1249,7 +1249,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 entityhorseskeleton.setAge(0); entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit -@@ -1114,7 +1164,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1119,7 +1169,7 @@ public class ServerLevel extends Level implements WorldGenLevel { return holder.is(PoiTypes.LIGHTNING_ROD); }, (blockposition1) -> { return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1; @@ -1258,7 +1258,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 return optional.map((blockposition1) -> { return blockposition1.above(1); -@@ -1163,11 +1213,27 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1168,11 +1218,27 @@ public class ServerLevel extends Level implements WorldGenLevel { if (this.canSleepThroughNights()) { if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) { int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE); @@ -1287,7 +1287,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i)); } -@@ -1307,6 +1373,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1312,6 +1378,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public void resetWeatherCycle() { // CraftBukkit start @@ -1295,7 +1295,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - when passing the night // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... -@@ -1314,6 +1381,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1319,6 +1386,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setRainTime(0); } // CraftBukkit end @@ -1303,7 +1303,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - when passing the night // CraftBukkit start // If we stop due to everyone sleeping we should reset the weather duration to some other random value. -@@ -2824,7 +2892,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2830,7 +2898,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start @@ -1313,7 +1313,7 @@ index 1c9ba5d25d521126a912522aed8d220cc1bb68b4..dd677f1981abd5aaaf9c1ec79dbde176 } // Paper end diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6abcfa6bd 100644 +index 03dd5516500bb4590ced0475ca31a19234c1acbb..9363801ce4342f598309b3aab40ee36b95e0d047 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -282,6 +282,10 @@ public class ServerPlayer extends Player { @@ -1363,7 +1363,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 } public void doTick() { -@@ -999,6 +1018,7 @@ public class ServerPlayer extends Player { +@@ -1000,6 +1019,7 @@ public class ServerPlayer extends Player { })); PlayerTeam scoreboardteam = this.getTeam(); @@ -1371,7 +1371,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 if (scoreboardteam != null && scoreboardteam.getDeathMessageVisibility() != Team.Visibility.ALWAYS) { if (scoreboardteam.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) { this.server.getPlayerList().broadcastSystemToTeam(this, ichatbasecomponent); -@@ -1102,6 +1122,16 @@ public class ServerPlayer extends Player { +@@ -1103,6 +1123,16 @@ public class ServerPlayer extends Player { if (this.isInvulnerableTo(source)) { return false; } else { @@ -1388,7 +1388,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 boolean flag = this.server.isDedicatedServer() && this.isPvpAllowed() && source.is(DamageTypeTags.IS_FALL); if (!flag && this.spawnInvulnerableTime > 0 && !source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { -@@ -1245,6 +1275,7 @@ public class ServerPlayer extends Player { +@@ -1246,6 +1276,7 @@ public class ServerPlayer extends Player { playerlist.sendPlayerPermissionLevel(this); worldserver1.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); this.unsetRemoved(); @@ -1396,7 +1396,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 // CraftBukkit end this.setServerLevel(worldserver); -@@ -1400,7 +1431,7 @@ public class ServerPlayer extends Player { +@@ -1401,7 +1432,7 @@ public class ServerPlayer extends Player { return entitymonster.isPreventingPlayerRest(this); }); @@ -1405,7 +1405,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 return Either.left(Player.BedSleepingProblem.NOT_SAFE); } } -@@ -1440,7 +1471,19 @@ public class ServerPlayer extends Player { +@@ -1441,7 +1472,19 @@ public class ServerPlayer extends Player { }); if (!this.serverLevel().canSleepThroughNights()) { @@ -1426,7 +1426,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 } ((ServerLevel) this.level()).updateSleepingPlayerList(); -@@ -1545,6 +1588,7 @@ public class ServerPlayer extends Player { +@@ -1546,6 +1589,7 @@ public class ServerPlayer extends Player { @Override public void openTextEdit(SignBlockEntity sign, boolean front) { @@ -1434,7 +1434,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos())); this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), front)); } -@@ -1879,6 +1923,26 @@ public class ServerPlayer extends Player { +@@ -1880,6 +1924,26 @@ public class ServerPlayer extends Player { this.lastSentExp = -1; // CraftBukkit - Added to reset } @@ -1461,7 +1461,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 @Override public void displayClientMessage(Component message, boolean overlay) { this.sendSystemMessage(message, overlay); -@@ -2206,8 +2270,68 @@ public class ServerPlayer extends Player { +@@ -2207,8 +2271,68 @@ public class ServerPlayer extends Player { public void resetLastActionTime() { this.lastActionTime = Util.getMillis(); @@ -1530,7 +1530,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 public ServerStatsCounter getStats() { return this.stats; } -@@ -2759,4 +2883,50 @@ public class ServerPlayer extends Player { +@@ -2760,4 +2884,50 @@ public class ServerPlayer extends Player { return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end @@ -1582,7 +1582,7 @@ index 861213485bb8f2751cfb59ddf15f99360fff34d8..96ed7cb2f34718b7b1cb5abdc386b7c6 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index c0b368b8137ca6d90c4e6ec931e07b7ea69f8d9b..d02fec293868dd288e0fa0a9d214774f22719a0a 100644 +index bda773986fbe422840874e0934f805a5c2ffab21..e54b4a771722356914d8be84f105ddca5fb1d770 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -397,6 +397,7 @@ public class ServerPlayerGameMode { @@ -1656,10 +1656,10 @@ index e716cbde9bbf3837b614ea1ddd4f881178d938d0..1ee6f597bbb8ba62b9fddde3fd7a9108 try { String channels = payload.toString(com.google.common.base.Charsets.UTF_8); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee69290752043f 100644 +index 02b80a9ecfffb83f05c9a36c91c9508cada0062d..c8d91ce1364421f7ce307aef5a4dbfa6f5b75369 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -337,6 +337,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -336,6 +336,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } // Gale end - make max interaction distance configurable @@ -1680,7 +1680,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 @Override public void tick() { if (this.ackBlockChangesUpTo > -1) { -@@ -404,6 +418,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -403,6 +417,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits. @@ -1693,16 +1693,20 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } -@@ -652,6 +672,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -653,10 +673,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); + if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur + - // Skip the first time we do this - if (true) { // Spigot - don't skip any move events - Location oldTo = to.clone(); -@@ -728,6 +750,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + Location oldTo = to.clone(); + PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); + this.cserver.getPluginManager().callEvent(event); +- + // If the event is cancelled we move the player back to their old location. + if (event.isCancelled()) { + this.teleport(from); +@@ -726,6 +747,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause @@ -1710,7 +1714,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 return; } -@@ -1147,10 +1170,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1145,10 +1167,15 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl int maxBookPageSize = io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.pageMax; double multiplier = Math.max(0.3D, Math.min(1D, io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier)); long byteAllowed = maxBookPageSize; @@ -1726,7 +1730,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause return; } -@@ -1174,6 +1202,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1172,6 +1199,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -1734,7 +1738,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 server.scheduleOnMain(() -> this.disconnect("Book too large!", org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION)); // Paper - kick event cause return; } -@@ -1227,13 +1256,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1225,13 +1253,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl itemstack1.setTag(nbttagcompound.copy()); } @@ -1754,7 +1758,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 this.updateBookPages(pages, (s) -> { return Component.Serializer.toJson(Component.literal(s)); -@@ -1245,10 +1277,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1243,10 +1274,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl private void updateBookPages(List list, UnaryOperator unaryoperator, ItemStack itemstack, int slot, ItemStack handItem) { // CraftBukkit ListTag nbttaglist = new ListTag(); @@ -1770,7 +1774,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 Objects.requireNonNull(nbttaglist); stream.forEach(nbttaglist::add); -@@ -1258,11 +1293,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1256,11 +1290,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl for (int j = list.size(); i < j; ++i) { FilteredText filteredtext = (FilteredText) list.get(i); @@ -1784,7 +1788,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 } } -@@ -1275,6 +1310,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1273,6 +1307,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.getInventory().setItem(slot, CraftEventFactory.handleEditBookEvent(this.player, slot, handItem, itemstack)); // CraftBukkit // Paper - Don't ignore result (see other callsite for handleEditBookEvent) } @@ -1801,7 +1805,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 @Override public void handleEntityTagQuery(ServerboundEntityTagQuery packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); -@@ -1324,8 +1369,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1322,8 +1366,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); @@ -1819,7 +1823,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 } else { ServerLevel worldserver = this.player.serverLevel(); -@@ -1510,7 +1563,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1509,7 +1561,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl if (!event.isAllowed()) { flag2 = true; // Paper - diff on change, this should be moved wrongly if (event.getLogWarning()) @@ -1828,16 +1832,16 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 } // Paper end } -@@ -1572,6 +1625,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1579,6 +1631,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); + if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetLastActionTime(); // Purpur + - // Skip the first time we do this - if (from.getX() != Double.MAX_VALUE) { - Location oldTo = to.clone(); -@@ -1610,6 +1665,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + Location oldTo = to.clone(); + PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); + this.cserver.getPluginManager().callEvent(event); +@@ -1614,6 +1668,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.player.resetFallDistance(); } @@ -1851,7 +1855,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 this.player.checkMovementStatistics(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5); this.lastGoodX = this.player.getX(); this.lastGoodY = this.player.getY(); -@@ -1661,6 +1723,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1665,6 +1726,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl return false; } // Paper end - optimise out extra getCubes @@ -1865,7 +1869,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 private boolean isPlayerCollidingWithAnythingNew(LevelReader world, AABB box, double newX, double newY, double newZ) { AABB axisalignedbb1 = this.player.getBoundingBox().move(newX - this.player.getX(), newY - this.player.getY(), newZ - this.player.getZ()); Iterable iterable = world.getCollisions(this.player, axisalignedbb1.deflate(9.999999747378752E-6D)); -@@ -1671,7 +1740,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1675,7 +1743,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl do { if (!iterator.hasNext()) { @@ -1874,7 +1878,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 } voxelshape1 = (VoxelShape) iterator.next(); -@@ -2006,6 +2075,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2010,6 +2078,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean cancelled; if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) { @@ -1882,7 +1886,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack, enumhand); cancelled = event.useItemInHand() == Event.Result.DENY; } else { -@@ -2721,6 +2791,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2728,6 +2797,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = entity.getBoundingBox(); if (axisalignedbb.distanceToSqr(this.player.getEyePosition()) < ServerGamePacketListenerImpl.getMaxInteractionDistanceSquared(this.player.level())) { // Gale - make max interaction distance configurable @@ -1890,7 +1894,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 packet.dispatch(new ServerboundInteractPacket.Handler() { private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand); -@@ -2734,6 +2805,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2741,6 +2811,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event); @@ -1899,7 +1903,7 @@ index 7b955100e39a935259887475278b24cf29905577..ca8db3c11a6a794b23f760b7aaee6929 // Entity in bucket - SPIGOT-4048 and SPIGOT-6859a if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) { entity.getEntityData().resendPossiblyDesyncedEntity(player); // Paper - The entire mob gets deleted, so resend it. -@@ -3319,6 +3392,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3326,6 +3398,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } } @@ -1926,7 +1930,7 @@ index 1fe07210973790dd1a084d330dcad46bb86ac267..d75ea980ef2333f5125f5935f2a13993 } } catch (AuthenticationUnavailableException authenticationunavailableexception) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5720af3b629fbd10ac4a8c399623be4d4b2d8022..a0cca8f9f92eca597552d497ee61b068622482be 100644 +index 8f15a811441027faf2b269123c99b3357b8aa3e9..35b18d05097a0bceffe0399ba9cf283ad046051f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -502,6 +502,7 @@ public abstract class PlayerList { @@ -1954,7 +1958,7 @@ index 5720af3b629fbd10ac4a8c399623be4d4b2d8022..a0cca8f9f92eca597552d497ee61b068 event.disallow(PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure } } -@@ -1122,6 +1124,20 @@ public abstract class PlayerList { +@@ -1128,6 +1130,20 @@ public abstract class PlayerList { } // CraftBukkit end @@ -1975,7 +1979,7 @@ index 5720af3b629fbd10ac4a8c399623be4d4b2d8022..a0cca8f9f92eca597552d497ee61b068 public void broadcastAll(Packet packet, ResourceKey dimension) { Iterator iterator = this.players.iterator(); -@@ -1225,6 +1241,7 @@ public abstract class PlayerList { +@@ -1231,6 +1247,7 @@ public abstract class PlayerList { } else { b0 = (byte) (24 + permissionLevel); } @@ -1983,7 +1987,7 @@ index 5720af3b629fbd10ac4a8c399623be4d4b2d8022..a0cca8f9f92eca597552d497ee61b068 player.connection.send(new ClientboundEntityEventPacket(player, b0)); } -@@ -1233,6 +1250,27 @@ public abstract class PlayerList { +@@ -1239,6 +1256,27 @@ public abstract class PlayerList { player.getBukkitEntity().recalculatePermissions(); // CraftBukkit this.server.getCommands().sendCommands(player); } // Paper @@ -2151,31 +2155,23 @@ index 3aad6bd0a1fb7bb3f9b7dab2c10c875864900750..31bd845130e363dd11c225dfd1e9dd89 } diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6c5b7ed91 100644 +index bf304db1f9506d3e83d16cd632b9155c39346634..d94497083f3da89dbef6479ef8f70591e630e3e7 100644 --- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -@@ -16,6 +16,7 @@ import net.minecraft.util.ExtraCodecs; - import net.minecraft.util.Mth; - import net.minecraft.world.entity.LivingEntity; - import org.slf4j.Logger; -+import org.bukkit.NamespacedKey; - - public class MobEffectInstance implements Comparable { - private static final Logger LOGGER = LogUtils.getLogger(); -@@ -35,6 +36,7 @@ public class MobEffectInstance implements Comparable { - private boolean visible; +@@ -36,6 +36,7 @@ public class MobEffectInstance implements Comparable { private boolean showIcon; @Nullable -+ private NamespacedKey key; // Purpur - add key - private MobEffectInstance hiddenEffect; + public MobEffectInstance hiddenEffect; ++ private org.bukkit.NamespacedKey key; // Purpur - add key private final Optional factorData; -@@ -54,17 +56,36 @@ public class MobEffectInstance implements Comparable { + public MobEffectInstance(MobEffect type) { +@@ -54,17 +55,36 @@ public class MobEffectInstance implements Comparable { this(type, duration, amplifier, ambient, visible, visible); } + // Purpur start -+ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean visible, @Nullable NamespacedKey key) { ++ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean visible, @Nullable org.bukkit.NamespacedKey key) { + this(type, duration, amplifier, ambient, visible, visible, key); + } + // Purpur end @@ -2183,20 +2179,20 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon) { - this(type, duration, amplifier, ambient, showParticles, showIcon, (MobEffectInstance)null, type.createFactorData()); + // Purpur start -+ this(type, duration, amplifier, ambient, showParticles, showIcon, (MobEffectInstance)null, type.createFactorData(), (NamespacedKey)null); ++ this(type, duration, amplifier, ambient, showParticles, showIcon, (MobEffectInstance)null, type.createFactorData(), (org.bukkit.NamespacedKey)null); + } + -+ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable NamespacedKey key) { ++ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable org.bukkit.NamespacedKey key) { + this(type, duration, amplifier, ambient, showParticles, showIcon, (MobEffectInstance)null, type.createFactorData(), key); + // Purpur end } public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable MobEffectInstance hiddenEffect, Optional factorCalculationData) { + // Purpur start -+ this(type, duration, amplifier, ambient, showParticles, showIcon, hiddenEffect, factorCalculationData, (NamespacedKey) null); ++ this(type, duration, amplifier, ambient, showParticles, showIcon, hiddenEffect, factorCalculationData, (org.bukkit.NamespacedKey) null); + } + -+ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable MobEffectInstance hiddenEffect, Optional factorCalculationData, @Nullable NamespacedKey key) { ++ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable MobEffectInstance hiddenEffect, Optional factorCalculationData, @Nullable org.bukkit.NamespacedKey key) { + // Purpur end this.effect = type; this.duration = duration; @@ -2208,7 +2204,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 this.hiddenEffect = hiddenEffect; this.factorData = factorCalculationData; } -@@ -85,6 +106,7 @@ public class MobEffectInstance implements Comparable { +@@ -85,6 +105,7 @@ public class MobEffectInstance implements Comparable { this.ambient = that.ambient; this.visible = that.visible; this.showIcon = that.showIcon; @@ -2216,7 +2212,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 } public boolean update(MobEffectInstance that) { -@@ -129,6 +151,13 @@ public class MobEffectInstance implements Comparable { +@@ -129,6 +150,13 @@ public class MobEffectInstance implements Comparable { bl = true; } @@ -2230,7 +2226,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 return bl; } -@@ -172,6 +201,17 @@ public class MobEffectInstance implements Comparable { +@@ -172,6 +200,17 @@ public class MobEffectInstance implements Comparable { return this.showIcon; } @@ -2240,7 +2236,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 + } + + @Nullable -+ public NamespacedKey getKey() { ++ public org.bukkit.NamespacedKey getKey() { + return this.key; + } + // Purpur end @@ -2248,7 +2244,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 public boolean tick(LivingEntity entity, Runnable overwriteCallback) { if (this.hasRemainingDuration()) { int i = this.isInfiniteDuration() ? entity.tickCount : this.duration; -@@ -232,6 +272,12 @@ public class MobEffectInstance implements Comparable { +@@ -232,6 +271,12 @@ public class MobEffectInstance implements Comparable { string = string + ", Show Icon: false"; } @@ -2261,7 +2257,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 return string; } -@@ -247,7 +293,7 @@ public class MobEffectInstance implements Comparable { +@@ -247,7 +292,7 @@ public class MobEffectInstance implements Comparable { return false; } else { MobEffectInstance mobEffectInstance = (MobEffectInstance)object; @@ -2270,7 +2266,7 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 } } -@@ -272,6 +318,11 @@ public class MobEffectInstance implements Comparable { +@@ -272,6 +317,11 @@ public class MobEffectInstance implements Comparable { nbt.putBoolean("ambient", this.isAmbient()); nbt.putBoolean("show_particles", this.isVisible()); nbt.putBoolean("show_icon", this.showIcon()); @@ -2282,21 +2278,21 @@ index 68e1b8271475996020af50b3b2cf04cd25aa6c85..4f2fcbcf90d6f5ee89e35c993a65cae6 if (this.hiddenEffect != null) { CompoundTag compoundTag = new CompoundTag(); this.hiddenEffect.save(compoundTag); -@@ -306,6 +357,13 @@ public class MobEffectInstance implements Comparable { +@@ -306,6 +356,13 @@ public class MobEffectInstance implements Comparable { bl3 = nbt.getBoolean("show_icon"); } + // Purpur start -+ NamespacedKey key = null; ++ org.bukkit.NamespacedKey key = null; + if (nbt.contains("key")) { -+ key = NamespacedKey.fromString(nbt.getString("key")); ++ key = org.bukkit.NamespacedKey.fromString(nbt.getString("key")); + } + // Purpur end + MobEffectInstance mobEffectInstance = null; if (nbt.contains("hidden_effect", 10)) { mobEffectInstance = loadSpecifiedEffect(type, nbt.getCompound("hidden_effect")); -@@ -318,7 +376,7 @@ public class MobEffectInstance implements Comparable { +@@ -318,7 +375,7 @@ public class MobEffectInstance implements Comparable { optional = Optional.empty(); } @@ -2360,7 +2356,7 @@ index 1f9e0c139988c4c44a26552881647d36965aa4fa..b8d612d22aca74a08b53393c0723a2ae @Override diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f08743c53 100644 +index e62d19bb841779684bb3a3ffb34f7bb0939303be..61df6e02971a3e2deb63504b35289a77781d34ac 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -157,7 +157,7 @@ import org.bukkit.plugin.PluginManager; @@ -2425,7 +2421,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f this.remainingFireTicks = -this.getFireImmuneTicks(); this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); -@@ -902,10 +921,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -906,10 +925,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void checkBelowWorld() { // Paper start - Configurable nether ceiling damage @@ -2438,7 +2434,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f this.onBelowWorld(); } -@@ -1878,7 +1898,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1882,7 +1902,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.isInWater() || flag; } @@ -2447,7 +2443,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f Entity entity = this.getVehicle(); if (entity instanceof Boat) { -@@ -3028,6 +3048,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3032,6 +3052,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.passengers = ImmutableList.copyOf(list); } @@ -2461,7 +2457,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f this.gameEvent(GameEvent.ENTITY_MOUNT, passenger); } } -@@ -3068,6 +3095,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3072,6 +3099,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return false; } // Spigot end @@ -2476,7 +2472,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f if (this.passengers.size() == 1 && this.passengers.get(0) == entity) { this.passengers = ImmutableList.of(); } else { -@@ -3147,12 +3182,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3151,12 +3186,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return Vec3.directionFromRotation(this.getRotationVector()); } @@ -2493,7 +2489,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f } this.isInsidePortal = true; -@@ -3201,7 +3239,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3205,7 +3243,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } this.processPortalCooldown(); @@ -2502,7 +2498,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f } } -@@ -3391,7 +3429,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3395,7 +3433,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public int getMaxAirSupply() { @@ -2511,7 +2507,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f } public int getAirSupply() { -@@ -3859,7 +3897,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -3863,7 +3901,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean canChangeDimensions() { @@ -2520,7 +2516,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f } public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { -@@ -4162,6 +4200,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4166,6 +4204,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return SlotAccess.NULL; } @@ -2541,7 +2537,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f @Override public void sendSystemMessage(Component message) {} -@@ -4435,6 +4487,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -4446,6 +4498,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.yRotO = this.getYRot(); } @@ -2554,7 +2550,7 @@ index 80f210c04d3ae3a36ff46273b5cb7b4a95408ce3..50267637d752b8216ee81e09945d7b8f public boolean updateFluidHeightAndDoFluidPushing(TagKey tag, double speed) { if (false && this.touchingUnloadedChunk()) { // Gale - Airplane - reduce entity fluid lookups if no fluids - cost of a lookup here is the same cost as below, so skip return false; -@@ -5010,4 +5068,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -5021,4 +5079,45 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this); } // Paper end @@ -2613,7 +2609,7 @@ index 2986c3b1c9dd7f3a00ed7f25b25bfc2b513b35eb..8d199ed2f0b2f50a57f9854cc1400548 private EntitySelector() {} // Paper start diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index a63399eedb896c06e96c7fba5cac7102e1c40ba6..38845300ceb7092de4cd8e31ef8782728892f656 100644 +index cf90ecefea3586d0ce236288ab515bfa67239814..770d74e3c3226306a8f246920798ae72fdafe2c5 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -313,13 +313,24 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -2659,7 +2655,7 @@ index a63399eedb896c06e96c7fba5cac7102e1c40ba6..38845300ceb7092de4cd8e31ef878272 public String getDescriptionId() { if (this.descriptionId == null) { this.descriptionId = Util.makeDescriptionId("entity", BuiltInRegistries.ENTITY_TYPE.getKey(this)); -@@ -596,6 +617,12 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -602,6 +623,12 @@ public class EntityType implements FeatureElement, EntityTypeT entity.load(nbt); }, () -> { EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); @@ -2673,7 +2669,7 @@ index a63399eedb896c06e96c7fba5cac7102e1c40ba6..38845300ceb7092de4cd8e31ef878272 } diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index fb74f13ab2a977224e843a468ea8c72d923a75eb..1b8f5680c4122c7b6b19e2bc1ed6295caa024622 100644 +index 2a689581565bebc01ba354a3564d30327486953d..e594a6f318d34debdf884d4d98b11d53b4b8734a 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java @@ -313,7 +313,7 @@ public class ExperienceOrb extends Entity { @@ -3119,7 +3115,7 @@ index d8b32b29a8fb3cbe1c75af4501fc2d92334b5f22..6ca39830ead96eb18e9b5e637d1ea33c }); } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index c413a191fa8fd1a2447f51f66187f0c18818c222..86e1434a6361fda0d379dd67608752d0a2a30f5e 100644 +index dd657a4e7c0aeb630fffb8ce2d16c54d7fdec0e2..b9f1bfef9f33138c52f800084828bdc805960cab 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -66,6 +66,7 @@ import net.minecraft.world.item.ProjectileWeaponItem; @@ -3262,7 +3258,7 @@ index c413a191fa8fd1a2447f51f66187f0c18818c222..86e1434a6361fda0d379dd67608752d0 return flag; } -@@ -1698,28 +1735,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1702,28 +1739,7 @@ public abstract class Mob extends LivingEntity implements Targeting { // Gale end - JettPack - optimize sun burn tick - cache eye blockpos public boolean isSunBurnTick() { @@ -3292,7 +3288,7 @@ index c413a191fa8fd1a2447f51f66187f0c18818c222..86e1434a6361fda0d379dd67608752d0 } @Override -@@ -1767,4 +1783,56 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1771,4 +1787,56 @@ public abstract class Mob extends LivingEntity implements Targeting { return itemmonsteregg == null ? null : new ItemStack(itemmonsteregg); } @@ -3350,24 +3346,18 @@ index c413a191fa8fd1a2447f51f66187f0c18818c222..86e1434a6361fda0d379dd67608752d0 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/entity/Shearable.java b/src/main/java/net/minecraft/world/entity/Shearable.java -index 5e8cc5cfac8888628c6d513148f41be09ca65a2c..a089fc61ec09be6b7490375489178dc6ba5a644b 100644 +index 4921d1b2ff9112374477c5c9b4a68cc75a51dbf8..7070ed31869855f5dd911fbe95142fa97b2dc45d 100644 --- a/src/main/java/net/minecraft/world/entity/Shearable.java +++ b/src/main/java/net/minecraft/world/entity/Shearable.java -@@ -3,7 +3,13 @@ package net.minecraft.world.entity; - import net.minecraft.sounds.SoundSource; - - public interface Shearable { -- void shear(SoundSource shearedSoundCategory); -+ // Purpur start -+ default void shear(SoundSource shearedSoundCategory) { -+ shear(shearedSoundCategory, 0); -+ } -+ -+ void shear(SoundSource shearedSoundCategory, int looting); -+ // Purpur end +@@ -8,7 +8,7 @@ public interface Shearable { boolean readyForShearing(); - } + // Paper start - ensure all implementing entities override this +- default java.util.List generateDefaultDrops() { ++ default java.util.List generateDefaultDrops(int looting) { // Purpur + return java.util.Collections.emptyList(); + } + // Paper end diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java index c5cdeb3a86453106c092c6f108da23ef54cb8123..635037fb2a44a422b42d7c3c27cc7638c7715635 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java @@ -5207,7 +5197,7 @@ index f383928fc5b331ddf128bdcb6a23010d8fe088d3..64aba511e615983988cdb6a0fd45b7d9 } } diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -index d3982fc50ab87f64893ae5838d0256576912d311..9d949fe12d1100e03cf2454cc7b820971b6e00b5 100644 +index 36cae2cddf9f4acec436338e81576b122d209d89..3d82657a0b9e6d08b0ce7104b6da590d994df345 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java @@ -63,6 +63,43 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder drops = this.generateDefaultDrops(); ++ List drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur + org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); + if (event != null) { + if (event.isCancelled()) { +- return InteractionResult.PASS; ++ return tryRide(player, hand); // Purpur + } + drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops()); } - // CraftBukkit end -- this.shear(SoundSource.PLAYERS); -+ this.shear(SoundSource.PLAYERS, net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur - this.gameEvent(GameEvent.SHEAR, player); - if (!this.level().isClientSide) { - itemstack.hurtAndBreak(1, player, (entityhuman1) -> { -@@ -144,7 +181,7 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder> optional = this.getEffectsFromItemStack(itemstack); if (optional.isEmpty()) { @@ -5276,24 +5267,23 @@ index d3982fc50ab87f64893ae5838d0256576912d311..9d949fe12d1100e03cf2454cc7b82097 } if (!player.getAbilities().instabuild) { -@@ -166,7 +203,7 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder generateDefaultDrops() { ++ public List generateDefaultDrops(int looting) { // Purpur + List dropEntities = new java.util.ArrayList<>(5); +- for (int i = 0; i < 5; ++i) { ++ for (int i = 0; i < 5 + (org.purpurmc.purpur.PurpurConfig.allowShearsLooting ? looting : 0); ++i) { // Purpur + dropEntities.add(new ItemStack(this.getVariant().getBlockState().getBlock())); + } + return dropEntities; diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java index 4300fab61765dd224fab084d118aae7294fc9de6..3c5f25300d1c7800144a459cc8bf598352a62a35 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java @@ -6116,7 +6106,7 @@ index 0af79daa357f53a8871e293b57e16c099e5d3f64..382e47f26ee94506cb76463a677351b9 public int getMaxSchoolSize() { return 5; diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -index ba33c7047c4039691ac4e85400ac305185dcffd4..e466dd389bc031d4eca96bf58dd16ea421dee5bc 100644 +index 865f244de1605303f22d8944174b0fe00115cab0..981429215b01ae1f03735d5ffc584108013b137e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java @@ -119,10 +119,48 @@ public class Sheep extends Animal implements Shearable { @@ -6168,35 +6158,33 @@ index ba33c7047c4039691ac4e85400ac305185dcffd4..e466dd389bc031d4eca96bf58dd16ea4 this.goalSelector.addGoal(1, new PanicGoal(this, 1.25D)); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); this.goalSelector.addGoal(3, new TemptGoal(this, 1.1D, Ingredient.of(Items.WHEAT), false)); -@@ -257,7 +295,7 @@ public class Sheep extends Animal implements Shearable { - return InteractionResult.PASS; - } - // CraftBukkit end -- this.shear(SoundSource.PLAYERS); -+ this.shear(SoundSource.PLAYERS, net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur - this.gameEvent(GameEvent.SHEAR, player); - itemstack.hurtAndBreak(1, player, (entityhuman1) -> { - entityhuman1.broadcastBreakEvent(hand); -@@ -272,14 +310,15 @@ public class Sheep extends Animal implements Shearable { +@@ -254,7 +292,7 @@ public class Sheep extends Animal implements Shearable { + if (!this.level().isClientSide && this.readyForShearing()) { + // CraftBukkit start + // Paper start - custom shear drops +- java.util.List drops = this.generateDefaultDrops(); ++ java.util.List drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur + org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); + if (event != null) { + if (event.isCancelled()) { +@@ -281,12 +319,13 @@ public class Sheep extends Animal implements Shearable { + @Override + public void shear(SoundSource shearedSoundCategory) { + // Paper start - custom shear drops +- this.shear(shearedSoundCategory, this.generateDefaultDrops()); ++ this.shear(shearedSoundCategory, this.generateDefaultDrops(0)); // Purpur } @Override -- public void shear(SoundSource shearedSoundCategory) { -+ public void shear(SoundSource shearedSoundCategory, int looting) { // Purpur - this.level().playSound((Player) null, (Entity) this, SoundEvents.SHEEP_SHEAR, shearedSoundCategory, 1.0F, 1.0F); - this.setSheared(true); - int i = 1 + this.random.nextInt(3); -+ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting) i += looting; // Purpur - - for (int j = 0; j < i; ++j) { - this.forceDrops = true; // CraftBukkit -- ItemEntity entityitem = this.spawnAtLocation((ItemLike) Sheep.ITEM_BY_DYE.get(this.getColor()), 1); -+ ItemEntity entityitem = this.spawnAtLocation((ItemLike) Sheep.ITEM_BY_DYE.get(this.level().purpurConfig.sheepShearJebRandomColor && hasCustomName() && getCustomName().getString().equals("jeb_") ? DyeColor.random(this.level().random) : this.getColor()), 1); // Purpur - this.forceDrops = false; // CraftBukkit - - if (entityitem != null) { +- public java.util.List generateDefaultDrops() { ++ public java.util.List generateDefaultDrops(int looting) { // Purpur + int count = 1 + this.random.nextInt(3); ++ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting) count += looting; // Purpur + java.util.List dropEntities = new java.util.ArrayList<>(count); + for (int j = 0; j < count; ++j) { + dropEntities.add(new ItemStack(Sheep.ITEM_BY_DYE.get(this.getColor()))); diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -index 8adcfc8f6772a32b5915e4a07100e8eb735f907a..8b364fe9f3a3d47ae6daa331b8f16941ca17432a 100644 +index b5d6857eaf2bed14adcb5f5e80d91b44eb8b0dcc..64b83f6ece3ff50fea11e2b500840bb0e970db37 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java @@ -49,17 +49,56 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM @@ -6293,20 +6281,21 @@ index 8adcfc8f6772a32b5915e4a07100e8eb735f907a..8b364fe9f3a3d47ae6daa331b8f16941 BlockState iblockdata = Blocks.SNOW.defaultBlockState(); for (int i = 0; i < 4; ++i) { -@@ -154,10 +196,10 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -154,11 +196,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { // CraftBukkit start - if (!CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand)) { -- return InteractionResult.PASS; -+ return tryRide(player, hand); // Purpur + // Paper start - custom shear drops +- java.util.List drops = this.generateDefaultDrops(); ++ java.util.List drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur + org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); + if (event != null) { + if (event.isCancelled()) { +- return InteractionResult.PASS; ++ return tryRide(player, hand); // Purpur + } + drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops()); } - // CraftBukkit end -- this.shear(SoundSource.PLAYERS); -+ this.shear(SoundSource.PLAYERS, net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur - this.gameEvent(GameEvent.SHEAR, player); - if (!this.level().isClientSide) { - itemstack.hurtAndBreak(1, player, (entityhuman1) -> { -@@ -166,17 +208,27 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -173,19 +215,36 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM } return InteractionResult.sidedSuccess(this.level().isClientSide); @@ -6325,17 +6314,27 @@ index 8adcfc8f6772a32b5915e4a07100e8eb735f907a..8b364fe9f3a3d47ae6daa331b8f16941 } @Override -- public void shear(SoundSource shearedSoundCategory) { -+ public void shear(SoundSource shearedSoundCategory, int looting) { // Purpur - this.level().playSound((Player) null, (Entity) this, SoundEvents.SNOW_GOLEM_SHEAR, shearedSoundCategory, 1.0F, 1.0F); - if (!this.level().isClientSide()) { - this.setPumpkin(false); - this.forceDrops = true; // CraftBukkit -+ if (level().purpurConfig.snowGolemDropsPumpkin) // Purpur -+ for (int i = 0; i < 1 + (org.purpurmc.purpur.PurpurConfig.allowShearsLooting ? looting : 0); i++) // Purpur - this.spawnAtLocation(new ItemStack(Items.CARVED_PUMPKIN), 1.7F); - this.forceDrops = false; // CraftBukkit - } + public void shear(SoundSource shearedSoundCategory) { + // Paper start - custom shear drops +- this.shear(shearedSoundCategory, this.generateDefaultDrops()); ++ this.shear(shearedSoundCategory, this.generateDefaultDrops(0)); // Purpur + } + + @Override +- public java.util.List generateDefaultDrops() { ++ // Purpur start ++ public java.util.List generateDefaultDrops(int looting) { ++ if (org.purpurmc.purpur.PurpurConfig.allowShearsLooting) { ++ java.util.ArrayList list = new java.util.ArrayList<>(); ++ for (int i = 0; i < 1 + looting; i++) { ++ list.add(new ItemStack(Items.CARVED_PUMPKIN)); ++ } ++ return java.util.Collections.unmodifiableList(list); ++ } ++ // Purpur end + return java.util.Collections.singletonList(new ItemStack(Items.CARVED_PUMPKIN)); + } + diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java index f60c4cd0543fd5d50fa7e2c1a9e8381227adb540..dd7f2beabf0edad4143ac2365ac04a22edf1f75e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java @@ -8037,7 +8036,7 @@ index ffc5b68c4246a7111845230a75552bb15875a209..440add62fcfa62d483409e1aecfc9159 this.onDestroyedBy(source); diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index f56bb431be7d5f1a1b8edec41af1f3a28289316d..dc7804371b65c43367ec87e79433106e8a11a6ff 100644 +index e5b4aaa9e08dbafa46c92e3fce8b2ee9b0167530..aa10cd2e0ee7b0d421c223de390e671d401f87fc 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -107,6 +107,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -8218,7 +8217,7 @@ index f56bb431be7d5f1a1b8edec41af1f3a28289316d..dc7804371b65c43367ec87e79433106e short0 = 12000; } -@@ -1102,6 +1188,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1103,6 +1189,7 @@ public class EnderDragon extends Mob implements Enemy { @Override protected boolean canRide(Entity entity) { @@ -8227,7 +8226,7 @@ index f56bb431be7d5f1a1b8edec41af1f3a28289316d..dc7804371b65c43367ec87e79433106e } diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26016c419a 100644 +index c59e44c45d9c8c719b34e85fb3b753ac3788842d..1c53933c372e70ff95ef12c78421cc895452ba1c 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -84,20 +84,59 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -8447,7 +8446,7 @@ index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26 // CraftBukkit start - Use relative location for far away sounds // this.level().globalLevelEvent(1023, new BlockPosition(this), 0); int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16; -@@ -296,7 +447,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -297,7 +448,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob this.setInvulnerableTicks(i); if (this.tickCount % 10 == 0) { @@ -8456,7 +8455,7 @@ index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26 } } else { -@@ -356,7 +507,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -357,7 +508,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob if (this.destroyBlocksTick > 0) { --this.destroyBlocksTick; @@ -8465,7 +8464,7 @@ index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26 i = Mth.floor(this.getY()); j = Mth.floor(this.getX()); int i1 = Mth.floor(this.getZ()); -@@ -389,8 +540,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -390,8 +541,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob } } @@ -8478,7 +8477,7 @@ index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26 } this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth()); -@@ -576,11 +729,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -577,11 +730,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob } public int getAlternativeTarget(int headIndex) { @@ -8492,7 +8491,7 @@ index c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd..8f8a3e03eec72cd48b10649778ec2f26 } @Override -@@ -595,6 +748,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -596,6 +749,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override protected boolean canRide(Entity entity) { @@ -12764,7 +12763,7 @@ index 8385eb1d60f377da94e3178ab506feefb43563fd..a5443f92786427c42092aec8350e7ab3 if (NaturalSpawner.isSpawnPositionOk(SpawnPlacements.Type.ON_GROUND, world, blockposition2, EntityType.WANDERING_TRADER)) { blockposition1 = blockposition2; diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 13130eb5d54bff689391855c153f3b2359200794..03d263d7ac7e665fb6bf6b258796426ce2c4827c 100644 +index e739edbdd3d88f3b75ba15d4a8e19feac5163c7f..b0aa6482936338b5102efaaae682e8b26dc4ede6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -186,11 +186,21 @@ public abstract class Player extends LivingEntity { @@ -12866,7 +12865,7 @@ index 13130eb5d54bff689391855c153f3b2359200794..03d263d7ac7e665fb6bf6b258796426c } f += f1; -@@ -1913,9 +1952,19 @@ public abstract class Player extends LivingEntity { +@@ -1929,9 +1968,19 @@ public abstract class Player extends LivingEntity { @Override public int getExperienceReward() { if (!this.level().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) && !this.isSpectator()) { @@ -12889,7 +12888,7 @@ index 13130eb5d54bff689391855c153f3b2359200794..03d263d7ac7e665fb6bf6b258796426c } else { return 0; } -@@ -1991,6 +2040,11 @@ public abstract class Player extends LivingEntity { +@@ -2007,6 +2056,11 @@ public abstract class Player extends LivingEntity { return this.inventory.armor; } @@ -12901,7 +12900,7 @@ index 13130eb5d54bff689391855c153f3b2359200794..03d263d7ac7e665fb6bf6b258796426c public boolean setEntityOnShoulder(CompoundTag entityNbt) { if (!this.isPassenger() && this.onGround() && !this.isInWater() && !this.isInPowderSnow) { if (this.getShoulderEntityLeft().isEmpty()) { -@@ -2271,7 +2325,7 @@ public abstract class Player extends LivingEntity { +@@ -2287,7 +2341,7 @@ public abstract class Player extends LivingEntity { public ItemStack eat(Level world, ItemStack stack) { this.getFoodData().eat(stack.getItem(), stack); this.awardStat(Stats.ITEM_USED.get(stack.getItem())); @@ -12910,7 +12909,7 @@ index 13130eb5d54bff689391855c153f3b2359200794..03d263d7ac7e665fb6bf6b258796426c if (this instanceof ServerPlayer) { CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) this, stack); } -@@ -2365,6 +2419,7 @@ public abstract class Player extends LivingEntity { +@@ -2381,6 +2435,7 @@ public abstract class Player extends LivingEntity { } public static boolean isValidUsername(String name) { @@ -12931,7 +12930,7 @@ index 26b236a764177ac16d53f5cbaf83d3e21d015ebc..90b92aeeb893146a2036f4ad21bf3b08 public static int getStackingIndex(ItemStack stack) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 267284a45e710a230c1f1a68db398a39bcd9a644..a325f8ac43a9a80684774a4c3e44fbdddd650aed 100644 +index d5dbd53225f036e910253416901674ac14f51791..4ec4950cb3413a22dba8453acd6ec709375e3617 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -74,6 +74,7 @@ public abstract class AbstractArrow extends Projectile { @@ -14270,7 +14269,7 @@ index 180aec596110309aade13d2080f8824d152b07cb..552c31c0f3746dd35388395036e70a92 return InteractionResult.PASS; } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 3c4919412fd995a6f00abe912e138b726392b88a..469d8ba7effb92cb9c6bfbc329daaec3e3fcea18 100644 +index 6bffea8048195472433402cc3a0749677ef4bd02..e68315c19bce1d78a60847db2397750b39cd6906 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -453,6 +453,7 @@ public final class ItemStack { @@ -14731,7 +14730,7 @@ index 4f7457578ab3118d10e0d5dfc23d79c9b20c2f44..e03ce53b93d1b9366f2a7f14f341750a public ItemStack assemble() { diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index d88a23984dcea9c2119bdc245013af8b25448da3..075b4ac21707bd0b3ad2197c59359f8d33bae486 100644 +index 3aa4cb526f04a171ace0b95d18ecebc9a002470a..ac6bdf21d5ff8ba563f8c9187f6a8dcc823587aa 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -57,6 +57,7 @@ public abstract class BaseSpawner { @@ -14798,7 +14797,7 @@ index ee76770b4f0cfadd2f7953c1328a2b6144379742..7bd894f302df5d900b15f2573305ae50 Set set = Sets.newHashSet(); boolean flag = true; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 1bb82901903570ad8beb059110661d28b45dbacd..41c59c0828e0b6919e029f831ed22b305b2be470 100644 +index 8b7dbd6bbd848c0cfb30fd91c600432d9dfc0fbf..8b41f27fccf31646e780966d2da7e4c4f5419710 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -178,6 +178,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -14868,7 +14867,7 @@ index 1bb82901903570ad8beb059110661d28b45dbacd..41c59c0828e0b6919e029f831ed22b30 this.generator = gen; this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); -@@ -1903,4 +1949,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1920,4 +1966,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } } // Paper end - notify observers even if grow failed @@ -15037,7 +15036,7 @@ index 8e4a6a1188b2ce2825dc5750505212c72efb5c7b..c7f78ccb228d261984ac360f2ca6ae94 if (i != -1) { world.scheduleTick(blockposition, (Block) this, i); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 2ccfb0456cbc42e79bbab49f0c01443ce1560d3a..27879468851875f9d9e7eb28f47ad36d36fd7475 100644 +index b424ba1e6e2735d1acb5e77c2cd4ff3fa03f294d..1e0a8f38b88557ef8c5d1f194dca21ba0fb1226b 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -63,6 +63,13 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -15074,23 +15073,23 @@ index 2ccfb0456cbc42e79bbab49f0c01443ce1560d3a..27879468851875f9d9e7eb28f47ad36d }); state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true); } -@@ -336,7 +347,7 @@ public class Block extends BlockBehaviour implements ItemLike { - io.papermc.paper.event.block.BlockBreakBlockEvent event = new io.papermc.paper.event.block.BlockBreakBlockEvent(org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.block.CraftBlock.at(world, source), items); +@@ -338,7 +349,7 @@ public class Block extends BlockBehaviour implements ItemLike { + event.setExpToDrop(block.getExpDrop(state, (ServerLevel) world, pos, net.minecraft.world.item.ItemStack.EMPTY, true)); event.callEvent(); for (var drop : event.getDrops()) { - popResource(world.getMinecraftWorld(), pos, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(drop)); + popResource(world.getMinecraftWorld(), pos, applyDisplayNameAndLoreFromTile(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(drop), blockEntity)); // Purpur } - state.spawnAfterBreak(world.getMinecraftWorld(), pos, ItemStack.EMPTY, true); - } -@@ -347,13 +358,53 @@ public class Block extends BlockBehaviour implements ItemLike { - public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool) { + state.spawnAfterBreak(world.getMinecraftWorld(), pos, ItemStack.EMPTY, false); + block.popExperience((ServerLevel) world, pos, event.getExpToDrop()); +@@ -355,13 +366,53 @@ public class Block extends BlockBehaviour implements ItemLike { + // Paper end if (world instanceof ServerLevel) { Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> { - Block.popResource(world, pos, itemstack1); + Block.popResource(world, pos, applyDisplayNameAndLoreFromTile(itemstack1, blockEntity)); // Purpur }); - state.spawnAfterBreak((ServerLevel) world, pos, tool, true); + state.spawnAfterBreak((ServerLevel) world, pos, tool, dropExperience); // Paper } } @@ -15138,7 +15137,7 @@ index 2ccfb0456cbc42e79bbab49f0c01443ce1560d3a..27879468851875f9d9e7eb28f47ad36d public static void popResource(Level world, BlockPos pos, ItemStack stack) { double d0 = (double) EntityType.ITEM.getHeight() / 2.0D; double d1 = (double) pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); -@@ -437,7 +488,17 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -445,7 +496,17 @@ public class Block extends BlockBehaviour implements ItemLike { } // Paper } @@ -15157,7 +15156,7 @@ index 2ccfb0456cbc42e79bbab49f0c01443ce1560d3a..27879468851875f9d9e7eb28f47ad36d public boolean isPossibleToRespawnInThis(BlockState state) { return !state.isSolid() && !state.liquid(); -@@ -456,7 +517,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -464,7 +525,7 @@ public class Block extends BlockBehaviour implements ItemLike { } public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { @@ -15467,7 +15466,7 @@ index 8fd8285e07de4a0457da507501e49a807542f3b1..e580c5a141bebdc45893b5abde01e633 int i = aenumdirection.length; diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java -index 9550ce8588c6aa3ba4cbbbb86912eae2b452eb01..32b121fc8b92ce6ff202b967b7d08f77a9a332f4 100644 +index 9550ce8588c6aa3ba4cbbbb86912eae2b452eb01..2dbfc522990964b2ae5a9e5f84426e0749f92563 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java @@ -179,7 +179,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @@ -15486,11 +15485,11 @@ index 9550ce8588c6aa3ba4cbbbb86912eae2b452eb01..32b121fc8b92ce6ff202b967b7d08f77 + + // Purpur start + @Override -+ public void playerDestroy(Level world, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, @javax.annotation.Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, ItemStack itemInHand, boolean includeDrops) { ++ public void playerDestroy(Level world, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, @javax.annotation.Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, ItemStack itemInHand, boolean includeDrops, boolean dropExp) { + if (world.purpurConfig.hoeReplantsCrops && itemInHand.getItem() instanceof net.minecraft.world.item.HoeItem) { + super.playerDestroyAndReplant(world, player, pos, state, blockEntity, itemInHand, getBaseSeedId()); + } else { -+ super.playerDestroy(world, player, pos, state, blockEntity, itemInHand, includeDrops); ++ super.playerDestroy(world, player, pos, state, blockEntity, itemInHand, includeDrops, dropExp); + } + } + // Purpur end @@ -15776,7 +15775,7 @@ index ef364aa171a48482a45bc18cfe730ec20c3f7be6..74971d90506aa253d5ee821b5390fb25 } } diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java -index 4ab6997dad5b112f5105f786a6cee78c6c5667e8..bbf19716d84a0d7e71a11559ef4f62590f2f367c 100644 +index 9ebe74e235d425fde985a6180857dc4039ecfedf..2c21888c477b93f38adaf18abe62732b08e1c9c2 100644 --- a/src/main/java/net/minecraft/world/level/block/IceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java @@ -41,7 +41,7 @@ public class IceBlock extends HalfTransparentBlock { @@ -15886,7 +15885,7 @@ index ee998d06804e344ea9d5b84ef0074b84aaba04c2..673dd5cc5c83eb606aa5684b8ae14b82 EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ())); world.getCraftServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java -index 0fc333f240d6918e841a9221be42973839408802..9e47da91a5daed92b7326c84a88e619d2d981dd0 100644 +index 0fc333f240d6918e841a9221be42973839408802..13eb4dffd60ea7902d620f484df5e3f2c4688402 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty; @@ -15905,11 +15904,11 @@ index 0fc333f240d6918e841a9221be42973839408802..9e47da91a5daed92b7326c84a88e619d + + // Purpur start + @Override -+ public void playerDestroy(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, @javax.annotation.Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, ItemStack itemInHand, boolean includeDrops) { ++ public void playerDestroy(net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, @javax.annotation.Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity, ItemStack itemInHand, boolean includeDrops, boolean dropExp) { + if (world.purpurConfig.hoeReplantsNetherWarts && itemInHand.getItem() instanceof net.minecraft.world.item.HoeItem) { + super.playerDestroyAndReplant(world, player, pos, state, blockEntity, itemInHand, Items.NETHER_WART); + } else { -+ super.playerDestroy(world, player, pos, state, blockEntity, itemInHand, includeDrops); ++ super.playerDestroy(world, player, pos, state, blockEntity, itemInHand, includeDrops, dropExp); + } + } + @@ -16085,16 +16084,16 @@ index a3da9536c3a3ad33d1c795673bdd7b05d6534054..9b057f3967aae5d0ca621b19d1212db9 } diff --git a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java -index e8b1c44da90f60cde20cda65aba2aa1e30f89d25..c2e03881fff78aff203b5838180894bb70f419b9 100644 +index e8b1c44da90f60cde20cda65aba2aa1e30f89d25..1ac38424a44aa2225b9bd3fa0fbbe61b7b24875c 100644 --- a/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpawnerBlock.java -@@ -42,6 +42,58 @@ public class SpawnerBlock extends BaseEntityBlock { +@@ -42,6 +42,60 @@ public class SpawnerBlock extends BaseEntityBlock { return createTickerHelper(type, BlockEntityType.MOB_SPAWNER, world.isClientSide ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick); } + // Purpur start + @Override -+ public void playerDestroy(Level level, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack stack, boolean includeDrops) { ++ public void playerDestroy(Level level, net.minecraft.world.entity.player.Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack, boolean includeDrops, boolean dropExp) { + if (level.purpurConfig.silkTouchEnabled && player.getBukkitEntity().hasPermission("purpur.drop.spawners") && isSilkTouch(level, stack)) { + java.util.Optional> type = net.minecraft.world.entity.EntityType.by(((SpawnerBlockEntity) blockEntity).getSpawner().nextSpawnData.getEntityToSpawn()); + @@ -16102,6 +16101,9 @@ index e8b1c44da90f60cde20cda65aba2aa1e30f89d25..c2e03881fff78aff203b5838180894bb + final net.kyori.adventure.text.Component mobName = io.papermc.paper.adventure.PaperAdventure.asAdventure(entityType == null ? Component.empty() : entityType.getDescription()); + net.minecraft.nbt.CompoundTag display = new net.minecraft.nbt.CompoundTag(); + net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag(); ++ net.minecraft.nbt.CompoundTag blockEntityTag = blockEntity.getUpdateTag(); ++ blockEntityTag.remove("Delay"); // remove this tag to allow stacking duplicate spawners ++ tag.put("BlockEntityTag", blockEntityTag); + + String name = level.purpurConfig.silkTouchSpawnerName; + if (name != null && !name.isEmpty() && !name.equals("Monster Spawner")) { @@ -16129,14 +16131,13 @@ index e8b1c44da90f60cde20cda65aba2aa1e30f89d25..c2e03881fff78aff203b5838180894bb + + ItemStack item = new ItemStack(Blocks.SPAWNER.asItem()); + if (entityType != null) { -+ tag.putString("Purpur.mob_type", entityType.getName()); -+ tag.putDouble("HideFlags", 32); // hides the "Interact with Spawn Egg" tooltip ++ tag.putDouble("HideFlags", ItemStack.TooltipPart.ADDITIONAL.getMask()); // hides the "Interact with Spawn Egg" tooltip + item.setTag(tag); + } + + popResource(level, pos, item); + } -+ super.playerDestroy(level, player, pos, state, blockEntity, stack, includeDrops); ++ super.playerDestroy(level, player, pos, state, blockEntity, stack, includeDrops, dropExp); + } + + private boolean isSilkTouch(Level level, ItemStack stack) { @@ -16147,7 +16148,7 @@ index e8b1c44da90f60cde20cda65aba2aa1e30f89d25..c2e03881fff78aff203b5838180894bb @Override public void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) { super.spawnAfterBreak(state, world, pos, tool, dropExperience); -@@ -50,6 +102,7 @@ public class SpawnerBlock extends BaseEntityBlock { +@@ -50,6 +104,7 @@ public class SpawnerBlock extends BaseEntityBlock { @Override public int getExpDrop(BlockState iblockdata, ServerLevel worldserver, BlockPos blockposition, ItemStack itemstack, boolean flag) { @@ -16258,7 +16259,7 @@ index ceaec1776067b7635c3952025f00f13f4ea86c88..8b6c43b0a2fb4b89d6f63716e56074ef + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -index b0199e071cba4c7ad51799132d00b22b616953fc..2c0dcfc916f0845dc830a7ac9ffc828df20f27d0 100644 +index 5c0127ecbbafd406f450f8707c4563bfea7a0214..777ba7b3dfbb8cee8b782490101127271f7320d2 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java @@ -169,7 +169,7 @@ public class TurtleEggBlock extends Block { @@ -16913,7 +16914,7 @@ index 744d91546d1a810f60a43c15ed74b4158f341a4a..354538daefa603f6df5a139b6bff87db } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index 3ab8b99837b1d1faea722c598b0228b2780be8b1..0b6ab25fb59a7dd713a0fa9063f8590cad8414de 100644 +index 401f1b418a4f57059e991cc958ebadb31239a581..6aebdd936728be10b5cbf0a71fd9a2a66596afc0 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -85,7 +85,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -17940,7 +17941,7 @@ index 0ad16ee7b33582d214dab41eeee378d52c8e38ed..16bd1294c219f15ada653ef810bc2d74 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c54df6e4aed9b7b46a41af4108a8e90d96c1fe1f..df4f39d38f1ff4a5e499e227d93d98f531a01419 100644 +index da63b4050be25dcb91d04df8c2fcc643cbb0751d..8c90eddd40c8ab2f4d727e3c7d9b6312d57bf277 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -524,10 +524,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -17971,7 +17972,7 @@ index c54df6e4aed9b7b46a41af4108a8e90d96c1fe1f..df4f39d38f1ff4a5e499e227d93d98f5 return false; } -@@ -2590,6 +2599,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2637,6 +2646,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().getAbilities().walkingSpeed * 2f; } @@ -18000,7 +18001,7 @@ index c54df6e4aed9b7b46a41af4108a8e90d96c1fe1f..df4f39d38f1ff4a5e499e227d93d98f5 private void validateSpeed(float value) { Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value); } -@@ -3326,4 +3357,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3373,4 +3404,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.spigot; } // Spigot end @@ -18153,7 +18154,7 @@ index 38b6d2c377800134de592a780b737b45c8096a11..449acd9dc983be1cd51208bc8f8d843d + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f67ec3f5f4b7e2f678609f2387cc8afa2adce161..51ed919b56ded23309be1093280a92331c090780 100644 +index 2aab68bac670dcd134d817940020214c7b0797f9..11dacda7c56c1819adc0c5a420b277c8e0db0aeb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -591,6 +591,15 @@ public class CraftEventFactory { @@ -18222,7 +18223,7 @@ index 977b77547f7ba62cef3640cf8d4f1c8e7cded53a..beae43e9b6fe447e7515d878ac175f46 case DISPENSER: case DROPPER: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 3b0d3e9a067fccb10122c273aaf658ba240aa716..9b7fd460d3393e07970c66fec7f35a918675cd58 100644 +index af1ae3dacb628da23f7d2988c6e76d3fb2d64103..4ee2d501f882279b48edb4b8bf0824587c276bf6 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -84,7 +84,7 @@ public class CraftInventory implements Inventory { @@ -18372,24 +18373,24 @@ index 15e9dd8844f893de5e8372b847c9e8295d6f69ca..b4b105c0190502328d5aeb680dd8e67c + // Purpur - end } diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -index 844fb8c662a409670f631228f687d85c5436d3dd..2bfa5908f1848702ceb42da7576a609d0928eddd 100644 +index e938255fcc5db0c289d3e132175a541187e4a748..f7a747ea73a80c97d863e0fd3772a0c333aef3c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -@@ -73,7 +73,7 @@ public class CraftPotionUtil { - +@@ -74,7 +74,7 @@ public class CraftPotionUtil { public static MobEffectInstance fromBukkit(PotionEffect effect) { MobEffect type = CraftPotionEffectType.bukkitToMinecraft(effect.getType()); + // Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over. - return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper + return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon(), effect.getKey()); // Paper // Purpur - add key } public static PotionEffect toBukkit(MobEffectInstance effect) { -@@ -82,7 +82,7 @@ public class CraftPotionUtil { +@@ -83,7 +83,7 @@ public class CraftPotionUtil { int duration = effect.getDuration(); boolean ambient = effect.isAmbient(); boolean particles = effect.isVisible(); -- return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon()); // Paper -+ return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.getKey()); // Paper // Purpur - add key +- return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect)); // Paper ++ return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect), effect.getKey()); // Paper // Purpur - add key } public static boolean equals(MobEffect mobEffect, PotionEffectType type) { @@ -19058,10 +19059,10 @@ index 0000000000000000000000000000000000000000..b12437a7e292fbf9aefc7a41b5bc1695 +} diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..ff9efaa4455e1030e54aab46bc7bfd2f390793c6 +index 0000000000000000000000000000000000000000..9d10d7f4b71026d79d469f82d09c77f84dafd604 --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -@@ -0,0 +1,3292 @@ +@@ -0,0 +1,3288 @@ +package org.purpurmc.purpur; + +import net.minecraft.core.registries.BuiltInRegistries; @@ -21524,7 +21525,6 @@ index 0000000000000000000000000000000000000000..ff9efaa4455e1030e54aab46bc7bfd2f + public boolean sheepBypassMobGriefing = false; + public boolean sheepTakeDamageFromWater = false; + public boolean sheepAlwaysDropExp = false; -+ public boolean sheepShearJebRandomColor = false; + private void sheepSettings() { + sheepRidable = getBoolean("mobs.sheep.ridable", sheepRidable); + sheepRidableInWater = getBoolean("mobs.sheep.ridable-in-water", sheepRidableInWater); @@ -21539,7 +21539,6 @@ index 0000000000000000000000000000000000000000..ff9efaa4455e1030e54aab46bc7bfd2f + sheepBypassMobGriefing = getBoolean("mobs.sheep.bypass-mob-griefing", sheepBypassMobGriefing); + sheepTakeDamageFromWater = getBoolean("mobs.sheep.takes-damage-from-water", sheepTakeDamageFromWater); + sheepAlwaysDropExp = getBoolean("mobs.sheep.always-drop-exp", sheepAlwaysDropExp); -+ sheepShearJebRandomColor = getBoolean("mobs.sheep.jeb-shear-random-color", sheepShearJebRandomColor); + } + + public boolean shulkerRidable = false; @@ -21696,7 +21695,6 @@ index 0000000000000000000000000000000000000000..ff9efaa4455e1030e54aab46bc7bfd2f + public boolean snowGolemControllable = true; + public boolean snowGolemLeaveTrailWhenRidden = false; + public double snowGolemMaxHealth = 4.0D; -+ public boolean snowGolemDropsPumpkin = true; + public boolean snowGolemPutPumpkinBack = false; + public int snowGolemSnowBallMin = 20; + public int snowGolemSnowBallMax = 20; @@ -21716,7 +21714,6 @@ index 0000000000000000000000000000000000000000..ff9efaa4455e1030e54aab46bc7bfd2f + set("mobs.snow_golem.attributes.max_health", oldValue); + } + snowGolemMaxHealth = getDouble("mobs.snow_golem.attributes.max_health", snowGolemMaxHealth); -+ snowGolemDropsPumpkin = getBoolean("mobs.snow_golem.drop-pumpkin-when-sheared", snowGolemDropsPumpkin); + snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack); + snowGolemSnowBallMin = getInt("mobs.snow_golem.min-shoot-interval-ticks", snowGolemSnowBallMin); + snowGolemSnowBallMax = getInt("mobs.snow_golem.max-shoot-interval-ticks", snowGolemSnowBallMax); @@ -23850,10 +23847,10 @@ index 0000000000000000000000000000000000000000..7f526883495b3222746de3d0442e9e4f +} diff --git a/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java b/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java new file mode 100644 -index 0000000000000000000000000000000000000000..c038fb2bbb0f0e78380bc24bbd6348b869669a90 +index 0000000000000000000000000000000000000000..d6cc7e434cb2bacc00e4cad9e1f4be7fcf5d0bee --- /dev/null +++ b/src/main/java/org/purpurmc/purpur/item/SpawnerItem.java -@@ -0,0 +1,36 @@ +@@ -0,0 +1,38 @@ +package org.purpurmc.purpur.item; + +import net.minecraft.core.BlockPos; @@ -23884,6 +23881,8 @@ index 0000000000000000000000000000000000000000..c038fb2bbb0f0e78380bc24bbd6348b8 + if (tag.contains("Purpur.mob_type")) { + EntityType.byString(tag.getString("Purpur.mob_type")).ifPresent(type -> + ((SpawnerBlockEntity) spawner).getSpawner().setEntityId(type, level, level.random, pos)); ++ } else if (tag.contains("BlockEntityTag")) { ++ spawner.load(tag.getCompound("BlockEntityTag")); + } + } + } @@ -24619,7 +24618,7 @@ index 0000000000000000000000000000000000000000..b7586f494528f30eb0da82420d3bcf5b + } +} diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 4295d8257616628727e7dc4aaf6d20b7eb18dc76..62514cc02d0b210283e7999a6f34976355d1b2d9 100644 +index 1275d4ecc7c2dca1d82b2da883717ef7561d520d..c3a2e0c9b7a5f2ad55b3d8c971d280a0795ff63a 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -15,6 +15,7 @@ import net.minecraft.world.entity.ambient.AmbientCreature; diff --git a/patches/server/0010-Purpur-Configurable-server-mod-name.patch b/patches/server/0010-Purpur-Configurable-server-mod-name.patch index 94162ac2..d165e42d 100644 --- a/patches/server/0010-Purpur-Configurable-server-mod-name.patch +++ b/patches/server/0010-Purpur-Configurable-server-mod-name.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Purpur: Configurable server mod name diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7418860e8d25d6eeab33a617a7365c608e1454d2..176f10372a0060fbd2733a6713eb3979a8f4652e 100644 +index fe3ad5d2acec094e9f363acb418233a2756fd0c3..a58b37b576888f865259e647fb30624fa99361bd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1858,7 +1858,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable -@@ -963,7 +961,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick -@@ -1414,8 +1411,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { entityplayer.connection.suspendFlushing(); }); @@ -1037,7 +1037,7 @@ index 176f10372a0060fbd2733a6713eb3979a8f4652e..138935ffe2f7852e8aa30a5fdea2d4ca // Paper start - Folia scheduler API ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); getAllLevels().forEach(level -> { -@@ -1663,20 +1646,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Purpur -@@ -1716,14 +1693,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { entity.activatedPriorityReset = false; // Pufferfish - DAB if (!entity.isRemoved()) { -@@ -937,8 +926,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -942,8 +931,6 @@ public class ServerLevel extends Level implements WorldGenLevel { } } }); @@ -1411,7 +1411,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 this.tickBlockEntities(); } -@@ -1072,7 +1059,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1077,7 +1064,6 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // Paper @@ -1419,7 +1419,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 if (randomTickSpeed > 0) { // Paper start - optimize random block ticking LevelChunkSection[] sections = chunk.getSections(); -@@ -1105,8 +1091,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1110,8 +1096,6 @@ public class ServerLevel extends Level implements WorldGenLevel { } } // Paper end - optimise random block ticking @@ -1428,7 +1428,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 } @VisibleForTesting -@@ -1436,31 +1420,21 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1441,31 +1425,21 @@ public class ServerLevel extends Level implements WorldGenLevel { currentlyTickingEntity.lazySet(entity); } // Paper end - log detailed entity tick information @@ -1460,7 +1460,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 Iterator iterator = entity.getPassengers().iterator(); while (iterator.hasNext()) { -@@ -1468,7 +1442,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1473,7 +1447,6 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(entity, entity1); } @@ -1468,7 +1468,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 // Paper start - log detailed entity tick information } finally { if (currentlyTickingEntity.get() == entity) { -@@ -1483,9 +1456,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1488,9 +1461,6 @@ public class ServerLevel extends Level implements WorldGenLevel { if (passenger instanceof Player || this.entityTickList.contains(passenger)) { // Paper - EAR 2 final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger); @@ -1478,7 +1478,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 passenger.setOldPosAndRot(); ++passenger.tickCount; // Paper start - EAR 2 -@@ -1506,8 +1476,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1511,8 +1481,6 @@ public class ServerLevel extends Level implements WorldGenLevel { this.tickPassenger(passenger, entity2); } @@ -1487,7 +1487,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 } } else { passenger.stopRiding(); -@@ -1527,14 +1495,11 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1532,14 +1500,11 @@ public class ServerLevel extends Level implements WorldGenLevel { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); } @@ -1502,7 +1502,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 // Copied from save() // CraftBukkit start - moved from MinecraftServer.saveChunks -@@ -1546,7 +1511,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1551,7 +1516,6 @@ public class ServerLevel extends Level implements WorldGenLevel { this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData()); } // CraftBukkit end @@ -1510,7 +1510,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 } // Paper end -@@ -1560,7 +1524,6 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1565,7 +1529,6 @@ public class ServerLevel extends Level implements WorldGenLevel { if (!savingDisabled) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit @@ -1518,7 +1518,7 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 if (progressListener != null) { progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); } -@@ -1570,11 +1533,8 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1575,11 +1538,8 @@ public class ServerLevel extends Level implements WorldGenLevel { progressListener.progressStage(Component.translatable("menu.savingChunks")); } @@ -1531,10 +1531,10 @@ index dd677f1981abd5aaaf9c1ec79dbde1766f70ce84..22c9353264da69591a748773e5dd0ea4 } else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ca8db3c11a6a794b23f760b7aaee69290752043f..add52c6986866c42d73c51fa8390d62a4a9d5594 100644 +index c8d91ce1364421f7ce307aef5a4dbfa6f5b75369..c74a9e5f2d92daa36265985e4f6ef7e0e6df4484 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2481,7 +2481,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2487,7 +2487,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl public void handleCommand(String s) { // Paper - private -> public org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher @@ -1542,7 +1542,7 @@ index ca8db3c11a6a794b23f760b7aaee69290752043f..add52c6986866c42d73c51fa8390d62a if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2491,7 +2490,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2497,7 +2496,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1550,7 +1550,7 @@ index ca8db3c11a6a794b23f760b7aaee69290752043f..add52c6986866c42d73c51fa8390d62a return; } -@@ -2503,8 +2501,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2509,8 +2507,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; @@ -1560,7 +1560,7 @@ index ca8db3c11a6a794b23f760b7aaee69290752043f..add52c6986866c42d73c51fa8390d62a } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a0cca8f9f92eca597552d497ee61b068622482be..4158800ce4f86d20213dfd9ccba38d4baf10aa02 100644 +index 35b18d05097a0bceffe0399ba9cf283ad046051f..de08bdced1d55da22b5abd6f44fdad708ec8f238 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1,6 +1,5 @@ @@ -1570,7 +1570,7 @@ index a0cca8f9f92eca597552d497ee61b068622482be..4158800ce4f86d20213dfd9ccba38d4b import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1332,7 +1331,6 @@ public abstract class PlayerList { +@@ -1338,7 +1337,6 @@ public abstract class PlayerList { public void saveAll(int interval) { io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main @@ -1578,7 +1578,7 @@ index a0cca8f9f92eca597552d497ee61b068622482be..4158800ce4f86d20213dfd9ccba38d4b int numSaved = 0; long now = MinecraftServer.currentTick; for (int i = 0; i < this.players.size(); ++i) { -@@ -1343,7 +1341,6 @@ public abstract class PlayerList { +@@ -1349,7 +1347,6 @@ public abstract class PlayerList { } // Paper end } @@ -1587,7 +1587,7 @@ index a0cca8f9f92eca597552d497ee61b068622482be..4158800ce4f86d20213dfd9ccba38d4b } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 38845300ceb7092de4cd8e31ef8782728892f656..0d9d7e3b1302b2ee396954a47038370c1d4a4c59 100644 +index 770d74e3c3226306a8f246920798ae72fdafe2c5..050c89be2f3fb4ae5a3d79282d3d67782b67d838 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -340,15 +340,6 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -1606,7 +1606,7 @@ index 38845300ceb7092de4cd8e31ef8782728892f656..0d9d7e3b1302b2ee396954a47038370c this.builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this); this.factory = factory; this.category = spawnGroup; -@@ -718,12 +709,6 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -724,12 +715,6 @@ public class EntityType implements FeatureElement, EntityTypeT return this.updateInterval; } @@ -1619,7 +1619,7 @@ index 38845300ceb7092de4cd8e31ef8782728892f656..0d9d7e3b1302b2ee396954a47038370c public boolean trackDeltas() { return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; } -@@ -833,7 +818,7 @@ public class EntityType implements FeatureElement, EntityTypeT +@@ -839,7 +824,7 @@ public class EntityType implements FeatureElement, EntityTypeT Util.fetchChoiceType(References.ENTITY_TREE, id); } @@ -1726,7 +1726,7 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..4de18d00cc464313b777874430da3f55 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 41c59c0828e0b6919e029f831ed22b305b2be470..0b10bf781dc70c0ea3d5031ac2b5fe5395cb5269 100644 +index 8b41f27fccf31646e780966d2da7e4c4f5419710..2c5c84c028d1298bb145fa1149752db3f83d5de2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -179,7 +179,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1745,7 +1745,7 @@ index 41c59c0828e0b6919e029f831ed22b305b2be470..0b10bf781dc70c0ea3d5031ac2b5fe53 this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime); -@@ -1325,15 +1323,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1330,15 +1328,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } protected void tickBlockEntities() { @@ -1761,7 +1761,7 @@ index 41c59c0828e0b6919e029f831ed22b305b2be470..0b10bf781dc70c0ea3d5031ac2b5fe53 // Spigot start // Iterator iterator = this.blockEntityTickers.iterator(); boolean flag = this.tickRateManager().runsNormally(); -@@ -1362,9 +1357,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1367,9 +1362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } this.blockEntityTickers.removeAll(toRemove); @@ -1793,7 +1793,7 @@ index 530c5e3500bd735bbd41d6c973d7470c43aed404..ec6afe51fd204e4c0764850dcc4535f7 // Paper start diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 27879468851875f9d9e7eb28f47ad36d36fd7475..be19989c059caaa8406ce58443eb9a2586d49dfe 100644 +index 1e0a8f38b88557ef8c5d1f194dca21ba0fb1226b..74edd4f804c3a9dc24515038b3e98937424e68b3 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -114,13 +114,6 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -2272,7 +2272,7 @@ index 139d946346594d2a59a8b2930c4eae794c880dbc..00000000000000000000000000000000 - -} diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 62514cc02d0b210283e7999a6f34976355d1b2d9..95ec734e17d98aff08cba1b40de79ac50bf5ba78 100644 +index c3a2e0c9b7a5f2ad55b3d8c971d280a0795ff63a..76e155205e2fca0d2080532234b9d08270a2877e 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -35,7 +35,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity; diff --git a/patches/server/0012-Bump-Dependencies.patch b/patches/server/0012-Bump-Dependencies.patch index 0e21c9a3..f6c4c107 100644 --- a/patches/server/0012-Bump-Dependencies.patch +++ b/patches/server/0012-Bump-Dependencies.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies diff --git a/build.gradle.kts b/build.gradle.kts -index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..eb622ea1c419bc0d514b77af0860ab08e0aa2822 100644 +index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..081788f064872486f5905dcdde2e1de0495e599e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,9 +22,9 @@ dependencies { @@ -27,8 +27,8 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..eb622ea1c419bc0d514b77af0860ab08 - implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation - log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins + // Leaf start - Bump Dependencies -+ implementation("org.apache.logging.log4j:log4j-core:2.22.0") // Paper - implementation -+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.22.0") // Paper - Needed to generate meta for our Log4j plugins ++ implementation("org.apache.logging.log4j:log4j-core:2.22.1") // Paper - implementation ++ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.22.1") // Paper - Needed to generate meta for our Log4j plugins runtimeOnly(log4jPlugins.output) alsoShade(log4jPlugins.output) - implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol @@ -37,7 +37,7 @@ index 604ce3a289f33b051074aa0a5e2ff04b74986cb1..eb622ea1c419bc0d514b77af0860ab08 - implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.5") - implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation -+ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.0") // Paper - remove exclusion ++ implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion + implementation("org.ow2.asm:asm:9.6") + implementation("org.ow2.asm:asm-commons:9.6") // Paper - ASM event executor generation implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files diff --git a/patches/server/0015-Remove-UseItemOnPacket-Too-Far-Check.patch b/patches/server/0015-Remove-UseItemOnPacket-Too-Far-Check.patch index 78e8aa61..56c9e331 100644 --- a/patches/server/0015-Remove-UseItemOnPacket-Too-Far-Check.patch +++ b/patches/server/0015-Remove-UseItemOnPacket-Too-Far-Check.patch @@ -7,10 +7,10 @@ This Check is added in 1.17.x -> 1.18.x update by Mojang. By removing this check, it enable hackers to use some modules of hack clients. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index add52c6986866c42d73c51fa8390d62a4a9d5594..78374c798272f597067bcf2ff7d9d060c0f4f5b2 100644 +index c74a9e5f2d92daa36265985e4f6ef7e0e6df4484..012af2775a5d6559fdefab7d484f15b475a1c381 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2008,7 +2008,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2011,7 +2011,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl Vec3 vec3d2 = vec3d.subtract(vec3d1); double d0 = 1.0000001D; diff --git a/patches/server/0017-KeYi-Player-Skull-API.patch b/patches/server/0017-KeYi-Player-Skull-API.patch index f8ace3ed..124e4a41 100644 --- a/patches/server/0017-KeYi-Player-Skull-API.patch +++ b/patches/server/0017-KeYi-Player-Skull-API.patch @@ -7,7 +7,7 @@ Original license: MIT Original project: https://github.com/KeYiMC/KeYi diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index df4f39d38f1ff4a5e499e227d93d98f531a01419..c9dd86c2d71d7281902ed5f4cfd8d4320ecd0563 100644 +index 8c90eddd40c8ab2f4d727e3c7d9b6312d57bf277..2026f2b42658e5625da39097d3faae2b86b0153b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -29,6 +29,11 @@ import java.util.Optional; @@ -30,7 +30,7 @@ index df4f39d38f1ff4a5e499e227d93d98f531a01419..c9dd86c2d71d7281902ed5f4cfd8d432 import org.bukkit.map.MapCursor; import org.bukkit.map.MapView; import org.bukkit.metadata.MetadataValue; -@@ -3423,4 +3429,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3470,4 +3476,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message))); } // Purpur end diff --git a/patches/server/0025-Leaves-Server-Utils.patch b/patches/server/0025-Leaves-Server-Utils.patch index 59775bfb..0b129d0f 100644 --- a/patches/server/0025-Leaves-Server-Utils.patch +++ b/patches/server/0025-Leaves-Server-Utils.patch @@ -7,7 +7,7 @@ Original license: GPLv3 Original project: https://github.com/LeavesMC/Leaves diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 50267637d752b8216ee81e09945d7b8f08743c53..0afe218612f16b04798fa5697ac40db95a6629ed 100644 +index 61df6e02971a3e2deb63504b35289a77781d34ac..c7ef72f2f4fdd2b7d06312c2931a6e0e857616c2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -423,6 +423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -18,7 +18,7 @@ index 50267637d752b8216ee81e09945d7b8f08743c53..0afe218612f16b04798fa5697ac40db9 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -2525,6 +2526,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2529,6 +2530,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S nbttagcompound.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -26,7 +26,7 @@ index 50267637d752b8216ee81e09945d7b8f08743c53..0afe218612f16b04798fa5697ac40db9 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2672,6 +2674,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2676,6 +2678,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -38,7 +38,7 @@ index 50267637d752b8216ee81e09945d7b8f08743c53..0afe218612f16b04798fa5697ac40db9 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); -@@ -5109,4 +5116,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -5120,4 +5127,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return false; } // Purpur end diff --git a/patches/server/0026-Leaves-Protocol-Core.patch b/patches/server/0026-Leaves-Protocol-Core.patch index 7d9805ae..1997eab8 100644 --- a/patches/server/0026-Leaves-Protocol-Core.patch +++ b/patches/server/0026-Leaves-Protocol-Core.patch @@ -25,10 +25,10 @@ index af86f752c33a2990405fea058b7c41c437ba9d46..bada9fae1e7178162429e1f5a1608b9c } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 138935ffe2f7852e8aa30a5fdea2d4ca340c4cdf..625822b060683bfdf3b79f82ed5eea68ff8ade85 100644 +index 149a786b38d999730a05931ea5dc69a7aa04723a..a500372fb5cec834d0d25eb44f46afaa1acf6ffc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1724,6 +1724,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, MachineBreaker diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0b10bf781dc70c0ea3d5031ac2b5fe5395cb5269..ddbc6340297d4d3e502d00bc3ab4f2b66438472e 100644 +index 2c5c84c028d1298bb145fa1149752db3f83d5de2..202805185a61316c559c22be7c0d880d77abc503 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -386,11 +386,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -35,7 +35,7 @@ index 0b10bf781dc70c0ea3d5031ac2b5fe5395cb5269..ddbc6340297d4d3e502d00bc3ab4f2b6 return false; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d45a8bed2a65f7efb93cfd6d714fe399c615bb1d..c887f6c6f60acee37ff72568f95e5a34d4db53a2 100644 +index 7e13ffee8e650cd5fe63fddf636321830e6ffb6d..b1442a099fa38fe20e9421f9183d66cf1ec54c2f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -585,12 +585,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -53,7 +53,7 @@ index d45a8bed2a65f7efb93cfd6d714fe399c615bb1d..c887f6c6f60acee37ff72568f95e5a34 if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) { return false; } -@@ -2113,6 +2115,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2160,6 +2162,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.canSee((org.bukkit.entity.Entity) player); } diff --git a/patches/server/0042-Configurable-movement-speed-of-more-entities.patch b/patches/server/0042-Configurable-movement-speed-of-more-entities.patch index 449bc86d..5348cd51 100644 --- a/patches/server/0042-Configurable-movement-speed-of-more-entities.patch +++ b/patches/server/0042-Configurable-movement-speed-of-more-entities.patch @@ -113,7 +113,7 @@ index df8c7a45eb49a8c667030eb67d6d49dcbaef4fcf..6a534272546b19a75880940f39458ca6 @Override protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) { diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e5320dfa037 100644 +index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e4675b4e7 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -1535,6 +1535,7 @@ public class PurpurWorldConfig { @@ -148,7 +148,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 } public boolean illusionerRidable = false; -@@ -3126,6 +3130,7 @@ public class PurpurWorldConfig { +@@ -3122,6 +3126,7 @@ public class PurpurWorldConfig { public boolean zombieTakeDamageFromWater = false; public boolean zombieAlwaysDropExp = false; public double zombieHeadVisibilityPercent = 0.5D; @@ -156,7 +156,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 private void zombieSettings() { zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable); zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater); -@@ -3145,6 +3150,7 @@ public class PurpurWorldConfig { +@@ -3141,6 +3146,7 @@ public class PurpurWorldConfig { zombieTakeDamageFromWater = getBoolean("mobs.zombie.takes-damage-from-water", zombieTakeDamageFromWater); zombieAlwaysDropExp = getBoolean("mobs.zombie.always-drop-exp", zombieAlwaysDropExp); zombieHeadVisibilityPercent = getDouble("mobs.zombie.head-visibility-percent", zombieHeadVisibilityPercent); @@ -164,7 +164,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 } public boolean zombieHorseRidable = false; -@@ -3193,6 +3199,7 @@ public class PurpurWorldConfig { +@@ -3189,6 +3195,7 @@ public class PurpurWorldConfig { public int zombieVillagerCuringTimeMax = 6000; public boolean zombieVillagerCureEnabled = true; public boolean zombieVillagerAlwaysDropExp = false; @@ -172,7 +172,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 private void zombieVillagerSettings() { zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable); zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater); -@@ -3212,6 +3219,7 @@ public class PurpurWorldConfig { +@@ -3208,6 +3215,7 @@ public class PurpurWorldConfig { zombieVillagerCuringTimeMax = getInt("mobs.zombie_villager.curing_time.max", zombieVillagerCuringTimeMax); zombieVillagerCureEnabled = getBoolean("mobs.zombie_villager.cure.enabled", zombieVillagerCureEnabled); zombieVillagerAlwaysDropExp = getBoolean("mobs.zombie_villager.always-drop-exp", zombieVillagerAlwaysDropExp); @@ -180,7 +180,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 } public boolean zombifiedPiglinRidable = false; -@@ -3225,6 +3233,7 @@ public class PurpurWorldConfig { +@@ -3221,6 +3229,7 @@ public class PurpurWorldConfig { public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = true; public boolean zombifiedPiglinTakeDamageFromWater = false; public boolean zombifiedPiglinAlwaysDropExp = false; @@ -188,7 +188,7 @@ index 22a61c89007e624586e7ed518f0aa18372bc4593..609446782958d03ae0d5bef99c1d8e53 private void zombifiedPiglinSettings() { zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable); zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater); -@@ -3242,6 +3251,7 @@ public class PurpurWorldConfig { +@@ -3238,6 +3247,7 @@ public class PurpurWorldConfig { zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry); zombifiedPiglinTakeDamageFromWater = getBoolean("mobs.zombified_piglin.takes-damage-from-water", zombifiedPiglinTakeDamageFromWater); zombifiedPiglinAlwaysDropExp = getBoolean("mobs.zombified_piglin.always-drop-exp", zombifiedPiglinAlwaysDropExp); diff --git a/patches/server/0043-Fix-TerminalConsoleAppender-NPE-error-on-server-clos.patch b/patches/server/0043-Fix-TerminalConsoleAppender-NPE-error-on-server-clos.patch index 3397bf0f..2d7be71b 100644 --- a/patches/server/0043-Fix-TerminalConsoleAppender-NPE-error-on-server-clos.patch +++ b/patches/server/0043-Fix-TerminalConsoleAppender-NPE-error-on-server-clos.patch @@ -13,7 +13,7 @@ Fixed errors in console has no color,also fixed`Advanced terminal features are n or `Unable to create terminal` like issues diff --git a/build.gradle.kts b/build.gradle.kts -index eb622ea1c419bc0d514b77af0860ab08e0aa2822..a6ac60d7d57e4b0662b0c30f7bc43ba84179d697 100644 +index 081788f064872486f5905dcdde2e1de0495e599e..0baaa2bcd05ea65c5fbb9ae646b3a9eeb12bac14 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { @@ -26,10 +26,10 @@ index eb622ea1c419bc0d514b77af0860ab08e0aa2822..a6ac60d7d57e4b0662b0c30f7bc43ba8 implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep /* diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 625822b060683bfdf3b79f82ed5eea68ff8ade85..fb3bbe36c7bf67be65f0978ead2d4c778c32ba82 100644 +index a500372fb5cec834d0d25eb44f46afaa1acf6ffc..1b4e0c7f23186afd88c7a71e296a5ca958f1c1d8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1276,10 +1276,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop