From cdc505ffc5f05e7decf8803d1d1c48572b14897b Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sat, 9 Nov 2024 12:45:03 -0500 Subject: [PATCH] dev -> 76 --- ...29-Remove-lambda-from-ticking-guard.patch} | 8 +- ...-support.patch => 0030-SIMD-support.patch} | 16 +- ...0031-Make-book-writing-configurable.patch} | 15 +- ...0032-Optimize-entity-coordinate-key.patch} | 4 +- ...patch => 0033-Reduce-in-wall-checks.patch} | 18 +- ...hat-order-verification-configurable.patch} | 0 ...-respawn-attempt-after-placing-end-.patch} | 2 +- ...-Make-saving-fireworks-configurable.patch} | 4 +- ...h => 0037-Reduce-hopper-item-checks.patch} | 29 +- ...0038-Reduce-villager-item-re-pickup.patch} | 0 ...39-Variable-entity-wake-up-duration.patch} | 8 +- ...at-commands-before-player-has-joine.patch} | 12 +- ... 0041-Do-not-log-invalid-statistics.patch} | 2 +- ...2-Do-not-log-empty-message-warnings.patch} | 14 +- ...043-Do-not-log-ignored-advancements.patch} | 2 +- ...4-Do-not-log-setBlock-in-far-chunks.patch} | 2 +- ...045-Do-not-log-unrecognized-recipes.patch} | 22 +- ...-log-legacy-Material-initialization.patch} | 2 +- ...047-Do-not-log-plugin-library-loads.patch} | 0 ...Do-not-log-expired-message-warnings.patch} | 0 ...> 0049-Do-not-log-Not-Secure-marker.patch} | 4 +- ...not-log-disconnections-with-null-id.patch} | 2 +- ...0051-Do-not-log-run-as-root-warning.patch} | 4 +- ...052-Do-not-log-offline-mode-warning.patch} | 4 +- ...tly-log-invalid-pool-element-errors.patch} | 0 ...er-showing-in-ping-before-server-fu.patch} | 0 ...-238526.patch => 0055-Fix-MC-238526.patch} | 4 +- ...ow-rotation-when-shearing-mooshroom.patch} | 41 +- ...-121706.patch => 0057-Fix-MC-121706.patch} | 0 ...-110386.patch => 0058-Fix-MC-110386.patch} | 2 +- ...MC-31819.patch => 0059-Fix-MC-31819.patch} | 4 +- ...MC-26304.patch => 0060-Fix-MC-26304.patch} | 10 +- ...nt-resetting-despawn-counter-config.patch} | 6 +- ...ogging-login-locations-configurable.patch} | 14 +- ...ch => 0063-Reduce-array-allocations.patch} | 351 +++++------------- ...atch => 0064-Optimize-sun-burn-tick.patch} | 10 +- ...-Optional-allocation-in-EntityBased.patch} | 0 ...rules-map-with-optimized-collection.patch} | 19 +- ...tributes-with-optimized-collections.patch} | 2 +- ...class-map-with-optimized-collection.patch} | 0 ...ance-list-with-optimized-collection.patch} | 0 ...tracker-map-with-optimized-collecti.patch} | 0 ...ignableFrom-call-in-ClassInstanceMu.patch} | 0 ...by-multiplication-in-CubePointRange.patch} | 0 ...ace-parts-by-size-in-CubePointRange.patch} | 0 ...k-frozen-ticks-before-landing-block.patch} | 6 +- ... => 0075-Faster-chunk-serialization.patch} | 14 +- ...=> 0076-Update-boss-bar-within-tick.patch} | 4 +- ...ce-entity-fluid-lookups-if-no-fluids.patch | 0 .../0075-Cache-BlockStatePairKey-hash.patch | 0 todos.txt | 1 + 51 files changed, 227 insertions(+), 435 deletions(-) rename patches/server/{0031-Remove-lambda-from-ticking-guard.patch => 0029-Remove-lambda-from-ticking-guard.patch} (93%) rename patches/server/{0033-SIMD-support.patch => 0030-SIMD-support.patch} (92%) rename patches/server/{0034-Make-book-writing-configurable.patch => 0031-Make-book-writing-configurable.patch} (84%) rename patches/server/{0035-Optimize-entity-coordinate-key.patch => 0032-Optimize-entity-coordinate-key.patch} (93%) rename patches/server/{0036-Reduce-in-wall-checks.patch => 0033-Reduce-in-wall-checks.patch} (84%) rename patches/server/{0037-Make-chat-order-verification-configurable.patch => 0034-Make-chat-order-verification-configurable.patch} (100%) rename patches/server/{0038-Make-ender-dragon-respawn-attempt-after-placing-end-.patch => 0035-Make-ender-dragon-respawn-attempt-after-placing-end-.patch} (97%) rename patches/server/{0039-Make-saving-fireworks-configurable.patch => 0036-Make-saving-fireworks-configurable.patch} (93%) rename patches/server/{0040-Reduce-hopper-item-checks.patch => 0037-Reduce-hopper-item-checks.patch} (89%) rename patches/server/{0041-Reduce-villager-item-re-pickup.patch => 0038-Reduce-villager-item-re-pickup.patch} (100%) rename patches/server/{0042-Variable-entity-wake-up-duration.patch => 0039-Variable-entity-wake-up-duration.patch} (94%) rename patches/server/{0043-Do-not-process-chat-commands-before-player-has-joine.patch => 0040-Do-not-process-chat-commands-before-player-has-joine.patch} (87%) rename patches/server/{0044-Do-not-log-invalid-statistics.patch => 0041-Do-not-log-invalid-statistics.patch} (97%) rename patches/server/{0045-Do-not-log-empty-message-warnings.patch => 0042-Do-not-log-empty-message-warnings.patch} (70%) rename patches/server/{0046-Do-not-log-ignored-advancements.patch => 0043-Do-not-log-ignored-advancements.patch} (97%) rename patches/server/{0047-Do-not-log-setBlock-in-far-chunks.patch => 0044-Do-not-log-setBlock-in-far-chunks.patch} (97%) rename patches/server/{0048-Do-not-log-unrecognized-recipes.patch => 0045-Do-not-log-unrecognized-recipes.patch} (74%) rename patches/server/{0049-Do-not-log-legacy-Material-initialization.patch => 0046-Do-not-log-legacy-Material-initialization.patch} (97%) rename patches/server/{0050-Do-not-log-plugin-library-loads.patch => 0047-Do-not-log-plugin-library-loads.patch} (100%) rename patches/server/{0051-Do-not-log-expired-message-warnings.patch => 0048-Do-not-log-expired-message-warnings.patch} (100%) rename patches/server/{0052-Do-not-log-Not-Secure-marker.patch => 0049-Do-not-log-Not-Secure-marker.patch} (96%) rename patches/server/{0053-Do-not-log-disconnections-with-null-id.patch => 0050-Do-not-log-disconnections-with-null-id.patch} (97%) rename patches/server/{0054-Do-not-log-run-as-root-warning.patch => 0051-Do-not-log-run-as-root-warning.patch} (94%) rename patches/server/{0055-Do-not-log-offline-mode-warning.patch => 0052-Do-not-log-offline-mode-warning.patch} (94%) rename patches/server/{0056-Softly-log-invalid-pool-element-errors.patch => 0053-Softly-log-invalid-pool-element-errors.patch} (100%) rename patches/server/{0057-Fix-outdated-server-showing-in-ping-before-server-fu.patch => 0054-Fix-outdated-server-showing-in-ping-before-server-fu.patch} (100%) rename patches/server/{0058-Fix-MC-238526.patch => 0055-Fix-MC-238526.patch} (96%) rename patches/server/{0059-Fix-cow-rotation-when-shearing-mooshroom.patch => 0056-Fix-cow-rotation-when-shearing-mooshroom.patch} (65%) rename patches/server/{0060-Fix-MC-121706.patch => 0057-Fix-MC-121706.patch} (100%) rename patches/server/{0061-Fix-MC-110386.patch => 0058-Fix-MC-110386.patch} (96%) rename patches/server/{0062-Fix-MC-31819.patch => 0059-Fix-MC-31819.patch} (93%) rename patches/server/{0063-Fix-MC-26304.patch => 0060-Fix-MC-26304.patch} (89%) rename patches/server/{0064-Make-arrow-movement-resetting-despawn-counter-config.patch => 0061-Make-arrow-movement-resetting-despawn-counter-config.patch} (94%) rename patches/server/{0065-Make-logging-login-locations-configurable.patch => 0062-Make-logging-login-locations-configurable.patch} (76%) rename patches/server/{0066-Reduce-array-allocations.patch => 0063-Reduce-array-allocations.patch} (64%) rename patches/server/{0067-Optimize-sun-burn-tick.patch => 0064-Optimize-sun-burn-tick.patch} (92%) rename patches/server/{0068-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch => 0065-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch} (100%) rename patches/server/{0069-Replace-game-rules-map-with-optimized-collection.patch => 0066-Replace-game-rules-map-with-optimized-collection.patch} (57%) rename patches/server/{0070-Replace-AI-attributes-with-optimized-collections.patch => 0067-Replace-AI-attributes-with-optimized-collections.patch} (95%) rename patches/server/{0071-Replace-class-map-with-optimized-collection.patch => 0068-Replace-class-map-with-optimized-collection.patch} (100%) rename patches/server/{0072-Replace-instance-list-with-optimized-collection.patch => 0069-Replace-instance-list-with-optimized-collection.patch} (100%) rename patches/server/{0073-Replace-throttle-tracker-map-with-optimized-collecti.patch => 0070-Replace-throttle-tracker-map-with-optimized-collecti.patch} (100%) rename patches/server/{0074-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch => 0071-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch} (100%) rename patches/server/{0076-Replace-division-by-multiplication-in-CubePointRange.patch => 0072-Replace-division-by-multiplication-in-CubePointRange.patch} (100%) rename patches/server/{0077-Replace-parts-by-size-in-CubePointRange.patch => 0073-Replace-parts-by-size-in-CubePointRange.patch} (100%) rename patches/server/{0078-Check-frozen-ticks-before-landing-block.patch => 0074-Check-frozen-ticks-before-landing-block.patch} (88%) rename patches/server/{0079-Faster-chunk-serialization.patch => 0075-Faster-chunk-serialization.patch} (96%) rename patches/server/{0080-Update-boss-bar-within-tick.patch => 0076-Update-boss-bar-within-tick.patch} (94%) rename patches/{ => work}/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch (100%) rename patches/{ => work}/server/0075-Cache-BlockStatePairKey-hash.patch (100%) diff --git a/patches/server/0031-Remove-lambda-from-ticking-guard.patch b/patches/server/0029-Remove-lambda-from-ticking-guard.patch similarity index 93% rename from patches/server/0031-Remove-lambda-from-ticking-guard.patch rename to patches/server/0029-Remove-lambda-from-ticking-guard.patch index f0cb252..ab65e10 100644 --- a/patches/server/0031-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0029-Remove-lambda-from-ticking-guard.patch @@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4a5857f2454090fc87ecd1cc9d0a39c31918d197..a6ebe6bb04744a53937d729b9cec028463e19ac1 100644 +index ac903433a7ab524e1f65f23fa943ee0aeaf8fa6d..254c80c60bdeaf8d3b65777648f7e863a4480a31 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -717,7 +717,20 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf. +@@ -781,7 +781,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe entity.stopRiding(); } @@ -57,10 +57,10 @@ index 4a5857f2454090fc87ecd1cc9d0a39c31918d197..a6ebe6bb04744a53937d729b9cec0284 } } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index a48b1639ffa83ae2d1e614d32a339f08366da57c..d756e2ac71eced0de81b921f3215f51600b6b768 100644 +index f40d3ef570eb7d079d30f88470d95b3de12695ee..15f3c2dd02dad613c272382dec3639819c2d7d56 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1432,15 +1432,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1487,15 +1487,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl try { tickConsumer.accept(entity); } catch (Throwable throwable) { diff --git a/patches/server/0033-SIMD-support.patch b/patches/server/0030-SIMD-support.patch similarity index 92% rename from patches/server/0033-SIMD-support.patch rename to patches/server/0030-SIMD-support.patch index 8b24383..5181fd7 100644 --- a/patches/server/0033-SIMD-support.patch +++ b/patches/server/0030-SIMD-support.patch @@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/build.gradle.kts b/build.gradle.kts -index badd1433e27e2e95b165618de280cba1ff10a69d..5ebc35cadc960d428e8a91642ddce0875078d790 100644 +index ead700089f8867e38699db409c13162f1014f58a..a19a0ecf3a6af07b0f7fe687e7fada392f37a4d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -78,6 +78,7 @@ tasks.withType { @@ -33,10 +33,10 @@ index badd1433e27e2e95b165618de280cba1ff10a69d..5ebc35cadc960d428e8a91642ddce087 doFirst { workingDir.mkdirs() diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 66477f772ffb9271cf647dfb7567d75c3d5145fb..13a51c939b8bd17584a474217823150688af809f 100644 +index cb9e42fea57856f9ab649e33df26071db1b7790f..1f158ed7ed5c115e892311d5f72a9131659f9d65 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -933,6 +933,46 @@ public class Metrics { +@@ -936,6 +936,46 @@ public class Metrics { metrics.addCustomChart(new Metrics.DrilldownPie("gale_semantic_version", () -> semanticVersionMap)); // Gale end - semantic version - include in metrics @@ -84,19 +84,19 @@ index 66477f772ffb9271cf647dfb7567d75c3d5145fb..13a51c939b8bd17584a4742178231506 } diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 8538024c6345e79d08643e2d68ca146542b7860a..94e86acd4bc9c2be7c07fbd17364ba7bf9edb094 100644 +index 7c3e5d77a63b433c3212c8aab5a37d2af5634091..8ff28f6f40f35e6523ec6fac2d5f0de7c84630c5 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -20,6 +20,8 @@ import java.util.Locale; +@@ -19,6 +19,8 @@ import java.util.List; + import java.util.Locale; import java.util.Optional; - import java.util.function.BooleanSupplier; import javax.annotation.Nullable; + +import gg.pufferfish.pufferfish.simd.SIMDDetection; import net.minecraft.DefaultUncaughtExceptionHandler; import net.minecraft.DefaultUncaughtExceptionHandlerWithName; import net.minecraft.SharedConstants; -@@ -58,6 +60,7 @@ import net.minecraft.world.level.GameType; +@@ -57,6 +59,7 @@ import net.minecraft.world.level.GameType; import net.minecraft.world.level.block.entity.SkullBlockEntity; import net.minecraft.world.level.storage.LevelStorageSource; import org.galemc.gale.command.GaleCommands; @@ -104,7 +104,7 @@ index 8538024c6345e79d08643e2d68ca146542b7860a..94e86acd4bc9c2be7c07fbd17364ba7b import org.slf4j.Logger; // CraftBukkit start -@@ -246,6 +249,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -243,6 +246,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now diff --git a/patches/server/0034-Make-book-writing-configurable.patch b/patches/server/0031-Make-book-writing-configurable.patch similarity index 84% rename from patches/server/0034-Make-book-writing-configurable.patch rename to patches/server/0031-Make-book-writing-configurable.patch index c18ed49..82e5e0d 100644 --- a/patches/server/0034-Make-book-writing-configurable.patch +++ b/patches/server/0031-Make-book-writing-configurable.patch @@ -22,24 +22,15 @@ you to easily disable books, should you want to preemptively remove this functionality before additional exploits are found. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index fcccf989c25f0a259b160c4ff7873f7009e64d14..793967c558feaf35de8043f26318ef9707bf8e1c 100644 +index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..c13aadf03462faf04bf0fc50525a130112debdff 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -193,6 +193,8 @@ import net.minecraft.world.phys.Vec3; - import net.minecraft.world.phys.shapes.BooleanOp; - import net.minecraft.world.phys.shapes.Shapes; - import net.minecraft.world.phys.shapes.VoxelShape; -+import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; -+import org.galemc.gale.configuration.GaleGlobalConfiguration; - import org.slf4j.Logger; - - // CraftBukkit start -@@ -1157,6 +1159,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1172,6 +1172,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @Override public void handleEditBook(ServerboundEditBookPacket packet) { + // Gale start - Pufferfish - make book writing configurable -+ if (!(GaleGlobalConfiguration.get().gameplayMechanics.enableBookWriting || this.player.getBukkitEntity().hasPermission(CraftDefaultPermissions.writeBooks) || this.player.getBukkitEntity().hasPermission("pufferfish.usebooks"))) { ++ if (!(org.galemc.gale.configuration.GaleGlobalConfiguration.get().gameplayMechanics.enableBookWriting || this.player.getBukkitEntity().hasPermission(org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions.writeBooks) || this.player.getBukkitEntity().hasPermission("pufferfish.usebooks"))) { + return; + } + // Gale end - Pufferfish - make book writing configurable diff --git a/patches/server/0035-Optimize-entity-coordinate-key.patch b/patches/server/0032-Optimize-entity-coordinate-key.patch similarity index 93% rename from patches/server/0035-Optimize-entity-coordinate-key.patch rename to patches/server/0032-Optimize-entity-coordinate-key.patch index cf92b5b..297bdcf 100644 --- a/patches/server/0035-Optimize-entity-coordinate-key.patch +++ b/patches/server/0032-Optimize-entity-coordinate-key.patch @@ -35,10 +35,10 @@ index 31b92bd48828cbea25b44a9f0f96886347aa1ae6..036c1a287db04c0191e5f84b027ea68d public static long getChunkKey(final ChunkPos pos) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b77c6dd82273af34f4633e2b002122313c570d56..135e3b8f131b0919b9c98fecf7383fff059db9d1 100644 +index dfaa2b671ec33f3e275b532f5adb20ce10205163..77d7fd1d521427d18c7aff978ade74280eaf4846 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -316,7 +316,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public double yo; public double zo; private Vec3 position; diff --git a/patches/server/0036-Reduce-in-wall-checks.patch b/patches/server/0033-Reduce-in-wall-checks.patch similarity index 84% rename from patches/server/0036-Reduce-in-wall-checks.patch rename to patches/server/0033-Reduce-in-wall-checks.patch index 2620e0e..97b5ba9 100644 --- a/patches/server/0036-Reduce-in-wall-checks.patch +++ b/patches/server/0033-Reduce-in-wall-checks.patch @@ -28,22 +28,22 @@ but is so much cheaper than the suffocation check that it's worth keeping it. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 94d9ec424e549be4874e35e31b1c0ac115b89e39..e5df16e415d6c8dc8547a59af373ae2918ec42dc 100644 +index 206a1461178706e56f4b3c92c9121dd4177edd4c..244857d69b52e1689d932cab914ed8c1331e96d3 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -447,7 +447,10 @@ public abstract class LivingEntity extends Entity implements Attackable { - boolean flag = this instanceof net.minecraft.world.entity.player.Player; +@@ -463,7 +463,10 @@ public abstract class LivingEntity extends Entity implements Attackable { - if (!this.level().isClientSide) { + if (world1 instanceof ServerLevel) { + worldserver1 = (ServerLevel) world1; - if (this.isInWall()) { + // Gale start - Pufferfish - reduce in wall checks + long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall; + if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { + // Gale end - Pufferfish - reduce in wall checks - this.hurt(this.damageSources().inWall(), 1.0F); + this.hurtServer(worldserver1, this.damageSources().inWall(), 1.0F); } else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) { - double d0 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone(); -@@ -1406,6 +1409,15 @@ public abstract class LivingEntity extends Entity implements Attackable { + double d1 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone(); +@@ -1432,6 +1435,15 @@ public abstract class LivingEntity extends Entity implements Attackable { return this.getHealth() <= 0.0F; } @@ -57,8 +57,8 @@ index 94d9ec424e549be4874e35e31b1c0ac115b89e39..e5df16e415d6c8dc8547a59af373ae29 + // Gale end - Pufferfish - reduce in wall checks + @Override - public boolean hurt(DamageSource source, float amount) { - if (this.isInvulnerableTo(source)) { + public boolean hurtServer(ServerLevel world, DamageSource source, float amount) { + if (this.isInvulnerableTo(world, source)) { diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java index 8a0416775d00148bf3478b51d92b00d9d485c667..08a02055b535c024cc806db17bb45fd333a56929 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/patches/server/0037-Make-chat-order-verification-configurable.patch b/patches/server/0034-Make-chat-order-verification-configurable.patch similarity index 100% rename from patches/server/0037-Make-chat-order-verification-configurable.patch rename to patches/server/0034-Make-chat-order-verification-configurable.patch diff --git a/patches/server/0038-Make-ender-dragon-respawn-attempt-after-placing-end-.patch b/patches/server/0035-Make-ender-dragon-respawn-attempt-after-placing-end-.patch similarity index 97% rename from patches/server/0038-Make-ender-dragon-respawn-attempt-after-placing-end-.patch rename to patches/server/0035-Make-ender-dragon-respawn-attempt-after-placing-end-.patch index fac503a..9006a31 100644 --- a/patches/server/0038-Make-ender-dragon-respawn-attempt-after-placing-end-.patch +++ b/patches/server/0035-Make-ender-dragon-respawn-attempt-after-placing-end-.patch @@ -26,7 +26,7 @@ search to attempt respawning the ender dragon whenever a player places an end crystal. diff --git a/src/main/java/net/minecraft/world/item/EndCrystalItem.java b/src/main/java/net/minecraft/world/item/EndCrystalItem.java -index 5f51e64cb0611a4ba6bdcdcacbcba1063a7f3a5c..50312825fade96ccc8c1231ca1eaf6c36d892746 100644 +index b62db8c7c8c57e43869ee239ebf4b02f112355d9..9f92b9addaedb4bae06b32226a74c8e5ddc6c2a2 100644 --- a/src/main/java/net/minecraft/world/item/EndCrystalItem.java +++ b/src/main/java/net/minecraft/world/item/EndCrystalItem.java @@ -55,11 +55,13 @@ public class EndCrystalItem extends Item { diff --git a/patches/server/0039-Make-saving-fireworks-configurable.patch b/patches/server/0036-Make-saving-fireworks-configurable.patch similarity index 93% rename from patches/server/0039-Make-saving-fireworks-configurable.patch rename to patches/server/0036-Make-saving-fireworks-configurable.patch index a98e556..7609b5d 100644 --- a/patches/server/0039-Make-saving-fireworks-configurable.patch +++ b/patches/server/0036-Make-saving-fireworks-configurable.patch @@ -20,10 +20,10 @@ launcher can very easily fill a chunk. Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case. diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -index 09d465947a5720e05c350d455c86002682104079..6c5f67138af166b87e588664b22198cbf3285c73 100644 +index 8a4e7e1c0c4919d2ee34121c14f9665b9ad95273..7bd7045128f1f55a687047eafd895971ec12e565 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -@@ -358,4 +358,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { +@@ -381,4 +381,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { return DoubleDoubleImmutablePair.of(d0, d1); } diff --git a/patches/server/0040-Reduce-hopper-item-checks.patch b/patches/server/0037-Reduce-hopper-item-checks.patch similarity index 89% rename from patches/server/0040-Reduce-hopper-item-checks.patch rename to patches/server/0037-Reduce-hopper-item-checks.patch index 2189887..0bbc7c0 100644 --- a/patches/server/0040-Reduce-hopper-item-checks.patch +++ b/patches/server/0037-Reduce-hopper-item-checks.patch @@ -17,25 +17,18 @@ Licensed under: MIT (https://opensource.org/licenses/MIT) Only do an item "suck in" action once per second diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 4423973d4d9a2c3879d98d1d4c8b8c117c677ac5..adbe1c6aad0abe367280b75c4d6691ac5e26bc30 100644 +index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..cf8efbb5df9a2142c403fd3972b6b4124fcd81ad 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -22,12 +22,14 @@ import net.minecraft.world.entity.EntityType; +@@ -12,6 +12,7 @@ import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.MoverType; import net.minecraft.world.entity.SlotAccess; import net.minecraft.world.entity.TraceableEntity; +import net.minecraft.world.entity.vehicle.MinecartHopper; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; - import net.minecraft.world.item.Items; - import net.minecraft.world.level.Level; - import net.minecraft.world.level.gameevent.GameEvent; - import net.minecraft.world.level.portal.DimensionTransition; -+import net.minecraft.world.phys.AABB; - import net.minecraft.world.phys.Vec3; - // CraftBukkit start - import net.minecraft.server.MinecraftServer; -@@ -233,11 +235,31 @@ public class ItemEntity extends Entity implements TraceableEntity { + import net.minecraft.world.level.Explosion; +@@ -234,11 +235,31 @@ public class ItemEntity extends Entity implements TraceableEntity { } // CraftBukkit end this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause @@ -54,7 +47,7 @@ index 4423973d4d9a2c3879d98d1d4c8b8c117c677ac5..adbe1c6aad0abe367280b75c4d6691ac + return; + } + if (config.temporaryImmunity.duration > 0 && this.isAlive() && this.onGround && !this.isRemoved() && (config.temporaryImmunity.nearbyItemMaxAge == -1 || this.age <= config.temporaryImmunity.nearbyItemMaxAge) && this.age % Math.max(1, config.temporaryImmunity.checkForMinecartNearItemInterval) == 0 && config.temporaryImmunity.maxItemHorizontalDistance >= 0 && config.temporaryImmunity.maxItemVerticalDistance >= 0) { -+ AABB aabb = this.getBoundingBox().inflate(config.temporaryImmunity.maxItemHorizontalDistance, config.temporaryImmunity.maxItemVerticalDistance, config.temporaryImmunity.maxItemHorizontalDistance); ++ net.minecraft.world.phys.AABB aabb = this.getBoundingBox().inflate(config.temporaryImmunity.maxItemHorizontalDistance, config.temporaryImmunity.maxItemVerticalDistance, config.temporaryImmunity.maxItemHorizontalDistance); + for (Entity entity : this.level().getEntities(this, aabb)) { + if (entity instanceof MinecartHopper) { + ((MinecartHopper) entity).pickupImmunity = MinecraftServer.currentTick + config.temporaryImmunity.duration; @@ -67,7 +60,7 @@ index 4423973d4d9a2c3879d98d1d4c8b8c117c677ac5..adbe1c6aad0abe367280b75c4d6691ac // Spigot start - copied from above @Override public void inactiveTick() { -@@ -258,7 +280,13 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -259,7 +280,13 @@ public class ItemEntity extends Entity implements TraceableEntity { } // CraftBukkit end this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause @@ -82,18 +75,18 @@ index 4423973d4d9a2c3879d98d1d4c8b8c117c677ac5..adbe1c6aad0abe367280b75c4d6691ac // Spigot end diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java -index d7f8464bf3eed0e42a5fc7f14a5b243d171f8b5e..7b69243130829334c1a592026adf8fce3609f25c 100644 +index d81a6874e8b25f098df619f84c359e146c7f64de..f799c993754802583f9b9c0cf8c7220bebd92f8d 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java -@@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState; - +@@ -21,6 +21,7 @@ import net.minecraft.world.level.block.state.properties.RailShape; public class MinecartHopper extends AbstractMinecartContainer implements Hopper { private boolean enabled = true; + private boolean consumedItemThisFrame = false; + public int pickupImmunity = 0; // Gale - EMC - reduce hopper item checks public MinecartHopper(EntityType type, Level world) { super(type, world); -@@ -136,4 +137,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper +@@ -149,4 +150,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper } // Paper end @@ -120,7 +113,7 @@ index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2 double getLevelY(); diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index cab403efd471bb61835224eea4e99570d34dcaaa..99fc84e10a10f3d4eededd6ce7be7700e3c3a8e4 100644 +index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..c893eecf67c65d68298da0c607f3b9b3df22a198 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -11,6 +11,7 @@ import net.minecraft.core.NonNullList; diff --git a/patches/server/0041-Reduce-villager-item-re-pickup.patch b/patches/server/0038-Reduce-villager-item-re-pickup.patch similarity index 100% rename from patches/server/0041-Reduce-villager-item-re-pickup.patch rename to patches/server/0038-Reduce-villager-item-re-pickup.patch diff --git a/patches/server/0042-Variable-entity-wake-up-duration.patch b/patches/server/0039-Variable-entity-wake-up-duration.patch similarity index 94% rename from patches/server/0042-Variable-entity-wake-up-duration.patch rename to patches/server/0039-Variable-entity-wake-up-duration.patch index 3d32775..7b81ca0 100644 --- a/patches/server/0042-Variable-entity-wake-up-duration.patch +++ b/patches/server/0039-Variable-entity-wake-up-duration.patch @@ -19,18 +19,18 @@ index 9ac3c235a7adc42af1ba22aaa4efbce5b006f98d..42306d45d3b8f7807b344422fca7382e } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index f83c2b35cc279666686be3af558473b5d93bf7cd..86b678aa745e125ceaa271deec00d6290a02d88b 100644 +index 24536f70309f802d45714e06bace339f1d9f1013..d3fd27647aca128aa651bcc07dacd77d326f51c1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -38,6 +38,7 @@ import co.aikar.timings.MinecraftTimings; - import net.minecraft.world.entity.schedule.Activity; +@@ -37,6 +37,7 @@ import net.minecraft.world.entity.projectile.ThrownTrident; + import net.minecraft.world.entity.raid.Raider; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; +import org.galemc.gale.configuration.GaleWorldConfiguration; public class ActivationRange { -@@ -70,28 +71,41 @@ public class ActivationRange +@@ -69,28 +70,41 @@ public class ActivationRange if (entity.activationType == ActivationType.VILLAGER) { if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) { world.wakeupInactiveRemainingVillagers--; diff --git a/patches/server/0043-Do-not-process-chat-commands-before-player-has-joine.patch b/patches/server/0040-Do-not-process-chat-commands-before-player-has-joine.patch similarity index 87% rename from patches/server/0043-Do-not-process-chat-commands-before-player-has-joine.patch rename to patches/server/0040-Do-not-process-chat-commands-before-player-has-joine.patch index 0ba2305..5d06344 100644 --- a/patches/server/0043-Do-not-process-chat-commands-before-player-has-joine.patch +++ b/patches/server/0040-Do-not-process-chat-commands-before-player-has-joine.patch @@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index adba25adaaf32c07e6844faec12bcab860eab194..978aa293c771c065a435d564e4355c837678a92b 100644 +index a0d940312e37d7b74df7103878ff547a45fc5c05..ada9814d24b32140f365eb01a231bc123d99c72e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -297,6 +297,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple +@@ -322,6 +322,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready @@ -25,10 +25,10 @@ index adba25adaaf32c07e6844faec12bcab860eab194..978aa293c771c065a435d564e4355c83 public boolean isRealPlayer; // Paper public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f51939adef4f69d4f8c4a0ec9b9aee55e7a2ec34..621c60e7818f1edc11d9ca1be20097fbb6a0b02f 100644 +index c13aadf03462faf04bf0fc50525a130112debdff..ad53a045efaa6ed44a5b345586366b7c50e5688a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2364,7 +2364,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2385,7 +2385,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnectAsync((Component) Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper // Paper - add proper async disconnect } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); @@ -38,10 +38,10 @@ index f51939adef4f69d4f8c4a0ec9b9aee55e7a2ec34..621c60e7818f1edc11d9ca1be20097fb // CraftBukkit start if (sync) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5e2c4969e77c669acbb4a13c07033cb267c3d586..cce00b627b905793f8c663dc62e74fac895e618d 100644 +index 30de3d1a7792c38ae946f19cb0e14637919b5001..0e2b903dbd783bea891b88902136e1ac9f7fd66c 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -350,6 +350,8 @@ public abstract class PlayerList { +@@ -353,6 +353,8 @@ public abstract class PlayerList { return; } diff --git a/patches/server/0044-Do-not-log-invalid-statistics.patch b/patches/server/0041-Do-not-log-invalid-statistics.patch similarity index 97% rename from patches/server/0044-Do-not-log-invalid-statistics.patch rename to patches/server/0041-Do-not-log-invalid-statistics.patch index 9494969..baeb49c 100644 --- a/patches/server/0044-Do-not-log-invalid-statistics.patch +++ b/patches/server/0041-Do-not-log-invalid-statistics.patch @@ -13,7 +13,7 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft) Licensed under: MIT (https://opensource.org/licenses/MIT) diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java -index fb7342f7a5008a283c3400c6313c637de8210dfa..a45353b8a6dd85c74d3e195f89f75f2509d579ad 100644 +index da7e1a69ecb4e6b3be2d8544ac406aa519bd196e..cb6dbdca0f6a858e2f62d7e71ddd7f69ff710d70 100644 --- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java +++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java @@ -36,6 +36,7 @@ import net.minecraft.server.level.ServerPlayer; diff --git a/patches/server/0045-Do-not-log-empty-message-warnings.patch b/patches/server/0042-Do-not-log-empty-message-warnings.patch similarity index 70% rename from patches/server/0045-Do-not-log-empty-message-warnings.patch rename to patches/server/0042-Do-not-log-empty-message-warnings.patch index 3c941cc..65ad030 100644 --- a/patches/server/0045-Do-not-log-empty-message-warnings.patch +++ b/patches/server/0042-Do-not-log-empty-message-warnings.patch @@ -7,23 +7,15 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 2da5284b446d3dd72fcac38e0bc77db99f265567..71478e620198f373ad92cf40a49ecbfb14fd326e 100644 +index ad53a045efaa6ed44a5b345586366b7c50e5688a..25e91c5e5f5cf1a9dbb2931b964c754408926788 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -194,6 +194,7 @@ import net.minecraft.world.phys.shapes.BooleanOp; - import net.minecraft.world.phys.shapes.Shapes; - import net.minecraft.world.phys.shapes.VoxelShape; - import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; -+import org.apache.commons.lang3.StringUtils; - import org.galemc.gale.configuration.GaleGlobalConfiguration; - import org.slf4j.Logger; - -@@ -2522,7 +2523,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2543,7 +2543,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl // CraftBukkit start String s = message.signedContent(); if (s.isEmpty()) { - ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); -+ if (GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); // Gale - do not log empty message warnings ++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.chat.emptyMessageWarning) ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message"); // Gale - do not log empty message warnings } else if (this.getCraftPlayer().isConversing()) { final String conversationInput = s; this.server.processQueue.add(new Runnable() { diff --git a/patches/server/0046-Do-not-log-ignored-advancements.patch b/patches/server/0043-Do-not-log-ignored-advancements.patch similarity index 97% rename from patches/server/0046-Do-not-log-ignored-advancements.patch rename to patches/server/0043-Do-not-log-ignored-advancements.patch index c472163..0a1cd57 100644 --- a/patches/server/0046-Do-not-log-ignored-advancements.patch +++ b/patches/server/0043-Do-not-log-ignored-advancements.patch @@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 862a4bf003b7f810fb57dbcd150a1417c902b633..c4a5f744c089a7ef1ffbb3a19379fb510fb54af3 100644 +index 8e2eb7b61421ceb063654826941f1a81f6f50bdf..bd29a4dd0e6d403937c16a7b822e0e6865db8be4 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -45,6 +45,7 @@ import net.minecraft.server.level.ServerPlayer; diff --git a/patches/server/0047-Do-not-log-setBlock-in-far-chunks.patch b/patches/server/0044-Do-not-log-setBlock-in-far-chunks.patch similarity index 97% rename from patches/server/0047-Do-not-log-setBlock-in-far-chunks.patch rename to patches/server/0044-Do-not-log-setBlock-in-far-chunks.patch index e0041cc..a51b15d 100644 --- a/patches/server/0047-Do-not-log-setBlock-in-far-chunks.patch +++ b/patches/server/0044-Do-not-log-setBlock-in-far-chunks.patch @@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index 5a8a33638ceb1d980ffc3e6dd86e7eb11dfd9375..4ec094e06e7707a052f3647871f7d14183e8978f 100644 +index e4b0dc3121101d54394a0c3a413dabf8103b2ea6..4212d2522a0619267902c8230d424495378ee743 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -336,6 +336,7 @@ public class WorldGenRegion implements WorldGenLevel { diff --git a/patches/server/0048-Do-not-log-unrecognized-recipes.patch b/patches/server/0045-Do-not-log-unrecognized-recipes.patch similarity index 74% rename from patches/server/0048-Do-not-log-unrecognized-recipes.patch rename to patches/server/0045-Do-not-log-unrecognized-recipes.patch index 14a5ca9..4e587f9 100644 --- a/patches/server/0048-Do-not-log-unrecognized-recipes.patch +++ b/patches/server/0045-Do-not-log-unrecognized-recipes.patch @@ -37,25 +37,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java -index 8a2584deccbf19de8a18fcfcb9c65318b60afe57..457d774dbfd441abfb108e0a11e675fadcd55092 100644 +index 5c7484ce2850a2eb698a2183b81134b89b0bbcc7..deab78ef1a751d4d01e1ab45864e5ead3a320ad7 100644 --- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java +++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java -@@ -18,6 +18,7 @@ import net.minecraft.resources.ResourceLocation; - import net.minecraft.server.level.ServerPlayer; - import net.minecraft.world.item.crafting.RecipeHolder; - import net.minecraft.world.item.crafting.RecipeManager; -+import org.galemc.gale.configuration.GaleGlobalConfiguration; - import org.slf4j.Logger; +@@ -159,7 +159,7 @@ public class ServerRecipeBook extends RecipeBook { + ResourceKey> resourcekey = ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(s)); - import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit -@@ -125,7 +126,7 @@ public class ServerRecipeBook extends RecipeBook { - Optional> optional = recipeManager.byKey(minecraftkey); - - if (optional.isEmpty()) { -- ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey); -+ if (GaleGlobalConfiguration.get().logToConsole.unrecognizedRecipes) ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey); // Gale - Purpur - do not log unrecognized recipes + if (!validPredicate.test(resourcekey)) { +- ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourcekey); ++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.unrecognizedRecipes) ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourcekey); // Gale - Purpur - do not log unrecognized recipes } else { - handler.accept((RecipeHolder) optional.get()); + handler.accept(resourcekey); } diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java index 0844babd79d3743abe240e68a50e082f58e2f01c..360c48ce9f64e7bbfadd56ce4fa2b78c4787734d 100644 diff --git a/patches/server/0049-Do-not-log-legacy-Material-initialization.patch b/patches/server/0046-Do-not-log-legacy-Material-initialization.patch similarity index 97% rename from patches/server/0049-Do-not-log-legacy-Material-initialization.patch rename to patches/server/0046-Do-not-log-legacy-Material-initialization.patch index b5e6ac7..983e1b5 100644 --- a/patches/server/0049-Do-not-log-legacy-Material-initialization.patch +++ b/patches/server/0046-Do-not-log-legacy-Material-initialization.patch @@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -index dc591702d1ad41209bb80e8d05f4ca11f20816f2..38a5b11d52ffcd1e3f7ffe8d617e7d3fd93f07c6 100644 +index 51ae8eddadc87b143b93521a3cef374f1e3a24dc..847d5f5366b5f3b50ef84e2861968ccf81dfe58d 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java @@ -31,6 +31,7 @@ import org.bukkit.Material; diff --git a/patches/server/0050-Do-not-log-plugin-library-loads.patch b/patches/server/0047-Do-not-log-plugin-library-loads.patch similarity index 100% rename from patches/server/0050-Do-not-log-plugin-library-loads.patch rename to patches/server/0047-Do-not-log-plugin-library-loads.patch diff --git a/patches/server/0051-Do-not-log-expired-message-warnings.patch b/patches/server/0048-Do-not-log-expired-message-warnings.patch similarity index 100% rename from patches/server/0051-Do-not-log-expired-message-warnings.patch rename to patches/server/0048-Do-not-log-expired-message-warnings.patch diff --git a/patches/server/0052-Do-not-log-Not-Secure-marker.patch b/patches/server/0049-Do-not-log-Not-Secure-marker.patch similarity index 96% rename from patches/server/0052-Do-not-log-Not-Secure-marker.patch rename to patches/server/0049-Do-not-log-Not-Secure-marker.patch index b7283f7..6a256a8 100644 --- a/patches/server/0052-Do-not-log-Not-Secure-marker.patch +++ b/patches/server/0049-Do-not-log-Not-Secure-marker.patch @@ -29,7 +29,7 @@ index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..f962e82e2c70f328a23dc99193d072f8 } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cce00b627b905793f8c663dc62e74fac895e618d..1c4051cb47fc2e070cef363bd670dff35baff35b 100644 +index 0e2b903dbd783bea891b88902136e1ac9f7fd66c..de5c66b2d30dd6f00d2e81e6ffd7915875d98cbb 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -102,6 +102,7 @@ import net.minecraft.world.phys.Vec3; @@ -40,7 +40,7 @@ index cce00b627b905793f8c663dc62e74fac895e618d..1c4051cb47fc2e070cef363bd670dff3 import org.slf4j.Logger; // CraftBukkit start -@@ -1397,7 +1398,7 @@ public abstract class PlayerList { +@@ -1361,7 +1362,7 @@ public abstract class PlayerList { // Paper end boolean flag = this.verifyChatTrusted(message); diff --git a/patches/server/0053-Do-not-log-disconnections-with-null-id.patch b/patches/server/0050-Do-not-log-disconnections-with-null-id.patch similarity index 97% rename from patches/server/0053-Do-not-log-disconnections-with-null-id.patch rename to patches/server/0050-Do-not-log-disconnections-with-null-id.patch index 2c40b3c..7140f43 100644 --- a/patches/server/0053-Do-not-log-disconnections-with-null-id.patch +++ b/patches/server/0050-Do-not-log-disconnections-with-null-id.patch @@ -17,7 +17,7 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) This can help to hide annoying scanning bots from showing up in console. diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 40638b439966619e9c70a18a32abd95b2178fe9f..2754e5dda2bc50bff302cb569803bc8f1f04a9db 100644 +index 033755682c61c889723c3669b5cff4de147f637e..e2c527456e277d27baff558d59234263eef5ecac 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -44,6 +44,7 @@ import net.minecraft.util.CryptException; diff --git a/patches/server/0054-Do-not-log-run-as-root-warning.patch b/patches/server/0051-Do-not-log-run-as-root-warning.patch similarity index 94% rename from patches/server/0054-Do-not-log-run-as-root-warning.patch rename to patches/server/0051-Do-not-log-run-as-root-warning.patch index 03d0462..5fad351 100644 --- a/patches/server/0054-Do-not-log-run-as-root-warning.patch +++ b/patches/server/0051-Do-not-log-run-as-root-warning.patch @@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 94e86acd4bc9c2be7c07fbd17364ba7bf9edb094..8cbad64897ea764a10f044cabb8f77ffbcb3a7a0 100644 +index 8ff28f6f40f35e6523ec6fac2d5f0de7c84630c5..b62b9ced6de729d2646b5ba7091ede14858a4d65 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -201,7 +201,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -198,7 +198,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface } // Paper start - detect running as root diff --git a/patches/server/0055-Do-not-log-offline-mode-warning.patch b/patches/server/0052-Do-not-log-offline-mode-warning.patch similarity index 94% rename from patches/server/0055-Do-not-log-offline-mode-warning.patch rename to patches/server/0052-Do-not-log-offline-mode-warning.patch index 1438817..25a3343 100644 --- a/patches/server/0055-Do-not-log-offline-mode-warning.patch +++ b/patches/server/0052-Do-not-log-offline-mode-warning.patch @@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 8cbad64897ea764a10f044cabb8f77ffbcb3a7a0..30ddaba93a1b2bb228a9fcdf25e8abab036d9f38 100644 +index b62b9ced6de729d2646b5ba7091ede14858a4d65..6478728a80f2cc207b89980ef8908dc0f473476c 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -@@ -314,7 +314,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -311,7 +311,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord"; String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/"; // Paper end - Add Velocity IP Forwarding Support diff --git a/patches/server/0056-Softly-log-invalid-pool-element-errors.patch b/patches/server/0053-Softly-log-invalid-pool-element-errors.patch similarity index 100% rename from patches/server/0056-Softly-log-invalid-pool-element-errors.patch rename to patches/server/0053-Softly-log-invalid-pool-element-errors.patch diff --git a/patches/server/0057-Fix-outdated-server-showing-in-ping-before-server-fu.patch b/patches/server/0054-Fix-outdated-server-showing-in-ping-before-server-fu.patch similarity index 100% rename from patches/server/0057-Fix-outdated-server-showing-in-ping-before-server-fu.patch rename to patches/server/0054-Fix-outdated-server-showing-in-ping-before-server-fu.patch diff --git a/patches/server/0058-Fix-MC-238526.patch b/patches/server/0055-Fix-MC-238526.patch similarity index 96% rename from patches/server/0058-Fix-MC-238526.patch rename to patches/server/0055-Fix-MC-238526.patch index fe6afb9..3177f58 100644 --- a/patches/server/0058-Fix-MC-238526.patch +++ b/patches/server/0055-Fix-MC-238526.patch @@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -index c9cabb061ebc9172647304431cc3fb2593dd47ba..68375718c4c9ba46439e49cd82a5267aab150f97 100644 +index 8c4532a250f8679d729a35c17e9b5bd339264450..7cdf57f96539e8218b3834f3f24336f93cd6938c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -@@ -71,6 +71,6 @@ public abstract class WaterAnimal extends PathfinderMob { +@@ -74,6 +74,6 @@ public abstract class WaterAnimal extends PathfinderMob { i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i); j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j); // Paper end - Make water animal spawn height configurable diff --git a/patches/server/0059-Fix-cow-rotation-when-shearing-mooshroom.patch b/patches/server/0056-Fix-cow-rotation-when-shearing-mooshroom.patch similarity index 65% rename from patches/server/0059-Fix-cow-rotation-when-shearing-mooshroom.patch rename to patches/server/0056-Fix-cow-rotation-when-shearing-mooshroom.patch index 02e009a..12852ac 100644 --- a/patches/server/0059-Fix-cow-rotation-when-shearing-mooshroom.patch +++ b/patches/server/0056-Fix-cow-rotation-when-shearing-mooshroom.patch @@ -37,32 +37,25 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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 0c21959f57ae88fcd0a4d6dc911c1ce347c96528..5707c6287a691030841fa973e8f7f34a816103e4 100644 +index feeb7bc34ae02e44d7f13f0bae5d175ef924c53a..8ac72f18edaadba69652f8c2f7d672e81a5433da 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -@@ -196,12 +196,21 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder { + world.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5D), this.getZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D); ++ // Gale start - Purpur - fix cow rotation when shearing mooshroom ++ if (this.level().galeConfig().gameplayMechanics.fixes.keepMooshroomRotationAfterShearing) { ++ entitycow.copyPosition(this); ++ entitycow.yBodyRot = this.yBodyRot; ++ entitycow.setYHeadRot(this.getYHeadRot()); ++ entitycow.yRotO = this.yRotO; ++ entitycow.xRotO = this.xRotO; ++ } ++ // Gale end - Purpur - fix cow rotation when shearing mooshroom + // Paper start - custom shear drops; moved drop generation to separate method + drops.forEach(itemstack1 -> { + for (final ItemStack drop : drops) { diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java index fff9f552a9b3cc4913837077857c78826bf1bdb0..3fa354ceef3ec5ab9bca3f13f23aca586dfe09c4 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/patches/server/0060-Fix-MC-121706.patch b/patches/server/0057-Fix-MC-121706.patch similarity index 100% rename from patches/server/0060-Fix-MC-121706.patch rename to patches/server/0057-Fix-MC-121706.patch diff --git a/patches/server/0061-Fix-MC-110386.patch b/patches/server/0058-Fix-MC-110386.patch similarity index 96% rename from patches/server/0061-Fix-MC-110386.patch rename to patches/server/0058-Fix-MC-110386.patch index 4f6a7e4..b4eb70d 100644 --- a/patches/server/0061-Fix-MC-110386.patch +++ b/patches/server/0058-Fix-MC-110386.patch @@ -19,7 +19,7 @@ the second will join in the fight against itself, causing it to attack itself repeatedly. See https://bugs.mojang.com/browse/MC-110386. diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java -index 80ef4b6649da3049f21624926fa38595d76c5da5..7ce47abc44e0dfe8ff90afeb25b14d8d98e6b1cc 100644 +index edfc77ba9c5c7dc4cfe997faff7a34e9b9e9365e..6c72dd5774eccec68d29e04dfc344adb69840abf 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java @@ -114,6 +114,11 @@ public class HurtByTargetGoal extends TargetGoal { diff --git a/patches/server/0062-Fix-MC-31819.patch b/patches/server/0059-Fix-MC-31819.patch similarity index 93% rename from patches/server/0062-Fix-MC-31819.patch rename to patches/server/0059-Fix-MC-31819.patch index 8743fad..3cd5599 100644 --- a/patches/server/0062-Fix-MC-31819.patch +++ b/patches/server/0059-Fix-MC-31819.patch @@ -19,10 +19,10 @@ the displayed hunger bar never goes down. Hunger (or any related value, includin should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819. 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 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..81fdab6a5fbc39cb942f7b07a132a8f1ef18cb37 100644 +index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..7dc22be7e2afeafe0292648a9a20422c39833966 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1907,6 +1907,11 @@ public abstract class Player extends LivingEntity { +@@ -1853,6 +1853,11 @@ public abstract class Player extends LivingEntity { } public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) { diff --git a/patches/server/0063-Fix-MC-26304.patch b/patches/server/0060-Fix-MC-26304.patch similarity index 89% rename from patches/server/0063-Fix-MC-26304.patch rename to patches/server/0060-Fix-MC-26304.patch index 328c2d8..31242af 100644 --- a/patches/server/0063-Fix-MC-26304.patch +++ b/patches/server/0060-Fix-MC-26304.patch @@ -13,10 +13,10 @@ As part of: Mirai (https://github.com/etil2jz/Mirai) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -index 0a93bacd62249bae1800ff306b8a7c765b0e5a8b..55873f24a9170626504af109352b04e8bf1352f9 100644 +index 02fc9ce21c7d367055da350d21be4870d4242f3a..4571c2e4a6410c746ac7f34a709f5907ff3aa903 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -@@ -47,6 +47,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements +@@ -48,6 +48,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements public static final int DATA_BREW_TIME = 0; public static final int DATA_FUEL_USES = 1; public static final int NUM_DATA_VALUES = 2; @@ -24,7 +24,7 @@ index 0a93bacd62249bae1800ff306b8a7c765b0e5a8b..55873f24a9170626504af109352b04e8 private NonNullList items; public int brewTime; public int recipeBrewTime = 400; // Paper - Add recipeBrewTime -@@ -313,6 +314,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements +@@ -314,6 +315,22 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements } this.fuel = nbt.getByte("Fuel"); @@ -47,9 +47,9 @@ index 0a93bacd62249bae1800ff306b8a7c765b0e5a8b..55873f24a9170626504af109352b04e8 } @Override -@@ -321,6 +338,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements +@@ -322,6 +339,18 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements nbt.putShort("BrewTime", (short) this.brewTime); - ContainerHelper.saveAllItems(nbt, this.items, registryLookup); + ContainerHelper.saveAllItems(nbt, this.items, registries); nbt.putByte("Fuel", (byte) this.fuel); + // Gale start - Mirai - fix MC-26304 + if (this.ingredient != null && this.ingredient != Items.AIR) { diff --git a/patches/server/0064-Make-arrow-movement-resetting-despawn-counter-config.patch b/patches/server/0061-Make-arrow-movement-resetting-despawn-counter-config.patch similarity index 94% rename from patches/server/0064-Make-arrow-movement-resetting-despawn-counter-config.patch rename to patches/server/0061-Make-arrow-movement-resetting-despawn-counter-config.patch index 3f6bf01..bfa82c2 100644 --- a/patches/server/0064-Make-arrow-movement-resetting-despawn-counter-config.patch +++ b/patches/server/0061-Make-arrow-movement-resetting-despawn-counter-config.patch @@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 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 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..6b652424786841f147f1c55617defd0e2a994b5f 100644 +index accc246f441c8bf5e1a755cfc0db8f97c0c01c6b..5fbd0612f1d1b0961e03931c26036c74d8265bb3 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -356,7 +356,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -371,7 +371,7 @@ public abstract class AbstractArrow extends Projectile { Vec3 vec3d = this.getDeltaMovement(); this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); @@ -53,7 +53,7 @@ index 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..6b652424786841f147f1c55617defd0e + if (this.level().galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable } - @Override + public boolean isInGround() { diff --git a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java index e3e4459da020a85a66360e761adbf6e55920c6c5..f459d398cf9e274b8551540c8a1f707bd609ecb9 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleWorldConfiguration.java diff --git a/patches/server/0065-Make-logging-login-locations-configurable.patch b/patches/server/0062-Make-logging-login-locations-configurable.patch similarity index 76% rename from patches/server/0065-Make-logging-login-locations-configurable.patch rename to patches/server/0062-Make-logging-login-locations-configurable.patch index 6b546a5..6891318 100644 --- a/patches/server/0065-Make-logging-login-locations-configurable.patch +++ b/patches/server/0062-Make-logging-login-locations-configurable.patch @@ -13,23 +13,23 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 32999fcbee6252c208e67bcc17cfb8ebbaad4e5b..9b265924086edfdd29d155a94ad968d62c2fa924 100644 +index de5c66b2d30dd6f00d2e81e6ffd7915875d98cbb..51fc830e8cdae4a283480a06aae8525ac629273d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -483,7 +483,13 @@ public abstract class PlayerList { +@@ -422,7 +422,13 @@ public abstract class PlayerList { scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); } // Paper end - Configurable player collision -+ if (GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable ++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); -+ // Gale start - JettPack - make logging login location configurable ++ // Gale start - JettPack - make logging login location configurable + } else { + PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), s1, player.getId()); + } + // Gale end - JettPack - make logging login location configurable - } - - public void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) { + // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead + if (player.isDeadOrDying()) { + net.minecraft.core.Holder plains = worldserver1.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME) diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java index 3f8c66b35f1910df7d745056fd8f55d9b035b215..b0da100cf972d4e39b130c99550ebcc763f055ee 100644 --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/patches/server/0066-Reduce-array-allocations.patch b/patches/server/0063-Reduce-array-allocations.patch similarity index 64% rename from patches/server/0066-Reduce-array-allocations.patch rename to patches/server/0063-Reduce-array-allocations.patch index dfda349..7ed7c3f 100644 --- a/patches/server/0066-Reduce-array-allocations.patch +++ b/patches/server/0063-Reduce-array-allocations.patch @@ -13,42 +13,35 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java -index ba68998f6ef57b24c72fd833bd7de440de9501cc..0985fdc56db782d17657a09a628533927d6ec4b8 100644 +index 7fed43a1e7bcf35c4d7fd3224837a47fedd59860..adc47f1ca3580a6968d145239ae830734a0ebe4a 100644 --- a/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java +++ b/src/main/java/ca/spottedleaf/moonrise/common/list/EntityList.java @@ -18,9 +18,7 @@ public final class EntityList implements Iterable { this.entityToIndex.defaultReturnValue(Integer.MIN_VALUE); } -- protected static final Entity[] EMPTY_LIST = new Entity[0]; +- private static final Entity[] EMPTY_LIST = new Entity[0]; - -- protected Entity[] entities = EMPTY_LIST; -+ protected Entity[] entities = me.titaniumtown.ArrayConstants.emptyEntityArray; // Gale - JettPack - reduce array allocations - protected int count; +- private Entity[] entities = EMPTY_LIST; ++ private Entity[] entities = me.titaniumtown.ArrayConstants.emptyEntityArray; // Gale - JettPack - reduce array allocations + private int count; public int size() { -diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java -index fcfbca333234c09f7c056bbfcd9ac8860b20a8db..c780892d0043cbac80a62f5fbcc32ff41e4595d0 100644 ---- a/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java -+++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IBlockDataList.java -@@ -17,9 +17,7 @@ public final class IBlockDataList { - this.map.defaultReturnValue(Long.MAX_VALUE); +diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/IntList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/IntList.java +index 9f3b25bb2439f283f878db93973a02fcdcd14eed..4eb7bf187276f07f807fe181b303dda8e1b9196d 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/common/list/IntList.java ++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/IntList.java +@@ -10,9 +10,7 @@ public final class IntList { + this.map.defaultReturnValue(Integer.MIN_VALUE); } -- private static final long[] EMPTY_LIST = new long[0]; +- private static final int[] EMPTY_LIST = new int[0]; - -- private long[] byIndex = EMPTY_LIST; -+ private long[] byIndex = me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations - private int size; +- private int[] byIndex = EMPTY_LIST; ++ private int[] byIndex = me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations + private int count; - public static int getLocationKey(final int x, final int y, final int z) { -@@ -122,4 +120,4 @@ public final class IBlockDataList { - public LongIterator getRawIterator() { - return this.map.values().iterator(); - } --} -\ No newline at end of file -+} + public int size() { diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java index 2e876b918672e8ef3b5197b7e6b1597247fdeaa1..8df9406b77eb3c225ebf88bf76a7adb666452f3b 100644 --- a/src/main/java/ca/spottedleaf/moonrise/common/list/ReferenceList.java @@ -69,6 +62,21 @@ index 2e876b918672e8ef3b5197b7e6b1597247fdeaa1..8df9406b77eb3c225ebf88bf76a7adb6 } public ReferenceList(final E[] referenceArray) { +diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/ShortList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/ShortList.java +index 2bae9949ef325d0001aa638150fbbdf968367e75..a72d5db6f6a8667c5c839016033bba4d0f16cf13 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/common/list/ShortList.java ++++ b/src/main/java/ca/spottedleaf/moonrise/common/list/ShortList.java +@@ -10,9 +10,7 @@ public final class ShortList { + this.map.defaultReturnValue(Short.MIN_VALUE); + } + +- private static final short[] EMPTY_LIST = new short[0]; +- +- private short[] byIndex = EMPTY_LIST; ++ private short[] byIndex = me.titaniumtown.ArrayConstants.emptyShortArray; // Gale - JettPack - reduce array allocations + private short count; + + public int size() { diff --git a/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java b/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java index db92261a6cb3758391108361096417c61bc82cdc..1a14fddb36ca3c14d243304db629d0c5aac3906c 100644 --- a/src/main/java/ca/spottedleaf/moonrise/common/list/SortedList.java @@ -90,44 +98,34 @@ index db92261a6cb3758391108361096417c61bc82cdc..1a14fddb36ca3c14d243304db629d0c5 public SortedList(final E[] elements, final Comparator comparator) { diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java -index 5c7f2471a0b15ac2e714527296ad2aa7291999eb..7be7963dc0a59ed64ef635a2e94adb6c534a53e8 100644 +index b3c993a790fc3fab6a408c731deb297f74c959ce..e85a33c477e46f5b4633c0e87cfddcca669a0da7 100644 --- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java +++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java -@@ -187,7 +187,7 @@ public final class ChunkEntitySlices { - } - } +@@ -387,7 +387,7 @@ public final class ChunkEntitySlices { -- return ret.toArray(new org.bukkit.entity.Entity[0]); -+ return ret.toArray(me.titaniumtown.ArrayConstants.emptyBukkitEntityArray); // Gale - JettPack - reduce array allocations - } + private static final class BasicEntityList { - public void callEntitiesLoadEvent() { -diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java -index 748ab4d637ce463272bae4fdbab6842a27385126..6a3f1d5362b29db321d6c03d0f5ab5e6c915a02d 100644 ---- a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java -+++ b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/CollisionUtil.java -@@ -1113,7 +1113,7 @@ public final class CollisionUtil { - } +- private static final Entity[] EMPTY = new Entity[0]; ++ private static final Entity[] EMPTY = me.titaniumtown.ArrayConstants.emptyEntityArray; // Gale - JettPack - reduce array allocations + private static final int DEFAULT_CAPACITY = 4; - private static final ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.MergedVoxelCoordinateList EMPTY = new ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.MergedVoxelCoordinateList( -- new double[] { 0.0 }, 0.0, new int[0], new int[0], 0 -+ new double[] { 0.0 }, 0.0, me.titaniumtown.ArrayConstants.emptyIntArray, me.titaniumtown.ArrayConstants.emptyIntArray, 0 // Gale - JettPack - reduce array allocations - ); + private E[] storage; +diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java +index 58d9187adc188b693b6becc400f766e069bf1bf5..e3de64c7e7699547b7470080ff85efc5fbc6c2ee 100644 +--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java ++++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java +@@ -15,10 +15,8 @@ import net.minecraft.world.level.entity.LevelCallback; - private static int[] getIndices(final int length) { -diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/util/EmptyStreamForMoveCall.java b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/util/EmptyStreamForMoveCall.java -index 673103f160cbe577c6e05f998706af4e6850011b..2c1eb34f1539555ba1988a2eeeea7b2f59eb610c 100644 ---- a/src/main/java/ca/spottedleaf/moonrise/patches/collisions/util/EmptyStreamForMoveCall.java -+++ b/src/main/java/ca/spottedleaf/moonrise/patches/collisions/util/EmptyStreamForMoveCall.java -@@ -102,7 +102,7 @@ public final class EmptyStreamForMoveCall implements java.util.stream.Stream< - @org.jetbrains.annotations.NotNull - @Override - public Object[] toArray() { -- return new Object[0]; -+ return me.titaniumtown.ArrayConstants.emptyObjectArray; // Gale - JettPack - reduce array allocations - } + public final class ServerEntityLookup extends EntityLookup { - @org.jetbrains.annotations.NotNull +- private static final Entity[] EMPTY_ENTITY_ARRAY = new Entity[0]; +- + private final ServerLevel serverWorld; +- public final ReferenceList trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker ++ public final ReferenceList trackerEntities = new ReferenceList<>(me.titaniumtown.ArrayConstants.emptyEntityArray); // Moonrise - entity tracker // Gale - JettPack - reduce array allocations + + public ServerEntityLookup(final ServerLevel world, final LevelCallback worldCallback) { + super(world, worldCallback); diff --git a/src/main/java/io/papermc/paper/command/brigadier/PaperCommands.java b/src/main/java/io/papermc/paper/command/brigadier/PaperCommands.java index 95d3b42cbe2184b0a04d941f27f7a6e643ef59be..e0dad3b61402b309084a464bc3dfdb80043e69eb 100644 --- a/src/main/java/io/papermc/paper/command/brigadier/PaperCommands.java @@ -156,10 +154,10 @@ index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..89562a86cd33ea2b55b284f77dc5d903 } diff --git a/src/main/java/me/titaniumtown/ArrayConstants.java b/src/main/java/me/titaniumtown/ArrayConstants.java new file mode 100644 -index 0000000000000000000000000000000000000000..360fdd754849511909c04cb05f8b0a8111b1ad8d +index 0000000000000000000000000000000000000000..211c5b080919e6e6c360c274963bc6396cd82cff --- /dev/null +++ b/src/main/java/me/titaniumtown/ArrayConstants.java -@@ -0,0 +1,18 @@ +@@ -0,0 +1,19 @@ +// Gale - JettPack - reduce array allocations + +package me.titaniumtown; @@ -169,6 +167,7 @@ index 0000000000000000000000000000000000000000..360fdd754849511909c04cb05f8b0a81 + private ArrayConstants() {} + + public static final Object[] emptyObjectArray = new Object[0]; ++ public static final short[] emptyShortArray = new short[0]; + public static final int[] emptyIntArray = new int[0]; + public static final int[] zeroSingletonIntArray = new int[]{0}; + public static final byte[] emptyByteArray = new byte[0]; @@ -176,7 +175,7 @@ index 0000000000000000000000000000000000000000..360fdd754849511909c04cb05f8b0a81 + public static final long[] emptyLongArray = new long[0]; + public static final org.bukkit.entity.Entity[] emptyBukkitEntityArray = new org.bukkit.entity.Entity[0]; + public static final net.minecraft.world.entity.Entity[] emptyEntityArray = new net.minecraft.world.entity.Entity[0]; -+ public static final net.minecraft.server.level.ServerLevel[] emptyServerLevelArray = new net.minecraft.server.level.ServerLevel[0]; ++ //public static final net.minecraft.server.level.ServerLevel[] emptyServerLevelArray = new net.minecraft.server.level.ServerLevel[0]; +} diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java index 06648f9751fd8a322d0809ffebf6a544596ee1a4..47c09872c8283efaec2eca05b4d74ddea1388942 100644 @@ -286,7 +285,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..b34ea5d45a69ffcf26275e79006a3d03 protected CipherBase(Cipher cipher) { this.cipher = cipher; diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 3e550f8e7cd4f4e16f499a8a2a4b95420270f07a..ee4172ab8a0df871f509aeaee8d32f325c148fee 100644 +index e693a003ea8f022eef8b49e4332025b769333b30..1900da381257a00fc3b96d397e298caf2f8c861f 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -326,7 +326,7 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -311,21 +310,8 @@ index 4aa6232bf0f72fcde32d257100bd15b1c5192aaa..2d3f002f85721ff25d95f3f251077926 private static final Codec PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments); private static final Codec ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC) .xmap( -diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetEquipmentPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetEquipmentPacket.java -index d152871142d3def2ac04f50037db53b0527f7894..bf0db5e46a530a8d4c5ebaa58d0e14c4b457036b 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetEquipmentPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetEquipmentPacket.java -@@ -32,7 +32,7 @@ public class ClientboundSetEquipmentPacket implements Packet optionspec10 = optionparser.accepts("world").withRequiredArg(); OptionSpec optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]); OptionSpec optionspec12 = optionparser.accepts("serverId").withRequiredArg(); -diff --git a/src/main/java/net/minecraft/server/commands/SpawnArmorTrimsCommand.java b/src/main/java/net/minecraft/server/commands/SpawnArmorTrimsCommand.java -index 9e00f7125874a3cd09bddb75b0dae6a59f28448f..036d2661acf90f127a585dc9fbc841e1c1435055 100644 ---- a/src/main/java/net/minecraft/server/commands/SpawnArmorTrimsCommand.java -+++ b/src/main/java/net/minecraft/server/commands/SpawnArmorTrimsCommand.java -@@ -130,7 +130,7 @@ public class SpawnArmorTrimsCommand { - armorStand.setYRot(180.0F); - armorStand.setNoGravity(true); +diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java +index 254c80c60bdeaf8d3b65777648f7e863a4480a31..c45121f6c4ed3b6bd9faf3f3d3bbddd647a48eae 100644 +--- a/src/main/java/net/minecraft/server/level/ServerLevel.java ++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +@@ -1243,7 +1243,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe -- for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) { -+ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) { // Gale - JettPack - reduce array allocations - Item item = MATERIAL_AND_SLOT_TO_ITEM.get(Pair.of(armorMaterial, equipmentSlot)); - if (item != null) { - ItemStack itemStack = new ItemStack(item); -diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 20b5a81d50397438b3200322f31b62db44ebdb3b..c80be65d190c85e7f0ea8233ebbbdbc1ea67f276 100644 ---- a/src/main/java/net/minecraft/server/level/ServerEntity.java -+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -351,7 +351,7 @@ public class ServerEntity { + public static List getCurrentlyTickingEntities() { + Entity ticking = currentlyTickingEntity.get(); +- List ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking }); ++ List ret = java.util.Arrays.asList(ticking == null ? me.titaniumtown.ArrayConstants.emptyEntityArray : new Entity[] { ticking }); // Gale - JettPack - reduce array allocations - if (this.entity instanceof LivingEntity) { - List> list = Lists.newArrayList(); -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { + return ret; + } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 71478e620198f373ad92cf40a49ecbfb14fd326e..7694c5f1d1ffe60d7be3c2591afddd472b6c5ce6 100644 +index 25e91c5e5f5cf1a9dbb2931b964c754408926788..fda212ff9961d7ce0d99bfb7fbe49b15034f6e57 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2824,7 +2824,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2842,7 +2842,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl entity.refreshEntityData(ServerGamePacketListenerImpl.this.player); // SPIGOT-7136 - Allays if (entity instanceof Allay || entity instanceof net.minecraft.world.entity.animal.horse.AbstractHorse) { // Paper - Fix horse armor desync @@ -377,7 +350,7 @@ index 71478e620198f373ad92cf40a49ecbfb14fd326e..7694c5f1d1ffe60d7be3c2591afddd47 ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); // Paper - fix slot desync - always refresh player inventory diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 2754e5dda2bc50bff302cb569803bc8f1f04a9db..1d4f1cdfd2b221b0ed0cef3bc266c829fd3555ef 100644 +index e2c527456e277d27baff558d59234263eef5ecac..7ff64c46a554fd779a9bea42213af3b3e67ed795 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -181,14 +181,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -430,20 +403,8 @@ index c038da20b76c0b7b1c18471b20be01e849d29f3a..97737da3c2f13e1bd29dc119133c7267 } public boolean isEmpty() { -diff --git a/src/main/java/net/minecraft/util/MemoryReserve.java b/src/main/java/net/minecraft/util/MemoryReserve.java -index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..365598a660e79d266f5d4a439cb1ba01687de150 100644 ---- a/src/main/java/net/minecraft/util/MemoryReserve.java -+++ b/src/main/java/net/minecraft/util/MemoryReserve.java -@@ -11,6 +11,6 @@ public class MemoryReserve { - } - - public static void release() { -- reserve = new byte[0]; -+ reserve = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations - } - } diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java -index 15c5164d0ef41a978c16ee317fa73e97f2480207..0723c625c38e567f13b77dfe2a98684e5a6b9417 100644 +index 1f9c436a632e4f110be61cf76fcfc3b7eb80334e..6c6ac02129dc7499137da33d8b3d3255b7aa03b6 100644 --- a/src/main/java/net/minecraft/util/ZeroBitStorage.java +++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java @@ -5,7 +5,7 @@ import java.util.function.IntConsumer; @@ -455,18 +416,6 @@ index 15c5164d0ef41a978c16ee317fa73e97f2480207..0723c625c38e567f13b77dfe2a98684e private final int size; public ZeroBitStorage(int size) { -diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java -index 2fa2a4eef21e786f738f36616c3160defa95bce8..d06ee72aa823641f65678e5b24ff3f4fbec520c4 100644 ---- a/src/main/java/net/minecraft/world/entity/EquipmentSlot.java -+++ b/src/main/java/net/minecraft/world/entity/EquipmentSlot.java -@@ -19,6 +19,7 @@ public enum EquipmentSlot implements StringRepresentable { - private final int countLimit; - private final int filterFlag; - private final String name; -+ public static final EquipmentSlot[] VALUES = EquipmentSlot.values(); // Gale - JettPack - reduce array allocations - - private EquipmentSlot(final EquipmentSlot.Type type, final int entityId, final int maxCount, final int armorStandId, final String name) { - this.type = type; diff --git a/src/main/java/net/minecraft/world/entity/EquipmentSlotGroup.java b/src/main/java/net/minecraft/world/entity/EquipmentSlotGroup.java index f5e79db3ccde0730c3b4fb81c76ca6ed045a7374..5546a873fae5252df5fb4bf8781e70db64522dec 100644 --- a/src/main/java/net/minecraft/world/entity/EquipmentSlotGroup.java @@ -479,95 +428,11 @@ index f5e79db3ccde0730c3b4fb81c76ca6ed045a7374..5546a873fae5252df5fb4bf8781e70db private EquipmentSlotGroup(final int id, final String name, final Predicate slotPredicate) { this.id = id; -diff --git a/src/main/java/net/minecraft/world/entity/EquipmentTable.java b/src/main/java/net/minecraft/world/entity/EquipmentTable.java -index d75673cc8a5aeb7051b1d4fe729faf408e266dc4..0b8e5c2da9f57dbf8703baa1de3e1cf8f31b6230 100644 ---- a/src/main/java/net/minecraft/world/entity/EquipmentTable.java -+++ b/src/main/java/net/minecraft/world/entity/EquipmentTable.java -@@ -16,7 +16,7 @@ public record EquipmentTable(ResourceKey lootTable, Map> DROP_CHANCES_CODEC = Codec.either(Codec.FLOAT, Codec.unboundedMap(EquipmentSlot.CODEC, Codec.FLOAT)) - .xmap(either -> either.map(EquipmentTable::createForAllSlots, Function.identity()), map -> { - boolean bl = map.values().stream().distinct().count() == 1L; -- boolean bl2 = map.keySet().containsAll(Arrays.asList(EquipmentSlot.values())); -+ boolean bl2 = map.keySet().containsAll(Arrays.asList(EquipmentSlot.VALUES)); // Gale - JettPack - reduce array allocations - return bl && bl2 ? Either.left(map.values().stream().findFirst().orElse(0.0F)) : Either.right((Map)map); - }); - public static final Codec CODEC = RecordCodecBuilder.create( -@@ -28,7 +28,7 @@ public record EquipmentTable(ResourceKey lootTable, Map createForAllSlots(float dropChance) { -- return createForAllSlots(List.of(EquipmentSlot.values()), dropChance); -+ return createForAllSlots(List.of(EquipmentSlot.VALUES), dropChance); // Gale - JettPack - reduce array allocations - } - - private static Map createForAllSlots(List slots, float dropChance) { -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index e5df16e415d6c8dc8547a59af373ae2918ec42dc..6c6e279cd351720bd8d867e2c6207e98a35d2c9d 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3275,7 +3275,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - @Nullable - private Map collectEquipmentChanges() { - Map map = null; -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { -diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 427e2711b942a61b491b2fe9fc1d02e67d446ad0..9dbcebe04ad9dd2f5558e92e85749c7026f6d428 100644 ---- a/src/main/java/net/minecraft/world/entity/Mob.java -+++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1126,7 +1126,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - @Override - protected void dropCustomDeathLoot(ServerLevel world, DamageSource source, boolean causedByPlayer) { - super.dropCustomDeathLoot(world, source, causedByPlayer); -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { -@@ -1197,7 +1197,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - - public Set dropPreservedEquipment(Predicate dropPredicate) { - Set set = new HashSet(); -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { -@@ -1256,7 +1256,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - } - - boolean flag = true; -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int j = aenumitemslot.length; - - for (int k = 0; k < j; ++k) { -@@ -1341,7 +1341,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - - protected void populateDefaultEquipmentEnchantments(ServerLevelAccessor world, RandomSource random, DifficultyInstance localDifficulty) { - this.enchantSpawnedWeapon(world, random, localDifficulty); -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { -@@ -1546,7 +1546,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - t0.setInvulnerable(this.isInvulnerable()); - if (flag) { - t0.setCanPickUpLoot(this.canPickUpLoot()); -- EquipmentSlot[] aenumitemslot = EquipmentSlot.values(); -+ EquipmentSlot[] aenumitemslot = EquipmentSlot.VALUES; // Gale - JettPack - reduce array allocations - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index eec0ec43590be7e8ae5b530a7404c98b5e23cb53..21d8666ed24dae109792c094b9ce7eeb9100b4d9 100644 +index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..303b3337b23b6528ed431ba8b6c1c1f3187a4503 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -1122,7 +1122,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -1218,7 +1218,7 @@ public final class ItemStack implements DataComponentHolder { ItemAttributeModifiers itemattributemodifiers = (ItemAttributeModifiers) this.getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY); if (itemattributemodifiers.showInTooltip()) { @@ -577,10 +442,10 @@ index eec0ec43590be7e8ae5b530a7404c98b5e23cb53..21d8666ed24dae109792c094b9ce7eeb for (int j = 0; j < i; ++j) { diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java -index 7c3e561f2ca2522ab8336487c0307e1b69a397a8..a7ee93c0d94be3bb6c8ea8e8ca7f8abf583eea80 100644 +index 2490a42c9c35c7e080279ef8566288a28362d167..542916b15fd42d8262b24ead91f146cd228063ed 100644 --- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java +++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipePattern.java -@@ -112,7 +112,7 @@ public final class ShapedRecipePattern { +@@ -121,7 +121,7 @@ public final class ShapedRecipePattern { } if (pattern.size() == l) { @@ -589,59 +454,33 @@ index 7c3e561f2ca2522ab8336487c0307e1b69a397a8..a7ee93c0d94be3bb6c8ea8e8ca7f8abf } else { String[] strings = new String[pattern.size() - l - k]; -diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java -index 82e4672e7a5d1fbe238ad07d08ec2d5dcd6a99a8..161990842f19fc123fd9feca7231afec83802f47 100644 ---- a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java -+++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java -@@ -109,7 +109,7 @@ public record Enchantment(Component description, Enchantment.EnchantmentDefiniti - public Map getSlotItems(LivingEntity entity) { - Map map = Maps.newEnumMap(EquipmentSlot.class); - -- for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) { -+ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) { // Gale - JettPack - reduce array allocations - if (this.matchingSlot(equipmentSlot)) { - ItemStack itemStack = entity.getItemBySlot(equipmentSlot); - if (!itemStack.isEmpty()) { -diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index fce49b17905ab97e691aa8499a5dfed67adf0c40..986d0151aeeb2ce0f752c424c526fb0cc6849308 100644 ---- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -@@ -143,7 +143,7 @@ public class EnchantmentHelper { - } - - private static void runIterationOnEquipment(LivingEntity entity, EnchantmentHelper.EnchantmentInSlotVisitor contextAwareConsumer) { -- for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) { -+ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) { // Gale - JettPack - reduce array allocations - runIterationOnItem(entity.getItemBySlot(equipmentSlot), equipmentSlot, entity, contextAwareConsumer); - } - } -@@ -418,7 +418,7 @@ public class EnchantmentHelper { - public static Optional getRandomItemWith(DataComponentType componentType, LivingEntity entity, Predicate stackPredicate) { - List list = new ArrayList<>(); - -- for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) { -+ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) { // Gale - JettPack - reduce array allocations - ItemStack itemStack = entity.getItemBySlot(equipmentSlot); - if (stackPredicate.test(itemStack)) { - ItemEnchantments itemEnchantments = itemStack.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 0b373e194a4cf1d579165424aee21f4c62ae45b1..a28385bbc885f2103093a80066c89f09b650484a 100644 +index 15f3c2dd02dad613c272382dec3639819c2d7d56..bb47bca85e3d9f20383ca6e87db1df9ad49e1db6 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -1738,7 +1738,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1746,7 +1746,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ); if (slices == null) { - return new org.bukkit.entity.Entity[0]; + return me.titaniumtown.ArrayConstants.emptyBukkitEntityArray; // Gale - JettPack - reduce array allocations } - return slices.getChunkEntities(); + + List ret = new java.util.ArrayList<>(); +@@ -1757,7 +1757,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl + } + } + +- return ret.toArray(new org.bukkit.entity.Entity[0]); ++ return ret.toArray(me.titaniumtown.ArrayConstants.emptyBukkitEntityArray); // Gale - JettPack - reduce array allocations } + // Paper end - rewrite chunk system + diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -index d3d12f9114173f4971f95d7ef895a4374705bd3f..35059d9b575aee92865fd15a20c3db335a98fb76 100644 +index db837b250fc35af5b528bf973b3b07f63e79bc46..ceab17cdf519278393e41311488e6d7f99133ebe 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -430,7 +430,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -434,7 +434,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @Override public int[] getSlotsForFace(Direction side) { @@ -650,7 +489,7 @@ index d3d12f9114173f4971f95d7ef895a4374705bd3f..35059d9b575aee92865fd15a20c3db33 } @Override -@@ -479,7 +479,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -483,7 +483,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @Override public int[] getSlotsForFace(Direction side) { @@ -659,7 +498,7 @@ index d3d12f9114173f4971f95d7ef895a4374705bd3f..35059d9b575aee92865fd15a20c3db33 } @Override -@@ -521,7 +521,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -525,7 +525,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @Override public int[] getSlotsForFace(Direction side) { @@ -669,10 +508,10 @@ index d3d12f9114173f4971f95d7ef895a4374705bd3f..35059d9b575aee92865fd15a20c3db33 @Override diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 730aca233f6e7564d4cb85b5b628d23c4f01d2f4..0d5c124ceffc5024240afa48cf900954977a1baf 100644 +index 15e0861486a2bda3e2f4049b1b5a299c870acd31..43899f544cc22666f9ca496128650ce7751ec913 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -67,7 +67,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -61,7 +61,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit protected static final int SLOT_FUEL = 1; protected static final int SLOT_RESULT = 2; public static final int DATA_LIT_TIME = 0; diff --git a/patches/server/0067-Optimize-sun-burn-tick.patch b/patches/server/0064-Optimize-sun-burn-tick.patch similarity index 92% rename from patches/server/0067-Optimize-sun-burn-tick.patch rename to patches/server/0064-Optimize-sun-burn-tick.patch index 0858271..10c0e42 100644 --- a/patches/server/0067-Optimize-sun-burn-tick.patch +++ b/patches/server/0064-Optimize-sun-burn-tick.patch @@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1d81b2eccaf796922e7645be4e388a44efb807dd..8cc3394f951e1560c6944343724fb0d38e69430a 100644 +index 77d7fd1d521427d18c7aff978ade74280eaf4846..c138217b0b4a300ba9084a7917ce43e9b56a66c7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -314,7 +314,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -315,7 +315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public double xo; public double yo; public double zo; @@ -25,7 +25,7 @@ index 1d81b2eccaf796922e7645be4e388a44efb807dd..8cc3394f951e1560c6944343724fb0d3 public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public private ChunkPos chunkPosition; private Vec3 deltaMovement; -@@ -2063,9 +2063,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2181,9 +2181,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess /** @deprecated */ @Deprecated public float getLightLevelDependentMagicValue() { @@ -47,10 +47,10 @@ index 1d81b2eccaf796922e7645be4e388a44efb807dd..8cc3394f951e1560c6944343724fb0d3 this.absMoveTo(x, y, z); this.absRotateTo(yaw, pitch); diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 9dbcebe04ad9dd2f5558e92e85749c7026f6d428..06c57db4e6c76945cba514fc27828ff96fcd2c10 100644 +index 3ccc39e142f946e3fc34753fdc91a2cb62f9bd2d..ba1fc908290db310bec38c8eb1a3e464dd105bf6 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1726,13 +1726,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab +@@ -1710,13 +1710,29 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab protected void playAttackSound() {} diff --git a/patches/server/0068-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch b/patches/server/0065-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch similarity index 100% rename from patches/server/0068-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch rename to patches/server/0065-Reduce-lambda-and-Optional-allocation-in-EntityBased.patch diff --git a/patches/server/0069-Replace-game-rules-map-with-optimized-collection.patch b/patches/server/0066-Replace-game-rules-map-with-optimized-collection.patch similarity index 57% rename from patches/server/0069-Replace-game-rules-map-with-optimized-collection.patch rename to patches/server/0066-Replace-game-rules-map-with-optimized-collection.patch index c73c8db..3422f6b 100644 --- a/patches/server/0069-Replace-game-rules-map-with-optimized-collection.patch +++ b/patches/server/0066-Replace-game-rules-map-with-optimized-collection.patch @@ -13,24 +13,15 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index 89e327bc3a45879fe68887c7aadb077f31a770eb..a90ebe3fd345034c85e95d4dddf3223ac5374b30 100644 +index 467696a78791d65a66eb380e97d33123a5a12e61..3fd99c677f35639261f6eba202813735e32f82d5 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java +++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -21,6 +21,8 @@ import java.util.function.BiConsumer; - import java.util.function.Function; - import java.util.function.Supplier; - import javax.annotation.Nullable; -+ -+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; - import net.minecraft.commands.CommandSourceStack; - import net.minecraft.commands.Commands; - import net.minecraft.nbt.CompoundTag; -@@ -149,7 +151,7 @@ public class GameRules { +@@ -168,7 +168,7 @@ public class GameRules { } - private GameRules(Map, GameRules.Value> rules) { + private GameRules(Map, GameRules.Value> rules, FeatureFlagSet enabledFeatures) { - this.rules = rules; -+ this.rules = new Object2ObjectOpenHashMap<>(rules); // Gale - Lithium - replace game rules map with optimized collection ++ this.rules = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(rules); // Gale - Lithium - replace game rules map with optimized collection + this.enabledFeatures = enabledFeatures; // Paper start - Perf: Use array for gamerule storage - int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1; diff --git a/patches/server/0070-Replace-AI-attributes-with-optimized-collections.patch b/patches/server/0067-Replace-AI-attributes-with-optimized-collections.patch similarity index 95% rename from patches/server/0070-Replace-AI-attributes-with-optimized-collections.patch rename to patches/server/0067-Replace-AI-attributes-with-optimized-collections.patch index 6c351a8..0778362 100644 --- a/patches/server/0070-Replace-AI-attributes-with-optimized-collections.patch +++ b/patches/server/0067-Replace-AI-attributes-with-optimized-collections.patch @@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) 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 f9f6745d45aaba4a7106f80d403dcf9ae40e1d6c..f8174dd45cef1c521a96a7bbda811630c438cb4a 100644 +index edd791da70fd7e18c42133dcd771f212cb25abab..e45ed0ffa031f7ab5fa39b71a2678c5a282e0561 100644 --- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java @@ -19,9 +19,11 @@ import org.slf4j.Logger; diff --git a/patches/server/0071-Replace-class-map-with-optimized-collection.patch b/patches/server/0068-Replace-class-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0071-Replace-class-map-with-optimized-collection.patch rename to patches/server/0068-Replace-class-map-with-optimized-collection.patch diff --git a/patches/server/0072-Replace-instance-list-with-optimized-collection.patch b/patches/server/0069-Replace-instance-list-with-optimized-collection.patch similarity index 100% rename from patches/server/0072-Replace-instance-list-with-optimized-collection.patch rename to patches/server/0069-Replace-instance-list-with-optimized-collection.patch diff --git a/patches/server/0073-Replace-throttle-tracker-map-with-optimized-collecti.patch b/patches/server/0070-Replace-throttle-tracker-map-with-optimized-collecti.patch similarity index 100% rename from patches/server/0073-Replace-throttle-tracker-map-with-optimized-collecti.patch rename to patches/server/0070-Replace-throttle-tracker-map-with-optimized-collecti.patch diff --git a/patches/server/0074-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch b/patches/server/0071-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch similarity index 100% rename from patches/server/0074-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch rename to patches/server/0071-Avoid-Class-isAssignableFrom-call-in-ClassInstanceMu.patch diff --git a/patches/server/0076-Replace-division-by-multiplication-in-CubePointRange.patch b/patches/server/0072-Replace-division-by-multiplication-in-CubePointRange.patch similarity index 100% rename from patches/server/0076-Replace-division-by-multiplication-in-CubePointRange.patch rename to patches/server/0072-Replace-division-by-multiplication-in-CubePointRange.patch diff --git a/patches/server/0077-Replace-parts-by-size-in-CubePointRange.patch b/patches/server/0073-Replace-parts-by-size-in-CubePointRange.patch similarity index 100% rename from patches/server/0077-Replace-parts-by-size-in-CubePointRange.patch rename to patches/server/0073-Replace-parts-by-size-in-CubePointRange.patch diff --git a/patches/server/0078-Check-frozen-ticks-before-landing-block.patch b/patches/server/0074-Check-frozen-ticks-before-landing-block.patch similarity index 88% rename from patches/server/0078-Check-frozen-ticks-before-landing-block.patch rename to patches/server/0074-Check-frozen-ticks-before-landing-block.patch index 60d9c99..582ebda 100644 --- a/patches/server/0078-Check-frozen-ticks-before-landing-block.patch +++ b/patches/server/0074-Check-frozen-ticks-before-landing-block.patch @@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 6c6e279cd351720bd8d867e2c6207e98a35d2c9d..62ae28b1cecab3c1e5425ef5255a1cbaf73050ad 100644 +index 244857d69b52e1689d932cab914ed8c1331e96d3..91c97580123701b4bafb7502d2947fda91dc9cc0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -565,11 +565,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -579,11 +579,10 @@ public abstract class LivingEntity extends Entity implements Attackable { } protected void tryAddFrost() { @@ -29,7 +29,7 @@ index 6c6e279cd351720bd8d867e2c6207e98a35d2c9d..62ae28b1cecab3c1e5425ef5255a1cba if (attributemodifiable == null) { return; -@@ -579,7 +578,6 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -593,7 +592,6 @@ public abstract class LivingEntity extends Entity implements Attackable { attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_ID, (double) f, AttributeModifier.Operation.ADD_VALUE)); } diff --git a/patches/server/0079-Faster-chunk-serialization.patch b/patches/server/0075-Faster-chunk-serialization.patch similarity index 96% rename from patches/server/0079-Faster-chunk-serialization.patch rename to patches/server/0075-Faster-chunk-serialization.patch index 1feca9d..72892e7 100644 --- a/patches/server/0079-Faster-chunk-serialization.patch +++ b/patches/server/0075-Faster-chunk-serialization.patch @@ -214,7 +214,7 @@ index 0000000000000000000000000000000000000000..349618b7f544bf9a30e0796d4d9a2640 + } +} diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java -index 19661e106612b8e4e152085fb398db7bd06acc23..f852d2c0c0e37df78dbea28e183aee3572978dee 100644 +index e4e153cb8899e70273aa150b8ea26907cf68b15c..3e65360293adf19c5411f9e187ddc1d720b7c235 100644 --- a/src/main/java/net/minecraft/util/BitStorage.java +++ b/src/main/java/net/minecraft/util/BitStorage.java @@ -1,6 +1,7 @@ @@ -233,7 +233,7 @@ index 19661e106612b8e4e152085fb398db7bd06acc23..f852d2c0c0e37df78dbea28e183aee35 + void compact(Palette srcPalette, Palette dstPalette, short[] out); // Gale - Lithium - faster chunk serialization } diff --git a/src/main/java/net/minecraft/util/SimpleBitStorage.java b/src/main/java/net/minecraft/util/SimpleBitStorage.java -index 8acf2f2491a8d9d13392c5e89b2bd5c9918285e1..0b8b0cf58f637d72eae28e21266df14183f11fb1 100644 +index d99ec470b4653beab630999a5b2c1a6428b20c38..52c157b4f688da7cf3f14211535b64ee6d65d10f 100644 --- a/src/main/java/net/minecraft/util/SimpleBitStorage.java +++ b/src/main/java/net/minecraft/util/SimpleBitStorage.java @@ -2,6 +2,7 @@ package net.minecraft.util; @@ -244,7 +244,7 @@ index 8acf2f2491a8d9d13392c5e89b2bd5c9918285e1..0b8b0cf58f637d72eae28e21266df141 import org.apache.commons.lang3.Validate; public class SimpleBitStorage implements BitStorage { -@@ -401,4 +402,45 @@ public class SimpleBitStorage implements BitStorage { +@@ -472,4 +473,45 @@ public class SimpleBitStorage implements BitStorage { super(message); } } @@ -291,7 +291,7 @@ index 8acf2f2491a8d9d13392c5e89b2bd5c9918285e1..0b8b0cf58f637d72eae28e21266df141 + } diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java -index 0723c625c38e567f13b77dfe2a98684e5a6b9417..b02a0d9c71550d39aad08ed0932043531b661305 100644 +index 6c6ac02129dc7499137da33d8b3d3255b7aa03b6..c5b13e2f49b046664b8586e38ff632ad6adfbef1 100644 --- a/src/main/java/net/minecraft/util/ZeroBitStorage.java +++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java @@ -80,4 +80,6 @@ public class ZeroBitStorage implements BitStorage { @@ -313,7 +313,7 @@ index acae3eb30e0689048937f479dc3070f0688abdad..4b79f0474a9013dd4fdb68c6363ca194 int onResize(int newBits, T object); } diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f19ed19c37 100644 +index 8b84bf2272556ac3321cbf16361d7f48a1cc6873..bdfd50069284ba59d48f85fee1ee8e9b67310fda 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -23,8 +23,25 @@ import net.minecraft.util.Mth; @@ -342,7 +342,7 @@ index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f1 private static final int MIN_PALETTE_BITS = 0; private final PaletteResize dummyPaletteResize = (newSize, added) -> 0; public final IdMap registry; -@@ -304,28 +321,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -348,28 +365,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer public synchronized PalettedContainerRO.PackedData pack(IdMap idList, PalettedContainer.Strategy paletteProvider) { // Paper - synchronize this.acquire(); @@ -412,7 +412,7 @@ index 13d3c877b006a4975e7370713e3919c661e7890f..21e33bb69c58c99ddc497f57b77561f1 } private static void swapPalette(int[] is, IntUnaryOperator applier) { -@@ -364,13 +407,35 @@ public class PalettedContainer implements PaletteResize, PalettedContainer +@@ -409,13 +452,35 @@ public class PalettedContainer implements PaletteResize, PalettedContainer @Override public void count(PalettedContainer.CountConsumer counter) { diff --git a/patches/server/0080-Update-boss-bar-within-tick.patch b/patches/server/0076-Update-boss-bar-within-tick.patch similarity index 94% rename from patches/server/0080-Update-boss-bar-within-tick.patch rename to patches/server/0076-Update-boss-bar-within-tick.patch index 2ae331a..47931ff 100644 --- a/patches/server/0080-Update-boss-bar-within-tick.patch +++ b/patches/server/0076-Update-boss-bar-within-tick.patch @@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java -index dcbef04bbaab988096bf416163264833e84d1967..5c0e5803284bfc82c2dd8bba9ded0ba7aac4962a 100644 +index 11cf2d9def087b0898c828eaa21eb5f7b8811d5f..4ce08edf6e7a59238b1c4e85acc04eab21b21ee9 100644 --- a/src/main/java/net/minecraft/world/entity/raid/Raid.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java @@ -112,6 +112,7 @@ public class Raid { @@ -37,7 +37,7 @@ index dcbef04bbaab988096bf416163264833e84d1967..5c0e5803284bfc82c2dd8bba9ded0ba7 if (!this.isStopped()) { if (this.status == Raid.RaidStatus.ONGOING) { boolean flag = this.active; -@@ -661,6 +668,12 @@ public class Raid { +@@ -652,6 +659,12 @@ public class Raid { } public void updateBossbar() { diff --git a/patches/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch b/patches/work/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch similarity index 100% rename from patches/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch rename to patches/work/server/0032-Reduce-entity-fluid-lookups-if-no-fluids.patch diff --git a/patches/server/0075-Cache-BlockStatePairKey-hash.patch b/patches/work/server/0075-Cache-BlockStatePairKey-hash.patch similarity index 100% rename from patches/server/0075-Cache-BlockStatePairKey-hash.patch rename to patches/work/server/0075-Cache-BlockStatePairKey-hash.patch diff --git a/todos.txt b/todos.txt index d1192ee..086e2e5 100644 --- a/todos.txt +++ b/todos.txt @@ -1,3 +1,4 @@ ## TODOs Check chunk sys threads in gale metrics Do a benchmark for `Remove streams and iterators from range check`, getEffectiveRange in ChunkMap +Do benchmark for reduce entity fluid lookup on 1.21.3