From 8221b085f91a6ce65701b02fbb6a29e54bcc6023 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 27 Dec 2023 16:33:05 -0800 Subject: [PATCH] Fix global sound event gamerule not being respected (#8727) --- .../0102-Fix-global-sound-handling.patch | 102 ++++++++++++++++++ ...-sounds-to-same-world-if-limiting-ra.patch | 47 -------- ...PI-for-Reason-Source-Triggering-play.patch | 4 +- patches/server/0618-Missing-Entity-API.patch | 4 +- ...g-for-mobs-immune-to-default-effects.patch | 4 +- ...lock-data-for-EntityChangeBlockEvent.patch | 4 +- ...hange-the-podium-for-the-EnderDragon.patch | 6 +- ...nate-Current-redstone-implementation.patch | 11 +- ...0967-Only-capture-actual-tree-growth.patch | 4 +- ...Fix-silent-equipment-change-for-mobs.patch | 4 +- ...estore-vanilla-entity-drops-behavior.patch | 4 +- 11 files changed, 125 insertions(+), 69 deletions(-) create mode 100644 patches/server/0102-Fix-global-sound-handling.patch delete mode 100644 patches/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch diff --git a/patches/server/0102-Fix-global-sound-handling.patch b/patches/server/0102-Fix-global-sound-handling.patch new file mode 100644 index 0000000000..e85056eb58 --- /dev/null +++ b/patches/server/0102-Fix-global-sound-handling.patch @@ -0,0 +1,102 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Tue, 31 May 2016 22:53:50 -0400 +Subject: [PATCH] Fix global sound handling + +* Only send global sounds to same world if limiting radius +* respect global sound events gamerule + +Co-authored-by: Evan McCarthy +Co-authored-by: lexikiq +Co-authored-by: Aikar + +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index cc3a34afddac429b1ce75e54fdb284d7683a4310..90340d70d0a43987dddcd4f627ace76139f07245 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -1553,7 +1553,7 @@ public class ServerLevel extends Level implements WorldGenLevel { + + @Override + public void levelEvent(@Nullable Player player, int eventId, BlockPos pos, int data) { +- this.server.getPlayerList().broadcast(player, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), 64.0D, this.dimension(), new ClientboundLevelEventPacket(eventId, pos, data, false)); ++ this.server.getPlayerList().broadcast(player, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), 64.0D, this.dimension(), new ClientboundLevelEventPacket(eventId, pos, data, false)); // Paper - diff on change (the 64.0 distance is used as defaults for sound ranges in spigot config for ender dragon, end portal and wither) + } + + public int getLogicalHeight() { +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 aea9366215973555de88e67310b7fbe033f45cd5..2471800014d1661c2f422e5a24f0f3b00fa838f2 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 +@@ -680,11 +680,12 @@ public class EnderDragon extends Mob implements Enemy { + // CraftBukkit start - Use relative location for far away sounds + // this.level().globalLevelEvent(1028, this.blockPosition(), 0); + int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16; +- for (net.minecraft.server.level.ServerPlayer player : this.level().getServer().getPlayerList().players) { ++ for (net.minecraft.server.level.ServerPlayer player : this.level().getPlayersForGlobalSoundGamerule()) { // Paper - respect global sound events gamerule + double deltaX = this.getX() - player.getX(); + double deltaZ = this.getZ() - player.getZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +- if ( this.level().spigotConfig.dragonDeathSoundRadius > 0 && distanceSquared > this.level().spigotConfig.dragonDeathSoundRadius * this.level().spigotConfig.dragonDeathSoundRadius ) continue; // Spigot ++ final double soundRadiusSquared = this.level().getGlobalSoundRangeSquared(config -> config.dragonDeathSoundRadius); // Paper - respect global sound events gamerule ++ if ( !this.level().getGameRules().getBoolean(GameRules.RULE_GLOBAL_SOUND_EVENTS) && distanceSquared > soundRadiusSquared ) continue; // Spigot // Paper - respect global sound events gamerule + if (distanceSquared > viewDistance * viewDistance) { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.getX() + (deltaX / deltaLength) * viewDistance; +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 8d3f3987f2a6816752bdb2e477338d6dbdd6b7b7..14b09adeb9222600c24f3fb846ea8aee467952e6 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 +@@ -271,11 +271,12 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob + // 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; +- for (ServerPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { ++ for (ServerPlayer player : this.level().getPlayersForGlobalSoundGamerule()) { // Paper - respect global sound events gamerule + double deltaX = this.getX() - player.getX(); + double deltaZ = this.getZ() - player.getZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +- if ( this.level().spigotConfig.witherSpawnSoundRadius > 0 && distanceSquared > this.level().spigotConfig.witherSpawnSoundRadius * this.level().spigotConfig.witherSpawnSoundRadius ) continue; // Spigot ++ final double soundRadiusSquared = this.level().getGlobalSoundRangeSquared(config -> config.witherSpawnSoundRadius); // Paper - respect global sound events gamerule ++ if ( !this.level().getGameRules().getBoolean(GameRules.RULE_GLOBAL_SOUND_EVENTS) && distanceSquared > soundRadiusSquared ) continue; // Spigot // Paper - respect global sound events gamerule + if (distanceSquared > viewDistance * viewDistance) { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.getX() + (deltaX / deltaLength) * viewDistance; +diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java +index 5bc68514a1e8a212e2681f06b918548c0ec565b6..1977e702f6af39ebf100c1f2f2edc2d1c4d003b0 100644 +--- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java ++++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java +@@ -64,11 +64,12 @@ public class EnderEyeItem extends Item { + // world.b(1038, blockposition1.c(1, 0, 1), 0); + int viewDistance = world.getCraftServer().getViewDistance() * 16; + BlockPos soundPos = blockposition1.offset(1, 0, 1); +- for (ServerPlayer player : world.getServer().getPlayerList().players) { ++ for (ServerPlayer player : world.getPlayersForGlobalSoundGamerule()) { // Paper - respect global sound events gamerule + double deltaX = soundPos.getX() - player.getX(); + double deltaZ = soundPos.getZ() - player.getZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +- if (world.spigotConfig.endPortalSoundRadius > 0 && distanceSquared > world.spigotConfig.endPortalSoundRadius * world.spigotConfig.endPortalSoundRadius) continue; // Spigot ++ final double soundRadiusSquared = world.getGlobalSoundRangeSquared(config -> config.endPortalSoundRadius); // Paper - respect global sound events gamerule ++ if (!world.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_GLOBAL_SOUND_EVENTS) && distanceSquared > soundRadiusSquared) continue; // Spigot // Paper - respect global sound events gamerule + if (distanceSquared > viewDistance * viewDistance) { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.getX() + (deltaX / deltaLength) * viewDistance; +diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java +index f093a271cc0b5a0e1f55930d2b3b48161abc9185..cbb531c7993bd5062255564e6e6546afb948f6ed 100644 +--- a/src/main/java/net/minecraft/world/level/Level.java ++++ b/src/main/java/net/minecraft/world/level/Level.java +@@ -1366,4 +1366,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + return ret; + } + // Paper end ++ ++ // Paper start - respect global sound events gamerule ++ public List getPlayersForGlobalSoundGamerule() { ++ return this.getGameRules().getBoolean(GameRules.RULE_GLOBAL_SOUND_EVENTS) ? ((ServerLevel) this).getServer().getPlayerList().players : ((ServerLevel) this).players(); ++ } ++ ++ public double getGlobalSoundRangeSquared(java.util.function.Function rangeFunction) { ++ final double range = rangeFunction.apply(this.spigotConfig); ++ return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent ++ } ++ // Paper end - respect global sound events gamerule + } diff --git a/patches/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch b/patches/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch deleted file mode 100644 index d72603ca77..0000000000 --- a/patches/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 31 May 2016 22:53:50 -0400 -Subject: [PATCH] Only send global sounds to same world if limiting radius - -Co-authored-by: Evan McCarthy -Co-authored-by: lexikiq - -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 aea9366215973555de88e67310b7fbe033f45cd5..773e76d940bf0ec67681d2896bcf7a8428aa94bd 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 -@@ -680,7 +680,7 @@ public class EnderDragon extends Mob implements Enemy { - // CraftBukkit start - Use relative location for far away sounds - // this.level().globalLevelEvent(1028, this.blockPosition(), 0); - int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16; -- for (net.minecraft.server.level.ServerPlayer player : this.level().getServer().getPlayerList().players) { -+ for (net.minecraft.server.level.ServerPlayer player : this.level().spigotConfig.dragonDeathSoundRadius > 0 ? ((ServerLevel) this.level()).players() : this.level().getServer().getPlayerList().players) { // Paper - double deltaX = this.getX() - player.getX(); - double deltaZ = this.getZ() - player.getZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -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 8d3f3987f2a6816752bdb2e477338d6dbdd6b7b7..c23f05f0d951e0036fe2cf524989747fe236730b 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 -@@ -271,7 +271,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob - // 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; -- for (ServerPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { -+ for (ServerPlayer player : this.level().spigotConfig.witherSpawnSoundRadius > 0 ? ((ServerLevel) this.level()).players() : this.level().getServer().getPlayerList().players) { // Paper - double deltaX = this.getX() - player.getX(); - double deltaZ = this.getZ() - player.getZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java -index 5bc68514a1e8a212e2681f06b918548c0ec565b6..1fddc9025a9e5079f05dd6c86f6ca43c5d51d9c3 100644 ---- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java -+++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java -@@ -64,7 +64,7 @@ public class EnderEyeItem extends Item { - // world.b(1038, blockposition1.c(1, 0, 1), 0); - int viewDistance = world.getCraftServer().getViewDistance() * 16; - BlockPos soundPos = blockposition1.offset(1, 0, 1); -- for (ServerPlayer player : world.getServer().getPlayerList().players) { -+ for (ServerPlayer player : world.spigotConfig.endPortalSoundRadius > 0 ? ((ServerLevel) world).players() : world.getServer().getPlayerList().players) { // Paper - double deltaX = soundPos.getX() - player.getX(); - double deltaZ = soundPos.getZ() - player.getZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 9b2363590c..a7fbd387b9 100644 --- a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -205,7 +205,7 @@ index 83dbf663cd725adcbcfee4ac633f369240375381..0dab0da65788720e56a568918de458ab } 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 773e76d940bf0ec67681d2896bcf7a8428aa94bd..2d8a8a9c8acfcac13e5a82cda9d7be59138b6407 100644 +index c12c387cc2bc87346414dccaa7b2d9347087388d..2eeffb6c31ccdec14001b0a3a82d0f01117b96f3 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 @@ -673,7 +673,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -217,7 +217,7 @@ index 773e76d940bf0ec67681d2896bcf7a8428aa94bd..2d8a8a9c8acfcac13e5a82cda9d7be59 } if (this.dragonDeathTime == 1 && !this.isSilent()) { -@@ -701,7 +701,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -702,7 +702,7 @@ public class EnderDragon extends Mob implements Enemy { this.move(MoverType.SELF, new Vec3(0.0D, 0.10000000149011612D, 0.0D)); if (this.dragonDeathTime == 200 && this.level() instanceof ServerLevel) { if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp diff --git a/patches/server/0618-Missing-Entity-API.patch b/patches/server/0618-Missing-Entity-API.patch index a54c23730d..b014179c90 100644 --- a/patches/server/0618-Missing-Entity-API.patch +++ b/patches/server/0618-Missing-Entity-API.patch @@ -257,7 +257,7 @@ index edbb933d1f6f7fc6432f7a8b074c5dc20f47adfb..91fb62807b3c5600c83d4dc8d3fadf36 public Llama(EntityType type, Level world) { super(type, world); 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 c23f05f0d951e0036fe2cf524989747fe236730b..cd59500565a305757872aaf41b03b49ffc005af5 100644 +index 29b603f5d361fdfb4dd0d20b7e77a29a920f6961..32b69b09ba2ee63e393aa6b4b6a142aaca6819a1 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,6 +84,11 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -272,7 +272,7 @@ index c23f05f0d951e0036fe2cf524989747fe236730b..cd59500565a305757872aaf41b03b49f public WitherBoss(EntityType type, Level world) { super(type, world); -@@ -595,7 +600,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -596,7 +601,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override public boolean canChangeDimensions() { diff --git a/patches/server/0625-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0625-Add-config-for-mobs-immune-to-default-effects.patch index 3d70123c99..0693018bf1 100644 --- a/patches/server/0625-Add-config-for-mobs-immune-to-default-effects.patch +++ b/patches/server/0625-Add-config-for-mobs-immune-to-default-effects.patch @@ -18,10 +18,10 @@ index 4a11bf06a725a5c1927e24ac4ad066f7631a430a..ddfac0ec3baeff8596bea7e742707aa1 } } 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 cd59500565a305757872aaf41b03b49ffc005af5..703068eaff84bcce83f61d805afa6cc0fef909b1 100644 +index 32b69b09ba2ee63e393aa6b4b6a142aaca6819a1..0d1afaecc35b4c7f7656a2d903f08f92a706cb3f 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 -@@ -605,7 +605,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -606,7 +606,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override public boolean canBeAffected(MobEffectInstance effect) { diff --git a/patches/server/0777-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0777-Fix-new-block-data-for-EntityChangeBlockEvent.patch index 71a9201798..5bd96d2c08 100644 --- a/patches/server/0777-Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/0777-Fix-new-block-data-for-EntityChangeBlockEvent.patch @@ -78,10 +78,10 @@ index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934 } // CraftBukkit end 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 703068eaff84bcce83f61d805afa6cc0fef909b1..1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0 100644 +index 0d1afaecc35b4c7f7656a2d903f08f92a706cb3f..ad6df234b618235b4e08fb45952d4f0f0078fded 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 -@@ -373,7 +373,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -374,7 +374,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob if (WitherBoss.canDestroy(iblockdata)) { // CraftBukkit start diff --git a/patches/server/0782-Allow-to-change-the-podium-for-the-EnderDragon.patch b/patches/server/0782-Allow-to-change-the-podium-for-the-EnderDragon.patch index 44d65a775a..0f3a5f092b 100644 --- a/patches/server/0782-Allow-to-change-the-podium-for-the-EnderDragon.patch +++ b/patches/server/0782-Allow-to-change-the-podium-for-the-EnderDragon.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow to change the podium for the EnderDragon 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 c00d4b8e39ef90bb06098bee290203502bd4225b..389c45748732781595b773bc033446ace06fcbb0 100644 +index ca605316c9c639c096d545e8cdf233ad645bd041..f7f03725de9e72825fbe9516817c7345d2b4eb75 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 @@ -103,6 +103,10 @@ public class EnderDragon extends Mob implements Enemy { @@ -39,7 +39,7 @@ index c00d4b8e39ef90bb06098bee290203502bd4225b..389c45748732781595b773bc033446ac @Override public boolean isFlapping() { float f = Mth.cos(this.flapTime * 6.2831855F); -@@ -993,7 +1010,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -994,7 +1011,7 @@ public class EnderDragon extends Mob implements Enemy { d0 = segment2[1] - segment1[1]; } } else { @@ -48,7 +48,7 @@ index c00d4b8e39ef90bb06098bee290203502bd4225b..389c45748732781595b773bc033446ac double d1 = Math.max(Math.sqrt(blockposition.distToCenterSqr(this.position())) / 4.0D, 1.0D); d0 = (double) segmentOffset / d1; -@@ -1020,7 +1037,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1021,7 +1038,7 @@ public class EnderDragon extends Mob implements Enemy { vec3d = this.getViewVector(tickDelta); } } else { diff --git a/patches/server/0806-Add-Alternate-Current-redstone-implementation.patch b/patches/server/0806-Add-Alternate-Current-redstone-implementation.patch index 0030e30392..28ad7aaa29 100644 --- a/patches/server/0806-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/0806-Add-Alternate-Current-redstone-implementation.patch @@ -2008,7 +2008,7 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78 + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a96aa3568453aa2da8b5cd5b269fc0b3fec13938..4cf7e66dfee34a29894f53d17e7e13c46fb4b85e 100644 +index afe430860c150db8fc4597f906f201a5eac95369..1cdba4369c5177ec9f449de05cb97ee4aac84ec6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -224,6 +224,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2034,13 +2034,14 @@ index a96aa3568453aa2da8b5cd5b269fc0b3fec13938..4cf7e66dfee34a29894f53d17e7e13c4 EntityCallbacks() {} diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 3dfc42dfed0429ea46238ede127b86a0c7756659..2e96fadbead617096ef6dd96b37f967da9a30395 100644 +index b4c4e90994f8872c2f648389c7de0dd31a874085..cdd8cedc524ddbd0332b7198c78f65dff59423bc 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1870,4 +1870,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - return ret; +@@ -1881,4 +1881,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent } - // Paper end + // Paper end - respect global sound events gamerule ++ + // Paper start - optimize redstone (Alternate Current) + public alternate.current.wire.WireHandler getWireHandler() { + // This method is overridden in ServerLevel. diff --git a/patches/server/0967-Only-capture-actual-tree-growth.patch b/patches/server/0967-Only-capture-actual-tree-growth.patch index d542b5b4a2..5d33c30177 100644 --- a/patches/server/0967-Only-capture-actual-tree-growth.patch +++ b/patches/server/0967-Only-capture-actual-tree-growth.patch @@ -29,10 +29,10 @@ index db523ded8132f2010391c9f909319d0ae042a741..852727221d5cb8bcc14c57664622c13d } entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index c5eebb8bd05748d22d9cf688e510cca6bca111e1..36055499436b13a8650c966bafc7dbd52e58c074 100644 +index 013a6c551958af4c41814f66948998aff4842d52..1d8ad95f4fbf77b1c94be9bbe5aeb18601156765 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1882,4 +1882,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1894,4 +1894,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return null; } // Paper end - optimize redstone (Alternate Current) diff --git a/patches/server/1004-Fix-silent-equipment-change-for-mobs.patch b/patches/server/1004-Fix-silent-equipment-change-for-mobs.patch index de4efa72af..2812d9c2d1 100644 --- a/patches/server/1004-Fix-silent-equipment-change-for-mobs.patch +++ b/patches/server/1004-Fix-silent-equipment-change-for-mobs.patch @@ -47,10 +47,10 @@ index 8e9469fec42f7b6a132cf173f6f5a95777a29b3b..b319021b22c5dceba6199ed27814b2dc this.reassessWeaponGoal(); } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 36055499436b13a8650c966bafc7dbd52e58c074..f8e519684d02dff0e26734eb89eca54ae1d9b1ee 100644 +index 1d8ad95f4fbf77b1c94be9bbe5aeb18601156765..8848eeda7a89d445e370626182f9bb4710e5edd4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1884,7 +1884,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -1896,7 +1896,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper end - optimize redstone (Alternate Current) // Paper start - notify observers even if grow failed public void checkCapturedTreeStateForObserverNotify(final BlockPos pos, final CraftBlockState craftBlockState) { diff --git a/patches/server/1043-Restore-vanilla-entity-drops-behavior.patch b/patches/server/1043-Restore-vanilla-entity-drops-behavior.patch index e3861990ff..3168af080d 100644 --- a/patches/server/1043-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/1043-Restore-vanilla-entity-drops-behavior.patch @@ -117,10 +117,10 @@ index bc45bd5816b1b62cdd6011f2372702451b83f22b..96885946be3b8e129984353f3dfe4330 public boolean collides = true; public Set collidableExemptions = new HashSet<>(); 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 1e07febcf7a3dfb281728cc5e3e4f15dd776d7e0..c9a4feb4a52c0eb621b120e5b8c18d0a74dae0cd 100644 +index ad6df234b618235b4e08fb45952d4f0f0078fded..d65a6de8a0fc4859b7313c903201a41a7da830fa 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 -@@ -533,10 +533,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -534,10 +534,10 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @Override protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);