From 0008fa17e967aa435e70fb881edf91b47c8aec7c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 15 Jun 2024 19:24:11 +0200 Subject: [PATCH] Add back more optimization patches --- ...dBounds-and-getBlockState-for-inlin.patch} | 0 patches/server/0992-stubs.patch | 48 ------------------- ...tem-frames-performance-and-bug-fixe.patch} | 0 ...ing-for-EntityLiving-hasLineOfSight.patch} | 0 ...Manager-and-add-advanced-packet-sup.patch} | 0 ...96-Allow-Saving-of-Oversized-Chunks.patch} | 0 ...997-Flat-bedrock-generator-settings.patch} | 0 ...=> 0998-Entity-Activation-Range-2.0.patch} | 0 ...0999-Optional-per-player-mob-spawns.patch} | 0 ...1-Anti-Xray.patch => 1000-Anti-Xray.patch} | 0 ...-Eigencraft-redstone-implementation.patch} | 0 ...ate-Current-redstone-implementation.patch} | 14 +++--- ...g-PreCreatureSpawnEvent-with-per-pl.patch} | 18 +++---- ...city-compression-and-cipher-natives.patch} | 20 ++++---- ...alSelector-Goal.Flag-Set-operations.patch} | 0 .../1006-Optimize-Hoppers.patch} | 12 ++--- .../1007-Optimize-Voxel-Shape-Merging.patch} | 0 ...Optimize-Bit-Operations-by-inlining.patch} | 2 +- .../1009-Remove-streams-from-hot-code.patch} | 0 ...er-Remove-Streams-Optimized-collect.patch} | 0 ...ementation-for-blockstate-state-loo.patch} | 0 ...-type-tags-suggestions-in-selectors.patch} | 16 +++---- ...-Oversized-block-entities-in-chunks.patch} | 2 +- .../1014-API-for-checking-sent-chunks.patch} | 25 +++++----- 24 files changed, 54 insertions(+), 103 deletions(-) rename patches/server/{0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch => 0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch} (100%) delete mode 100644 patches/server/0992-stubs.patch rename patches/server/{0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch => 0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch} (100%) rename patches/server/{0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch => 0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch} (100%) rename patches/server/{0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch => 0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch} (100%) rename patches/server/{0997-Allow-Saving-of-Oversized-Chunks.patch => 0996-Allow-Saving-of-Oversized-Chunks.patch} (100%) rename patches/server/{0998-Flat-bedrock-generator-settings.patch => 0997-Flat-bedrock-generator-settings.patch} (100%) rename patches/server/{0999-Entity-Activation-Range-2.0.patch => 0998-Entity-Activation-Range-2.0.patch} (100%) rename patches/server/{1000-Optional-per-player-mob-spawns.patch => 0999-Optional-per-player-mob-spawns.patch} (100%) rename patches/server/{1001-Anti-Xray.patch => 1000-Anti-Xray.patch} (100%) rename patches/{unapplied/server/1015-Eigencraft-redstone-implementation.patch => server/1001-Eigencraft-redstone-implementation.patch} (100%) rename patches/{unapplied/server/1028-Add-Alternate-Current-redstone-implementation.patch => server/1002-Add-Alternate-Current-redstone-implementation.patch} (99%) rename patches/{unapplied/server/1006-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch => server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch} (89%) rename patches/{unapplied/server/1023-Use-Velocity-compression-and-cipher-natives.patch => server/1004-Use-Velocity-compression-and-cipher-natives.patch} (96%) rename patches/{unapplied/server/1008-Optimize-GoalSelector-Goal.Flag-Set-operations.patch => server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch} (100%) rename patches/{unapplied/server/1031-Optimize-Hoppers.patch => server/1006-Optimize-Hoppers.patch} (98%) rename patches/{unapplied/server/1011-Optimize-Voxel-Shape-Merging.patch => server/1007-Optimize-Voxel-Shape-Merging.patch} (100%) rename patches/{unapplied/server/1013-Optimize-Bit-Operations-by-inlining.patch => server/1008-Optimize-Bit-Operations-by-inlining.patch} (99%) rename patches/{unapplied/server/1014-Remove-streams-from-hot-code.patch => server/1009-Remove-streams-from-hot-code.patch} (100%) rename patches/{unapplied/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch => server/1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch} (100%) rename patches/{unapplied/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch => server/1011-Custom-table-implementation-for-blockstate-state-loo.patch} (100%) rename patches/{unapplied/server/1027-Fix-entity-type-tags-suggestions-in-selectors.patch => server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch} (93%) rename patches/{unapplied/server/1038-Handle-Oversized-block-entities-in-chunks.patch => server/1013-Handle-Oversized-block-entities-in-chunks.patch} (97%) rename patches/{unapplied/server/1040-API-for-checking-sent-chunks.patch => server/1014-API-for-checking-sent-chunks.patch} (64%) diff --git a/patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch similarity index 100% rename from patches/server/0993-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch rename to patches/server/0992-Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch diff --git a/patches/server/0992-stubs.patch b/patches/server/0992-stubs.patch deleted file mode 100644 index 7bc16f1c5f..0000000000 --- a/patches/server/0992-stubs.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke -Date: Fri, 14 Jun 2024 17:19:59 +0200 -Subject: [PATCH] stubs - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ecd975855d92ae5948ee926f42396cb004843aed..4a613d94f40cc73a9f50b8ef2d6949fc2bd34e53 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -110,6 +110,7 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData; - import org.bukkit.BanEntry; - import org.bukkit.BanList; - import org.bukkit.Bukkit; -+import org.bukkit.Chunk; - import org.bukkit.DyeColor; - import org.bukkit.Effect; - import org.bukkit.GameMode; -@@ -192,6 +193,7 @@ import org.bukkit.scoreboard.Scoreboard; - import org.jetbrains.annotations.NotNull; - - import net.md_5.bungee.api.chat.BaseComponent; // Spigot -+import org.jetbrains.annotations.Unmodifiable; - - @DelegateDeserialization(CraftOfflinePlayer.class) - public class CraftPlayer extends CraftHumanEntity implements Player { -@@ -3481,6 +3483,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - public void resetIdleDuration() { - this.getHandle().resetLastActionTime(); - } -+ -+ @Override -+ public @NotNull @Unmodifiable Set getSentChunkKeys() { -+ throw new UnsupportedOperationException("Not implemented yet"); -+ } -+ -+ @Override -+ public @NotNull @Unmodifiable Set getSentChunks() { -+ throw new UnsupportedOperationException("Not implemented yet"); -+ } -+ -+ @Override -+ public boolean isChunkSent(final long chunkKey) { -+ throw new UnsupportedOperationException("Not implemented yet"); -+ } - // Paper end - - public Player.Spigot spigot() diff --git a/patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 100% rename from patches/server/0994-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to patches/server/0993-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 100% rename from patches/server/0995-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/server/0994-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch diff --git a/patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 100% rename from patches/server/0996-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/server/0995-Optimize-Network-Manager-and-add-advanced-packet-sup.patch diff --git a/patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch b/patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch similarity index 100% rename from patches/server/0997-Allow-Saving-of-Oversized-Chunks.patch rename to patches/server/0996-Allow-Saving-of-Oversized-Chunks.patch diff --git a/patches/server/0998-Flat-bedrock-generator-settings.patch b/patches/server/0997-Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/server/0998-Flat-bedrock-generator-settings.patch rename to patches/server/0997-Flat-bedrock-generator-settings.patch diff --git a/patches/server/0999-Entity-Activation-Range-2.0.patch b/patches/server/0998-Entity-Activation-Range-2.0.patch similarity index 100% rename from patches/server/0999-Entity-Activation-Range-2.0.patch rename to patches/server/0998-Entity-Activation-Range-2.0.patch diff --git a/patches/server/1000-Optional-per-player-mob-spawns.patch b/patches/server/0999-Optional-per-player-mob-spawns.patch similarity index 100% rename from patches/server/1000-Optional-per-player-mob-spawns.patch rename to patches/server/0999-Optional-per-player-mob-spawns.patch diff --git a/patches/server/1001-Anti-Xray.patch b/patches/server/1000-Anti-Xray.patch similarity index 100% rename from patches/server/1001-Anti-Xray.patch rename to patches/server/1000-Anti-Xray.patch diff --git a/patches/unapplied/server/1015-Eigencraft-redstone-implementation.patch b/patches/server/1001-Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/1015-Eigencraft-redstone-implementation.patch rename to patches/server/1001-Eigencraft-redstone-implementation.patch diff --git a/patches/unapplied/server/1028-Add-Alternate-Current-redstone-implementation.patch b/patches/server/1002-Add-Alternate-Current-redstone-implementation.patch similarity index 99% rename from patches/unapplied/server/1028-Add-Alternate-Current-redstone-implementation.patch rename to patches/server/1002-Add-Alternate-Current-redstone-implementation.patch index 2e914661d3..63c2b14dfc 100644 --- a/patches/unapplied/server/1028-Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/1002-Add-Alternate-Current-redstone-implementation.patch @@ -2009,10 +2009,10 @@ 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 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540aafce497 100644 +index bac8deab8f703c2e0ecbc11bf218319bb52e0cd4..fb0db51493e343c781876b9db773fa3fc9a8d666 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. public final UUID uuid; public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent @@ -2020,7 +2020,7 @@ index 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540 public LevelChunk getChunkIfLoaded(int x, int z) { return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately -@@ -2560,6 +2561,13 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2397,6 +2398,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. return crashreportsystemdetails; } @@ -2035,13 +2035,13 @@ index 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540 EntityCallbacks() {} diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 07281d73fcbca2ea5f8bce25f6bf961d258bf8a0..0a8eeebb2d702ebcefd9f26cc0f41d1eab497902 100644 +index 9f2fad2f4b1e4e7eda645d53eb76ed04fc0b3451..96ad3868a93964247790134fa5f4b18e5c07aea8 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1881,4 +1881,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - return ret; +@@ -1570,4 +1570,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + } } - // Paper end + // Paper end - notify observers even if grow failed + // Paper start - optimize redstone (Alternate Current) + public alternate.current.wire.WireHandler getWireHandler() { + // This method is overridden in ServerLevel. diff --git a/patches/unapplied/server/1006-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch b/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch similarity index 89% rename from patches/unapplied/server/1006-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch rename to patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch index 7100cae640..410b44641b 100644 --- a/patches/unapplied/server/1006-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch +++ b/patches/server/1003-Improve-cancelling-PreCreatureSpawnEvent-with-per-pl.patch @@ -6,13 +6,13 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 56f855ed9dbbb9a7025bef6f9e98a8cdcf2ad4fc..4621c33ed73b0db64e78e7b9be7013a2ba7393c8 100644 +index 7bebf252887ecc7594b1ce21471fb6ba7aa2c051..df00ea382915480be1279a5347872cf7a1417341 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -309,8 +309,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -300,8 +300,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + ++((ServerPlayer)backingSet[i]).mobCounts[index]; } } - + // Paper start - per player mob count backoff + public void updateFailurePlayerMobTypeMap(int chunkX, int chunkZ, net.minecraft.world.entity.MobCategory mobCategory) { + if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { @@ -33,14 +33,14 @@ index 56f855ed9dbbb9a7025bef6f9e98a8cdcf2ad4fc..4621c33ed73b0db64e78e7b9be7013a2 public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) { - return player.mobCounts[mobCategory.ordinal()]; + return player.mobCounts[mobCategory.ordinal()] + player.mobBackoffCounts[mobCategory.ordinal()]; // Paper - per player mob count backoff + // Paper end - Optional per player mob spawns } - // Paper end - Optional per player mob spawns - + // Paper end diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 41be61c8d239515975b5a73ecf448734710abd23..6b258a2bd85bb71b030d42b488e1a4742d1e147d 100644 +index f134b75b3665b53ef873404b3f4775657cfbcadb..7dc2ecd8a80b063cec922021bd978ba2c6f8c0fb 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -522,7 +522,17 @@ public class ServerChunkCache extends ChunkSource { +@@ -505,7 +505,17 @@ public class ServerChunkCache extends ChunkSource { if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled // re-set mob counts for (ServerPlayer player : this.level.players) { @@ -60,10 +60,10 @@ index 41be61c8d239515975b5a73ecf448734710abd23..6b258a2bd85bb71b030d42b488e1a474 spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, null, true); } else { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 2a7d050c785e6cba36ec3df3127c2fc3b7932db6..54023123e8f46671968f23f05590dd18ed5c2024 100644 +index c75812c195cc83dbe02eebc9ba67b2a9c29ca9a4..89ed20e9c629cf39a24c7a0ce5c4fee41fc64fd5 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -276,6 +276,7 @@ public class ServerPlayer extends Player { +@@ -279,6 +279,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public static final int MOBCATEGORY_TOTAL_ENUMS = net.minecraft.world.entity.MobCategory.values().length; public final int[] mobCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper // Paper end - Optional per player mob spawns diff --git a/patches/unapplied/server/1023-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch similarity index 96% rename from patches/unapplied/server/1023-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch index c83372d4cd..fd68f70524 100644 --- a/patches/unapplied/server/1023-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/1004-Use-Velocity-compression-and-cipher-natives.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index 48b8db6d5fdf9b2f7155b9356418178f5594ddcb..4998aff0b7cb084dcda15c6a18bbe45e99b6000a 100644 +index b06f38b87765d084565bc11cf5da6076562b6be8..299b7b029384c58fed80d53cc0b77c420d62eed7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,6 +37,11 @@ dependencies { - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") - runtimeOnly("com.mysql:mysql-connector-j:8.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.4.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper + // Paper start - Use Velocity cipher + implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") { @@ -275,10 +275,10 @@ index 34a80d2f34555663ab1b394972957089214cb337..ec30c291188ac3bba7f1c3bc397576d1 return this.threshold; } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434f8be6593 100644 +index 7dc7aeb1d94d26cf54bd4e4ab13972a3a60c1f98..90a2c61c42cba7e38f167eccdd7a951a947963c4 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -763,11 +763,28 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -792,11 +792,28 @@ public class Connection extends SimpleChannelInboundHandler> { return networkmanager; } @@ -311,7 +311,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434 public boolean isEncrypted() { return this.encrypted; -@@ -800,12 +817,13 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -829,12 +846,13 @@ public class Connection extends SimpleChannelInboundHandler> { public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) { if (compressionThreshold >= 0) { @@ -326,7 +326,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434 } else { this.channel.pipeline().addAfter("splitter", "decompress", new CompressionDecoder(compressionThreshold, rejectsBadPackets)); } -@@ -816,7 +834,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -845,7 +863,7 @@ public class Connection extends SimpleChannelInboundHandler> { packetcompressor.setThreshold(compressionThreshold); } else { @@ -336,7 +336,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434 this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper - Add Channel initialization listeners } else { diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index a08d9aa6e420f691795df9b627a9cd5b5c0112c5..52f537b7bfbdeaad9d17c0e88a1ed1c8925a833f 100644 +index 2929d9a2efa9669781b6773161db7c5f968c2544..8aff5129f85ab5729b3da2e465871be62d15bdf2 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java @@ -106,6 +106,11 @@ public class ServerConnectionListener { @@ -352,10 +352,10 @@ index a08d9aa6e420f691795df9b627a9cd5b5c0112c5..52f537b7bfbdeaad9d17c0e88a1ed1c8 protected void initChannel(Channel channel) { try { diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index cb006ae0e5be2f1d31261bdd36964229ec44416d..b656741eb68adeb04bf995f1045902cb6bd5f2e7 100644 +index 0fc30ce511f449d2a3ddab28c86f7e388223ece1..b0f7a378f19b9837c060c891002cd5db756cdae1 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -280,12 +280,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -282,12 +282,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } SecretKey secretkey = packet.getSecretKey(privatekey); diff --git a/patches/unapplied/server/1008-Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/unapplied/server/1008-Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/1005-Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/unapplied/server/1031-Optimize-Hoppers.patch b/patches/server/1006-Optimize-Hoppers.patch similarity index 98% rename from patches/unapplied/server/1031-Optimize-Hoppers.patch rename to patches/server/1006-Optimize-Hoppers.patch index 6722f4c03b..2a71db2bec 100644 --- a/patches/unapplied/server/1031-Optimize-Hoppers.patch +++ b/patches/server/1006-Optimize-Hoppers.patch @@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 64ae2745c3144d43cad12dfe9baf1a291756d129..6d7224787d328540319c76f904e00cbe96d53565 100644 +index cd69971065b13353353eca55f6e145949390de11..7e32eecacf6f5e832dbfd0455e4bab1302a33d46 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1753,6 +1753,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - BlockPhysicsEvent worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent @@ -62,10 +62,10 @@ index 64ae2745c3144d43cad12dfe9baf1a291756d129..6d7224787d328540319c76f904e00cbe this.profiler.push(() -> { String s = String.valueOf(worldserver); diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 3f6082b656ec8c9b96b40fbd1c926d5211ffe4c6..066feef97f92b3f788dd6d25d188f2cc36fc4c80 100644 +index 86197725f0f2ac1e650297ae7a79907578e0e8f1..312b57b4ef340935f4335989ce1d6a4b8b61532c 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -801,10 +801,16 @@ public final class ItemStack implements DataComponentHolder { +@@ -809,10 +809,16 @@ public final class ItemStack implements DataComponentHolder { } public ItemStack copy() { @@ -85,7 +85,7 @@ index 3f6082b656ec8c9b96b40fbd1c926d5211ffe4c6..066feef97f92b3f788dd6d25d188f2cc itemstack.setPopTime(this.getPopTime()); return itemstack; diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 6207c6063cd11ccb1177fe7016c49c02a3416990..139cc0123921bf981d10334d9bd7378d19ec5f3b 100644 +index cd3b952a228c09077c2e74183a34ddb32811280b..c0563260277f9f4bd9ff08993b2efb4bca9a0c60 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java @@ -38,6 +38,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -96,7 +96,7 @@ index 6207c6063cd11ccb1177fe7016c49c02a3416990..139cc0123921bf981d10334d9bd7378d public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper // CraftBukkit start - data containers -@@ -211,6 +212,7 @@ public abstract class BlockEntity { +@@ -216,6 +217,7 @@ public abstract class BlockEntity { public void setChanged() { if (this.level != null) { diff --git a/patches/unapplied/server/1011-Optimize-Voxel-Shape-Merging.patch b/patches/server/1007-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/unapplied/server/1011-Optimize-Voxel-Shape-Merging.patch rename to patches/server/1007-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/unapplied/server/1013-Optimize-Bit-Operations-by-inlining.patch b/patches/server/1008-Optimize-Bit-Operations-by-inlining.patch similarity index 99% rename from patches/unapplied/server/1013-Optimize-Bit-Operations-by-inlining.patch rename to patches/server/1008-Optimize-Bit-Operations-by-inlining.patch index a1f24dd8dc..b7d93a56b9 100644 --- a/patches/unapplied/server/1013-Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/1008-Optimize-Bit-Operations-by-inlining.patch @@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index 4144c872fbd89d22827ad1f586e9a8d63a39ed46..665e88b2dedf9d5bb50914d5f3d377f2d19f40b0 100644 +index 12ff8886bb53ca15db745989c25b9bd2f45335e4..2767d6f97e8b314d23a8e62f22dfd396f5660d31 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -50,15 +50,16 @@ public class BlockPos extends Vec3i { diff --git a/patches/unapplied/server/1014-Remove-streams-from-hot-code.patch b/patches/server/1009-Remove-streams-from-hot-code.patch similarity index 100% rename from patches/unapplied/server/1014-Remove-streams-from-hot-code.patch rename to patches/server/1009-Remove-streams-from-hot-code.patch diff --git a/patches/unapplied/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/unapplied/server/1016-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/1010-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/unapplied/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch b/patches/server/1011-Custom-table-implementation-for-blockstate-state-loo.patch similarity index 100% rename from patches/unapplied/server/1019-Custom-table-implementation-for-blockstate-state-loo.patch rename to patches/server/1011-Custom-table-implementation-for-blockstate-state-loo.patch diff --git a/patches/unapplied/server/1027-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 93% rename from patches/unapplied/server/1027-Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch index d24e7d583c..47e6c56f5b 100644 --- a/patches/unapplied/server/1027-Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/1012-Fix-entity-type-tags-suggestions-in-selectors.patch @@ -10,10 +10,10 @@ when if this was fixed on the client, that wouldn't be needed. Mojira Issue: https://bugs.mojang.com/browse/MC-235045 diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 3c0d2332207ba638faaaa4280bce18c334a01271..e6c7f62ed379a78645933670299e4fcda8540ed1 100644 +index 4017b82e72fefd6685e9250a936686fd8a0891f1..59d7e8a3d83d3ab7aa28606401bb129ccaeff240 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java -@@ -462,4 +462,20 @@ public class CommandSourceStack implements ExecutionCommandSource tree, CommandNode result, CommandSourceStack source, Map, CommandNode> resultNodes) { +@@ -535,6 +535,7 @@ public class Commands { + resultNodes.keySet().removeIf((node) -> !org.spigotmc.SpigotConfig.sendNamespaced && node.getName().contains( ":" )); // Paper - Remove namedspaced from result nodes to prevent redirect trimming ~ see comment below Iterator iterator = tree.getChildren().iterator(); + boolean registeredAskServerSuggestionsForTree = false; // Paper - tell clients to ask server for suggestions for EntityArguments while (iterator.hasNext()) { CommandNode commandnode2 = (CommandNode) iterator.next(); // Paper start - Brigadier API -@@ -543,6 +544,12 @@ public class Commands { +@@ -597,6 +598,12 @@ public class Commands { if (requiredargumentbuilder.getSuggestionsProvider() != null) { requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider())); @@ -94,10 +94,10 @@ index 2043001c16b3530c2d3f52efda10bcad424881c0..7976885b902a6ce7d80f31e49448c994 SharedSuggestionProvider.suggest((Iterable) iterable, suggestionsbuilder1); diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java -index 3d897ec6920eff6176ddac9f0442a997b9ef14fd..abaf1ea340c69c8bee80e64567b44b5ce66d5fa3 100644 +index 6b6756625f3fb1f36f940c6e31e97b84f32a9990..32b39803380456f40bafdb790eaa27efab5f06a6 100644 --- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java +++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java -@@ -113,12 +113,19 @@ public class EntitySelectorParser { +@@ -115,12 +115,19 @@ public class EntitySelectorParser { private boolean hasScores; private boolean hasAdvancements; private boolean usesSelectors; diff --git a/patches/unapplied/server/1038-Handle-Oversized-block-entities-in-chunks.patch b/patches/server/1013-Handle-Oversized-block-entities-in-chunks.patch similarity index 97% rename from patches/unapplied/server/1038-Handle-Oversized-block-entities-in-chunks.patch rename to patches/server/1013-Handle-Oversized-block-entities-in-chunks.patch index b9ea4832bd..d3283fd63f 100644 --- a/patches/unapplied/server/1038-Handle-Oversized-block-entities-in-chunks.patch +++ b/patches/server/1013-Handle-Oversized-block-entities-in-chunks.patch @@ -9,7 +9,7 @@ creating too large of a packet to sed. Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java -index 05e29a703f022b5047262bae8caef33d9dfb9035..2501fbaf497d226051800c53d60a39bbc80db91c 100644 +index 1e75cd33c32f0e2923681da64b9b73b279933c1b..0a8d07bf68b0ceabd13c70196d357fce79dcc2c3 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java @@ -27,6 +27,14 @@ public class ClientboundLevelChunkPacketData { diff --git a/patches/unapplied/server/1040-API-for-checking-sent-chunks.patch b/patches/server/1014-API-for-checking-sent-chunks.patch similarity index 64% rename from patches/unapplied/server/1040-API-for-checking-sent-chunks.patch rename to patches/server/1014-API-for-checking-sent-chunks.patch index 5ff64c522d..a0c0a6363e 100644 --- a/patches/unapplied/server/1040-API-for-checking-sent-chunks.patch +++ b/patches/server/1014-API-for-checking-sent-chunks.patch @@ -4,11 +4,11 @@ Date: Mon, 8 Apr 2024 16:43:16 +0200 Subject: [PATCH] API for checking sent chunks -diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java -index ee58c67cb2bd78159cce19ec75f13dc6168a0e7a..149cfb0587299f72fcfddf395fb71b70438986c1 100644 ---- a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java -+++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java -@@ -1048,6 +1048,11 @@ public class RegionizedPlayerChunkLoader { +diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java +index dba09cb32844533c383635e7623f5180a468f636..a88c7113652b268c0fdc355710b00f452f9b5431 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java ++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java +@@ -1055,5 +1055,10 @@ public final class RegionizedPlayerChunkLoader { // now all tickets should be removed, which is all of our external state } @@ -18,13 +18,12 @@ index ee58c67cb2bd78159cce19ec75f13dc6168a0e7a..149cfb0587299f72fcfddf395fb71b70 + return this.sentChunks; + } } - - // TODO rebase into util patch + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4de5d35c19 100644 +index ecd975855d92ae5948ee926f42396cb004843aed..c868abef790aa80863721490f69087343aba13e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3455,6 +3455,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3483,6 +3483,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end @@ -33,18 +32,18 @@ index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4d + public Set getSentChunkKeys() { + org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks"); + return it.unimi.dsi.fastutil.longs.LongSets.unmodifiable( -+ this.getHandle().chunkLoader.getSentChunksRaw().clone() ++ this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().clone() + ); + } + + @Override + public Set getSentChunks() { + org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks"); -+ final it.unimi.dsi.fastutil.longs.LongOpenHashSet rawChunkKeys = this.getHandle().chunkLoader.getSentChunksRaw(); ++ final it.unimi.dsi.fastutil.longs.LongOpenHashSet rawChunkKeys = this.getHandle().moonrise$getChunkLoader().getSentChunksRaw(); + final it.unimi.dsi.fastutil.objects.ObjectOpenHashSet chunks = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(rawChunkKeys.size()); + final org.bukkit.World world = this.getWorld(); + -+ final it.unimi.dsi.fastutil.longs.LongIterator iter = this.getHandle().chunkLoader.getSentChunksRaw().longIterator(); ++ final it.unimi.dsi.fastutil.longs.LongIterator iter = this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().longIterator(); + while (iter.hasNext()) chunks.add(world.getChunkAt(iter.nextLong(), false)); + + return it.unimi.dsi.fastutil.objects.ObjectSets.unmodifiable(chunks); @@ -53,7 +52,7 @@ index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4d + @Override + public boolean isChunkSent(final long chunkKey) { + org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks"); -+ return this.getHandle().chunkLoader.getSentChunksRaw().contains(chunkKey); ++ return this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().contains(chunkKey); + } + // Paper end +