13
0
geforkt von Mirrors/Paper

mob spawn settings

Dieser Commit ist enthalten in:
Lulu13022002 2024-12-13 21:03:19 +01:00
Ursprung d9e895a6d4
Commit 2509faa08e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 491C8F0B8ACDEB01

Datei anzeigen

@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/biome/MobSpawnSettings.java
+++ b/net/minecraft/world/level/biome/MobSpawnSettings.java
@@ -75,8 +75,40 @@
@@ -75,8 +_,40 @@
}
public static class Builder {
@ -36,9 +36,9 @@
+ }
+ // use toImmutableEnumMap collector
private final Map<MobCategory, List<MobSpawnSettings.SpawnerData>> spawners = Stream.of(MobCategory.values())
- .collect(ImmutableMap.toImmutableMap(mobCategory -> (MobCategory)mobCategory, mobCategory -> Lists.newArrayList()));
- .collect(ImmutableMap.toImmutableMap(key -> (MobCategory)key, value -> Lists.newArrayList()));
+ .collect(Maps.toImmutableEnumMap(mobCategory -> (MobCategory)mobCategory, mobCategory -> new MobList())); // Use MobList instead of ArrayList
+ // Paper end - Perf: keep track of data in a pair set to give O(1) contains calls
+ // Paper end - Perf: keep track of data in a pair set to give O(1) contains calls
private final Map<EntityType<?>, MobSpawnSettings.MobSpawnCost> mobSpawnCosts = Maps.newLinkedHashMap();
private float creatureGenerationProbability = 0.1F;