diff --git a/patches/server/0072-Store-mob-counts-in-an-array.patch b/patches/server/0072-Store-mob-counts-in-an-array.patch new file mode 100644 index 0000000..2d04b40 --- /dev/null +++ b/patches/server/0072-Store-mob-counts-in-an-array.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MartijnMuijsers +Date: Wed, 30 Nov 2022 17:46:23 +0100 +Subject: [PATCH] Store mob counts in an array + +License: MIT (https://opensource.org/licenses/MIT) + +This patch is based on the following mixin: +"general/spawn_density_cap/MixinSpawnDensityCapperDensityCap" +Original commit: "Replace density cap implementation using arrays" +By: ishland +As part of: VMP (https://github.com/RelativityMC/VMP-fabric) +Licensed under: MIT (https://opensource.org/licenses/MIT) + +diff --git a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java +index 84c766e09898cfc07d6e07e80f4b9aa318050a62..8357b1e16b2fb1b84c7d14da577e95d91450b53e 100644 +--- a/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java ++++ b/src/main/java/net/minecraft/world/level/LocalMobCapCalculator.java +@@ -47,16 +47,14 @@ public class LocalMobCapCalculator { + } + + static class MobCounts { +- private final Object2IntMap counts = new Object2IntOpenHashMap<>(MobCategory.values().length); ++ public final int[] counts = new int[MobCategory.values().length]; // Gale - VMP - store mob counts in an array + + public void add(MobCategory spawnGroup) { +- this.counts.computeInt(spawnGroup, (group, density) -> { +- return density == null ? 1 : density + 1; +- }); ++ this.counts[spawnGroup.ordinal()]++; // Gale - VMP - store mob counts in an array + } + + public boolean canSpawn(MobCategory spawnGroup) { +- return this.counts.getOrDefault(spawnGroup, 0) < spawnGroup.getMaxInstancesPerChunk(); ++ return this.counts[spawnGroup.ordinal()] < spawnGroup.getMaxInstancesPerChunk(); // Gale - VMP - store mob counts in an array + } + } + } diff --git a/patches/server/0072-Ignore-durability-change-equipment-updates.patch b/patches/server/0073-Ignore-durability-change-equipment-updates.patch similarity index 100% rename from patches/server/0072-Ignore-durability-change-equipment-updates.patch rename to patches/server/0073-Ignore-durability-change-equipment-updates.patch diff --git a/patches/server/0073-Hide-flames-on-entities-with-fire-resistance.patch b/patches/server/0074-Hide-flames-on-entities-with-fire-resistance.patch similarity index 100% rename from patches/server/0073-Hide-flames-on-entities-with-fire-resistance.patch rename to patches/server/0074-Hide-flames-on-entities-with-fire-resistance.patch diff --git a/patches/server/0074-Skip-cloning-advancement-criteria.patch b/patches/server/0075-Skip-cloning-advancement-criteria.patch similarity index 100% rename from patches/server/0074-Skip-cloning-advancement-criteria.patch rename to patches/server/0075-Skip-cloning-advancement-criteria.patch diff --git a/patches/server/0075-Player-canSee-by-entity-UUID.patch b/patches/server/0076-Player-canSee-by-entity-UUID.patch similarity index 100% rename from patches/server/0075-Player-canSee-by-entity-UUID.patch rename to patches/server/0076-Player-canSee-by-entity-UUID.patch diff --git a/patches/server/0076-Spread-out-sending-all-player-info.patch b/patches/server/0077-Spread-out-sending-all-player-info.patch similarity index 100% rename from patches/server/0076-Spread-out-sending-all-player-info.patch rename to patches/server/0077-Spread-out-sending-all-player-info.patch diff --git a/patches/server/0077-Optimize-player-list-for-sending-player-info.patch b/patches/server/0078-Optimize-player-list-for-sending-player-info.patch similarity index 100% rename from patches/server/0077-Optimize-player-list-for-sending-player-info.patch rename to patches/server/0078-Optimize-player-list-for-sending-player-info.patch diff --git a/patches/server/0078-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0079-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 100% rename from patches/server/0078-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to patches/server/0079-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch diff --git a/patches/server/0079-Send-multiple-keep-alive-packets.patch b/patches/server/0080-Send-multiple-keep-alive-packets.patch similarity index 100% rename from patches/server/0079-Send-multiple-keep-alive-packets.patch rename to patches/server/0080-Send-multiple-keep-alive-packets.patch diff --git a/patches/server/0080-Specific-interval-TPS-API.patch b/patches/server/0081-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0080-Specific-interval-TPS-API.patch rename to patches/server/0081-Specific-interval-TPS-API.patch diff --git a/patches/server/0081-5-second-TPS-average.patch b/patches/server/0082-5-second-TPS-average.patch similarity index 100% rename from patches/server/0081-5-second-TPS-average.patch rename to patches/server/0082-5-second-TPS-average.patch diff --git a/patches/server/0082-Measure-last-tick-time.patch b/patches/server/0083-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0082-Measure-last-tick-time.patch rename to patches/server/0083-Measure-last-tick-time.patch diff --git a/patches/server/0083-Last-tick-time-API.patch b/patches/server/0084-Last-tick-time-API.patch similarity index 100% rename from patches/server/0083-Last-tick-time-API.patch rename to patches/server/0084-Last-tick-time-API.patch diff --git a/patches/server/0084-Show-last-tick-time-in-tps-command.patch b/patches/server/0085-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0084-Show-last-tick-time-in-tps-command.patch rename to patches/server/0085-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0085-Collision-physics-check-before-vehicle-check.patch b/patches/server/0086-Collision-physics-check-before-vehicle-check.patch similarity index 100% rename from patches/server/0085-Collision-physics-check-before-vehicle-check.patch rename to patches/server/0086-Collision-physics-check-before-vehicle-check.patch diff --git a/patches/server/0086-Variable-main-thread-task-delay.patch b/patches/server/0087-Variable-main-thread-task-delay.patch similarity index 100% rename from patches/server/0086-Variable-main-thread-task-delay.patch rename to patches/server/0087-Variable-main-thread-task-delay.patch diff --git a/patches/server/0087-Reduce-RandomSource-instances.patch b/patches/server/0088-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0087-Reduce-RandomSource-instances.patch rename to patches/server/0088-Reduce-RandomSource-instances.patch diff --git a/patches/server/0088-CPU-cores-estimation.patch b/patches/server/0089-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0088-CPU-cores-estimation.patch rename to patches/server/0089-CPU-cores-estimation.patch diff --git a/patches/server/0089-Add-centralized-AsyncExecutor.patch b/patches/server/0090-Add-centralized-AsyncExecutor.patch similarity index 100% rename from patches/server/0089-Add-centralized-AsyncExecutor.patch rename to patches/server/0090-Add-centralized-AsyncExecutor.patch diff --git a/patches/server/0090-Remove-Paper-async-executor.patch b/patches/server/0091-Remove-Paper-async-executor.patch similarity index 100% rename from patches/server/0090-Remove-Paper-async-executor.patch rename to patches/server/0091-Remove-Paper-async-executor.patch diff --git a/patches/server/0091-Remove-Paper-cleaner-executor.patch b/patches/server/0092-Remove-Paper-cleaner-executor.patch similarity index 100% rename from patches/server/0091-Remove-Paper-cleaner-executor.patch rename to patches/server/0092-Remove-Paper-cleaner-executor.patch diff --git a/patches/server/0092-Remove-background-executor.patch b/patches/server/0093-Remove-background-executor.patch similarity index 100% rename from patches/server/0092-Remove-background-executor.patch rename to patches/server/0093-Remove-background-executor.patch diff --git a/patches/server/0093-Remove-bootstrap-executor.patch b/patches/server/0094-Remove-bootstrap-executor.patch similarity index 100% rename from patches/server/0093-Remove-bootstrap-executor.patch rename to patches/server/0094-Remove-bootstrap-executor.patch diff --git a/patches/server/0094-Remove-world-upgrade-executors.patch b/patches/server/0095-Remove-world-upgrade-executors.patch similarity index 100% rename from patches/server/0094-Remove-world-upgrade-executors.patch rename to patches/server/0095-Remove-world-upgrade-executors.patch diff --git a/patches/server/0095-Remove-tab-complete-executor.patch b/patches/server/0096-Remove-tab-complete-executor.patch similarity index 100% rename from patches/server/0095-Remove-tab-complete-executor.patch rename to patches/server/0096-Remove-tab-complete-executor.patch diff --git a/patches/server/0096-Remove-text-filter-executor.patch b/patches/server/0097-Remove-text-filter-executor.patch similarity index 100% rename from patches/server/0096-Remove-text-filter-executor.patch rename to patches/server/0097-Remove-text-filter-executor.patch