diff --git a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch index d3c61cfe..1e725029 100644 --- a/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch +++ b/leaf-server/minecraft-patches/features/0070-Replace-brain-maps-with-optimized-collection.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace brain maps with optimized collection diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 083eb9a7a0bc14d30db944f356d98ca552fa1784..0f50db187e04582e9b66a63201af987f6db74939 100644 +index 083eb9a7a0bc14d30db944f356d98ca552fa1784..10986e50bd3307f81074c4cb371eb4d7defc9cfc 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -45,14 +45,18 @@ public class Brain { @@ -14,11 +14,10 @@ index 083eb9a7a0bc14d30db944f356d98ca552fa1784..0f50db187e04582e9b66a63201af987f private static final int SCHEDULE_UPDATE_DELAY = 20; - private final Map, Optional>> memories = Maps.newHashMap(); - private final Map>, Sensor> sensors = Maps.newLinkedHashMap(); -- private final Map>>> availableBehaviorsByPriority = Maps.newTreeMap(); + // Leaf start - Replace brain maps with optimized collection + private final Map, Optional>> memories = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>(); + private final Map>, Sensor> sensors = new it.unimi.dsi.fastutil.objects.Reference2ReferenceLinkedOpenHashMap<>(); -+ private final Map>>> availableBehaviorsByPriority = org.dreeam.leaf.config.modules.async.MultithreadedTracker.compatModeEnabled ? Maps.newTreeMap() : new it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<>(); + private final Map>>> availableBehaviorsByPriority = Maps.newTreeMap(); + // Leaf end - Replace brain maps with optimized collection private Schedule schedule = Schedule.EMPTY; - private final Map, MemoryStatus>>> activityRequirements = Maps.newHashMap();