mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
mob spawn settings
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user