From 9a6f48626c87fc67bccbb5b3a234230f79b56369 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Sun, 25 Dec 2022 10:51:54 +0100 Subject: [PATCH] Skip secondary POI sensor if absent --- ...-Skip-secondary-POI-sensor-if-absent.patch | 36 +++++++++++++++++++ ...kip-entity-move-if-movement-is-zero.patch} | 0 ...> 0096-Store-mob-counts-in-an-array.patch} | 0 ...-Use-linked-map-for-entity-trackers.patch} | 0 ...h => 0098-Optimize-noise-generation.patch} | 0 ...0099-Optimize-sheep-offspring-color.patch} | 0 ...durability-change-equipment-updates.patch} | 0 ...es-on-entities-with-fire-resistance.patch} | 0 ...2-Skip-cloning-advancement-criteria.patch} | 0 ...lock-destruction-packet-allocations.patch} | 0 ...ation-packets-only-for-living-entit.patch} | 0 ...> 0105-Player-canSee-by-entity-UUID.patch} | 0 ...-Spread-out-sending-all-player-info.patch} | 0 ...player-list-for-sending-player-info.patch} | 0 ...dSendEvent-if-there-are-no-listener.patch} | 0 ...09-Send-multiple-keep-alive-packets.patch} | 0 ...ake-slow-login-timeout-configurable.patch} | 0 ...x-interaction-distance-configurable.patch} | 0 ...random-strolling-into-non-ticking-c.patch} | 0 ... 0113-CraftBukkit-UUID-to-world-map.patch} | 0 ...Don-t-double-save-stored-user-lists.patch} | 0 ...h => 0115-Specific-interval-TPS-API.patch} | 0 ....patch => 0116-5-second-TPS-average.patch} | 0 ...atch => 0117-Measure-last-tick-time.patch} | 0 ...PI.patch => 0118-Last-tick-time-API.patch} | 0 ...-Show-last-tick-time-in-tps-command.patch} | 0 ...crease-time-statistics-in-intervals.patch} | 0 ...eck-has-physics-before-same-vehicle.patch} | 0 ...ible-planar-movement-multiplication.patch} | 0 ... 0123-Reduce-RandomSource-instances.patch} | 0 ...hread-priority-environment-variable.patch} | 0 ...h => 0125-Thread-safety-annotations.patch} | 0 ....patch => 0126-CPU-cores-estimation.patch} | 0 ...utility.patch => 0127-Mutex-utility.patch} | 0 ...8-Paired-lock-and-condition-utility.patch} | 0 ... 0129-Unterminable-executor-utility.patch} | 0 ... 0130-FIFO-concurrent-queue-utility.patch} | 0 ...ols.patch => 0131-Base-thread-pools.patch} | 0 ... => 0132-Non-blocking-PooledObjects.patch} | 0 39 files changed, 36 insertions(+) create mode 100644 patches/server/0094-Skip-secondary-POI-sensor-if-absent.patch rename patches/server/{0094-Skip-entity-move-if-movement-is-zero.patch => 0095-Skip-entity-move-if-movement-is-zero.patch} (100%) rename patches/server/{0095-Store-mob-counts-in-an-array.patch => 0096-Store-mob-counts-in-an-array.patch} (100%) rename patches/server/{0096-Use-linked-map-for-entity-trackers.patch => 0097-Use-linked-map-for-entity-trackers.patch} (100%) rename patches/server/{0097-Optimize-noise-generation.patch => 0098-Optimize-noise-generation.patch} (100%) rename patches/server/{0098-Optimize-sheep-offspring-color.patch => 0099-Optimize-sheep-offspring-color.patch} (100%) rename patches/server/{0099-Ignore-durability-change-equipment-updates.patch => 0100-Ignore-durability-change-equipment-updates.patch} (100%) rename patches/server/{0100-Hide-flames-on-entities-with-fire-resistance.patch => 0101-Hide-flames-on-entities-with-fire-resistance.patch} (100%) rename patches/server/{0101-Skip-cloning-advancement-criteria.patch => 0102-Skip-cloning-advancement-criteria.patch} (100%) rename patches/server/{0102-Reduce-block-destruction-packet-allocations.patch => 0103-Reduce-block-destruction-packet-allocations.patch} (100%) rename patches/server/{0103-Send-set-head-rotation-packets-only-for-living-entit.patch => 0104-Send-set-head-rotation-packets-only-for-living-entit.patch} (100%) rename patches/server/{0104-Player-canSee-by-entity-UUID.patch => 0105-Player-canSee-by-entity-UUID.patch} (100%) rename patches/server/{0105-Spread-out-sending-all-player-info.patch => 0106-Spread-out-sending-all-player-info.patch} (100%) rename patches/server/{0106-Optimize-player-list-for-sending-player-info.patch => 0107-Optimize-player-list-for-sending-player-info.patch} (100%) rename patches/server/{0107-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch => 0108-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch} (100%) rename patches/server/{0108-Send-multiple-keep-alive-packets.patch => 0109-Send-multiple-keep-alive-packets.patch} (100%) rename patches/server/{0109-Make-slow-login-timeout-configurable.patch => 0110-Make-slow-login-timeout-configurable.patch} (100%) rename patches/server/{0110-Make-max-interaction-distance-configurable.patch => 0111-Make-max-interaction-distance-configurable.patch} (100%) rename patches/server/{0111-Prevent-entities-random-strolling-into-non-ticking-c.patch => 0112-Prevent-entities-random-strolling-into-non-ticking-c.patch} (100%) rename patches/server/{0112-CraftBukkit-UUID-to-world-map.patch => 0113-CraftBukkit-UUID-to-world-map.patch} (100%) rename patches/server/{0113-Don-t-double-save-stored-user-lists.patch => 0114-Don-t-double-save-stored-user-lists.patch} (100%) rename patches/server/{0114-Specific-interval-TPS-API.patch => 0115-Specific-interval-TPS-API.patch} (100%) rename patches/server/{0115-5-second-TPS-average.patch => 0116-5-second-TPS-average.patch} (100%) rename patches/server/{0116-Measure-last-tick-time.patch => 0117-Measure-last-tick-time.patch} (100%) rename patches/server/{0117-Last-tick-time-API.patch => 0118-Last-tick-time-API.patch} (100%) rename patches/server/{0118-Show-last-tick-time-in-tps-command.patch => 0119-Show-last-tick-time-in-tps-command.patch} (100%) rename patches/server/{0119-Increase-time-statistics-in-intervals.patch => 0120-Increase-time-statistics-in-intervals.patch} (100%) rename patches/server/{0120-For-collision-check-has-physics-before-same-vehicle.patch => 0121-For-collision-check-has-physics-before-same-vehicle.patch} (100%) rename patches/server/{0121-Skip-negligible-planar-movement-multiplication.patch => 0122-Skip-negligible-planar-movement-multiplication.patch} (100%) rename patches/server/{0122-Reduce-RandomSource-instances.patch => 0123-Reduce-RandomSource-instances.patch} (100%) rename patches/server/{0123-Server-thread-priority-environment-variable.patch => 0124-Server-thread-priority-environment-variable.patch} (100%) rename patches/server/{0124-Thread-safety-annotations.patch => 0125-Thread-safety-annotations.patch} (100%) rename patches/server/{0125-CPU-cores-estimation.patch => 0126-CPU-cores-estimation.patch} (100%) rename patches/server/{0126-Mutex-utility.patch => 0127-Mutex-utility.patch} (100%) rename patches/server/{0127-Paired-lock-and-condition-utility.patch => 0128-Paired-lock-and-condition-utility.patch} (100%) rename patches/server/{0128-Unterminable-executor-utility.patch => 0129-Unterminable-executor-utility.patch} (100%) rename patches/server/{0129-FIFO-concurrent-queue-utility.patch => 0130-FIFO-concurrent-queue-utility.patch} (100%) rename patches/server/{0130-Base-thread-pools.patch => 0131-Base-thread-pools.patch} (100%) rename patches/server/{0131-Non-blocking-PooledObjects.patch => 0132-Non-blocking-PooledObjects.patch} (100%) diff --git a/patches/server/0094-Skip-secondary-POI-sensor-if-absent.patch b/patches/server/0094-Skip-secondary-POI-sensor-if-absent.patch new file mode 100644 index 0000000..6a0d233 --- /dev/null +++ b/patches/server/0094-Skip-secondary-POI-sensor-if-absent.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martijn Muijsers +Date: Sun, 25 Dec 2022 10:47:29 +0100 +Subject: [PATCH] Skip secondary POI sensor if absent + +License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) +Gale - https://galemc.org + +This patch is based on the following mixin: +"me/jellysquid/mods/lithium/mixin/ai/sensor/secondary_poi/SecondaryPointsOfInterestSensorMixin.java" +By: 2No2Name <2No2Name@web.de> +As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric) +Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) + +* Lithium description * + +villagers that have no secondary POI (farmland) do not search for it + +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java +index cb1d91f9fe98f21c2afbe3894dfd9bca3bdd3ba6..75dc06a3041bfdfb08c914eb50cfa282ae9eb2fe 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java +@@ -22,6 +22,13 @@ public class SecondaryPoiSensor extends Sensor { + + @Override + protected void doTick(ServerLevel world, Villager entity) { ++ // Gale start - Lithium - skip secondary POI sensor if absent ++ var secondaryPoi = entity.getVillagerData().getProfession().secondaryPoi(); ++ if (secondaryPoi.isEmpty()) { ++ entity.getBrain().eraseMemory(MemoryModuleType.SECONDARY_JOB_SITE); ++ return; ++ } ++ // Gale end - Lithium - skip secondary POI sensor if absent + ResourceKey resourceKey = world.dimension(); + BlockPos blockPos = entity.blockPosition(); + List list = Lists.newArrayList(); diff --git a/patches/server/0094-Skip-entity-move-if-movement-is-zero.patch b/patches/server/0095-Skip-entity-move-if-movement-is-zero.patch similarity index 100% rename from patches/server/0094-Skip-entity-move-if-movement-is-zero.patch rename to patches/server/0095-Skip-entity-move-if-movement-is-zero.patch diff --git a/patches/server/0095-Store-mob-counts-in-an-array.patch b/patches/server/0096-Store-mob-counts-in-an-array.patch similarity index 100% rename from patches/server/0095-Store-mob-counts-in-an-array.patch rename to patches/server/0096-Store-mob-counts-in-an-array.patch diff --git a/patches/server/0096-Use-linked-map-for-entity-trackers.patch b/patches/server/0097-Use-linked-map-for-entity-trackers.patch similarity index 100% rename from patches/server/0096-Use-linked-map-for-entity-trackers.patch rename to patches/server/0097-Use-linked-map-for-entity-trackers.patch diff --git a/patches/server/0097-Optimize-noise-generation.patch b/patches/server/0098-Optimize-noise-generation.patch similarity index 100% rename from patches/server/0097-Optimize-noise-generation.patch rename to patches/server/0098-Optimize-noise-generation.patch diff --git a/patches/server/0098-Optimize-sheep-offspring-color.patch b/patches/server/0099-Optimize-sheep-offspring-color.patch similarity index 100% rename from patches/server/0098-Optimize-sheep-offspring-color.patch rename to patches/server/0099-Optimize-sheep-offspring-color.patch diff --git a/patches/server/0099-Ignore-durability-change-equipment-updates.patch b/patches/server/0100-Ignore-durability-change-equipment-updates.patch similarity index 100% rename from patches/server/0099-Ignore-durability-change-equipment-updates.patch rename to patches/server/0100-Ignore-durability-change-equipment-updates.patch diff --git a/patches/server/0100-Hide-flames-on-entities-with-fire-resistance.patch b/patches/server/0101-Hide-flames-on-entities-with-fire-resistance.patch similarity index 100% rename from patches/server/0100-Hide-flames-on-entities-with-fire-resistance.patch rename to patches/server/0101-Hide-flames-on-entities-with-fire-resistance.patch diff --git a/patches/server/0101-Skip-cloning-advancement-criteria.patch b/patches/server/0102-Skip-cloning-advancement-criteria.patch similarity index 100% rename from patches/server/0101-Skip-cloning-advancement-criteria.patch rename to patches/server/0102-Skip-cloning-advancement-criteria.patch diff --git a/patches/server/0102-Reduce-block-destruction-packet-allocations.patch b/patches/server/0103-Reduce-block-destruction-packet-allocations.patch similarity index 100% rename from patches/server/0102-Reduce-block-destruction-packet-allocations.patch rename to patches/server/0103-Reduce-block-destruction-packet-allocations.patch diff --git a/patches/server/0103-Send-set-head-rotation-packets-only-for-living-entit.patch b/patches/server/0104-Send-set-head-rotation-packets-only-for-living-entit.patch similarity index 100% rename from patches/server/0103-Send-set-head-rotation-packets-only-for-living-entit.patch rename to patches/server/0104-Send-set-head-rotation-packets-only-for-living-entit.patch diff --git a/patches/server/0104-Player-canSee-by-entity-UUID.patch b/patches/server/0105-Player-canSee-by-entity-UUID.patch similarity index 100% rename from patches/server/0104-Player-canSee-by-entity-UUID.patch rename to patches/server/0105-Player-canSee-by-entity-UUID.patch diff --git a/patches/server/0105-Spread-out-sending-all-player-info.patch b/patches/server/0106-Spread-out-sending-all-player-info.patch similarity index 100% rename from patches/server/0105-Spread-out-sending-all-player-info.patch rename to patches/server/0106-Spread-out-sending-all-player-info.patch diff --git a/patches/server/0106-Optimize-player-list-for-sending-player-info.patch b/patches/server/0107-Optimize-player-list-for-sending-player-info.patch similarity index 100% rename from patches/server/0106-Optimize-player-list-for-sending-player-info.patch rename to patches/server/0107-Optimize-player-list-for-sending-player-info.patch diff --git a/patches/server/0107-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/patches/server/0108-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch similarity index 100% rename from patches/server/0107-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch rename to patches/server/0108-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch diff --git a/patches/server/0108-Send-multiple-keep-alive-packets.patch b/patches/server/0109-Send-multiple-keep-alive-packets.patch similarity index 100% rename from patches/server/0108-Send-multiple-keep-alive-packets.patch rename to patches/server/0109-Send-multiple-keep-alive-packets.patch diff --git a/patches/server/0109-Make-slow-login-timeout-configurable.patch b/patches/server/0110-Make-slow-login-timeout-configurable.patch similarity index 100% rename from patches/server/0109-Make-slow-login-timeout-configurable.patch rename to patches/server/0110-Make-slow-login-timeout-configurable.patch diff --git a/patches/server/0110-Make-max-interaction-distance-configurable.patch b/patches/server/0111-Make-max-interaction-distance-configurable.patch similarity index 100% rename from patches/server/0110-Make-max-interaction-distance-configurable.patch rename to patches/server/0111-Make-max-interaction-distance-configurable.patch diff --git a/patches/server/0111-Prevent-entities-random-strolling-into-non-ticking-c.patch b/patches/server/0112-Prevent-entities-random-strolling-into-non-ticking-c.patch similarity index 100% rename from patches/server/0111-Prevent-entities-random-strolling-into-non-ticking-c.patch rename to patches/server/0112-Prevent-entities-random-strolling-into-non-ticking-c.patch diff --git a/patches/server/0112-CraftBukkit-UUID-to-world-map.patch b/patches/server/0113-CraftBukkit-UUID-to-world-map.patch similarity index 100% rename from patches/server/0112-CraftBukkit-UUID-to-world-map.patch rename to patches/server/0113-CraftBukkit-UUID-to-world-map.patch diff --git a/patches/server/0113-Don-t-double-save-stored-user-lists.patch b/patches/server/0114-Don-t-double-save-stored-user-lists.patch similarity index 100% rename from patches/server/0113-Don-t-double-save-stored-user-lists.patch rename to patches/server/0114-Don-t-double-save-stored-user-lists.patch diff --git a/patches/server/0114-Specific-interval-TPS-API.patch b/patches/server/0115-Specific-interval-TPS-API.patch similarity index 100% rename from patches/server/0114-Specific-interval-TPS-API.patch rename to patches/server/0115-Specific-interval-TPS-API.patch diff --git a/patches/server/0115-5-second-TPS-average.patch b/patches/server/0116-5-second-TPS-average.patch similarity index 100% rename from patches/server/0115-5-second-TPS-average.patch rename to patches/server/0116-5-second-TPS-average.patch diff --git a/patches/server/0116-Measure-last-tick-time.patch b/patches/server/0117-Measure-last-tick-time.patch similarity index 100% rename from patches/server/0116-Measure-last-tick-time.patch rename to patches/server/0117-Measure-last-tick-time.patch diff --git a/patches/server/0117-Last-tick-time-API.patch b/patches/server/0118-Last-tick-time-API.patch similarity index 100% rename from patches/server/0117-Last-tick-time-API.patch rename to patches/server/0118-Last-tick-time-API.patch diff --git a/patches/server/0118-Show-last-tick-time-in-tps-command.patch b/patches/server/0119-Show-last-tick-time-in-tps-command.patch similarity index 100% rename from patches/server/0118-Show-last-tick-time-in-tps-command.patch rename to patches/server/0119-Show-last-tick-time-in-tps-command.patch diff --git a/patches/server/0119-Increase-time-statistics-in-intervals.patch b/patches/server/0120-Increase-time-statistics-in-intervals.patch similarity index 100% rename from patches/server/0119-Increase-time-statistics-in-intervals.patch rename to patches/server/0120-Increase-time-statistics-in-intervals.patch diff --git a/patches/server/0120-For-collision-check-has-physics-before-same-vehicle.patch b/patches/server/0121-For-collision-check-has-physics-before-same-vehicle.patch similarity index 100% rename from patches/server/0120-For-collision-check-has-physics-before-same-vehicle.patch rename to patches/server/0121-For-collision-check-has-physics-before-same-vehicle.patch diff --git a/patches/server/0121-Skip-negligible-planar-movement-multiplication.patch b/patches/server/0122-Skip-negligible-planar-movement-multiplication.patch similarity index 100% rename from patches/server/0121-Skip-negligible-planar-movement-multiplication.patch rename to patches/server/0122-Skip-negligible-planar-movement-multiplication.patch diff --git a/patches/server/0122-Reduce-RandomSource-instances.patch b/patches/server/0123-Reduce-RandomSource-instances.patch similarity index 100% rename from patches/server/0122-Reduce-RandomSource-instances.patch rename to patches/server/0123-Reduce-RandomSource-instances.patch diff --git a/patches/server/0123-Server-thread-priority-environment-variable.patch b/patches/server/0124-Server-thread-priority-environment-variable.patch similarity index 100% rename from patches/server/0123-Server-thread-priority-environment-variable.patch rename to patches/server/0124-Server-thread-priority-environment-variable.patch diff --git a/patches/server/0124-Thread-safety-annotations.patch b/patches/server/0125-Thread-safety-annotations.patch similarity index 100% rename from patches/server/0124-Thread-safety-annotations.patch rename to patches/server/0125-Thread-safety-annotations.patch diff --git a/patches/server/0125-CPU-cores-estimation.patch b/patches/server/0126-CPU-cores-estimation.patch similarity index 100% rename from patches/server/0125-CPU-cores-estimation.patch rename to patches/server/0126-CPU-cores-estimation.patch diff --git a/patches/server/0126-Mutex-utility.patch b/patches/server/0127-Mutex-utility.patch similarity index 100% rename from patches/server/0126-Mutex-utility.patch rename to patches/server/0127-Mutex-utility.patch diff --git a/patches/server/0127-Paired-lock-and-condition-utility.patch b/patches/server/0128-Paired-lock-and-condition-utility.patch similarity index 100% rename from patches/server/0127-Paired-lock-and-condition-utility.patch rename to patches/server/0128-Paired-lock-and-condition-utility.patch diff --git a/patches/server/0128-Unterminable-executor-utility.patch b/patches/server/0129-Unterminable-executor-utility.patch similarity index 100% rename from patches/server/0128-Unterminable-executor-utility.patch rename to patches/server/0129-Unterminable-executor-utility.patch diff --git a/patches/server/0129-FIFO-concurrent-queue-utility.patch b/patches/server/0130-FIFO-concurrent-queue-utility.patch similarity index 100% rename from patches/server/0129-FIFO-concurrent-queue-utility.patch rename to patches/server/0130-FIFO-concurrent-queue-utility.patch diff --git a/patches/server/0130-Base-thread-pools.patch b/patches/server/0131-Base-thread-pools.patch similarity index 100% rename from patches/server/0130-Base-thread-pools.patch rename to patches/server/0131-Base-thread-pools.patch diff --git a/patches/server/0131-Non-blocking-PooledObjects.patch b/patches/server/0132-Non-blocking-PooledObjects.patch similarity index 100% rename from patches/server/0131-Non-blocking-PooledObjects.patch rename to patches/server/0132-Non-blocking-PooledObjects.patch