From c6bd6cf94fc9eca90eee4bc4772a3468b4ba8258 Mon Sep 17 00:00:00 2001 From: Cryptite Date: Fri, 29 Oct 2021 11:02:41 -0500 Subject: [PATCH] Also lazy check here for stripped --- .../0016-Block-Mob-Spawns-globally-by-EntityType.patch | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/patches/server/0016-Block-Mob-Spawns-globally-by-EntityType.patch b/patches/server/0016-Block-Mob-Spawns-globally-by-EntityType.patch index a42064ba0..d4cfe53d6 100644 --- a/patches/server/0016-Block-Mob-Spawns-globally-by-EntityType.patch +++ b/patches/server/0016-Block-Mob-Spawns-globally-by-EntityType.patch @@ -26,7 +26,7 @@ index 0277627e97b51e20470ccf578cee48470e06a34b..c73bbfdd44f674b221574782cb8d6c3c + // Slice end } diff --git a/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java b/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java -index 86528ff031014e788d72a8bf7c1c9443512096bb..ff5c6d262b0e5d4fad85edd060460f087bd6e5e8 100644 +index 86528ff031014e788d72a8bf7c1c9443512096bb..f66e6f750136fc3903acbcb7502e98e21e75fe5a 100644 --- a/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java +++ b/src/main/java/net/minecraft/world/level/biome/MobSpawnSettings.java @@ -41,9 +41,10 @@ public class MobSpawnSettings { @@ -42,7 +42,7 @@ index 86528ff031014e788d72a8bf7c1c9443512096bb..ff5c6d262b0e5d4fad85edd060460f08 MobSpawnSettings(float creatureSpawnProbability, Map> spawners, Map, MobSpawnSettings.MobSpawnCost> spawnCosts, boolean playerSpawnFriendly) { this.creatureGenerationProbability = creatureSpawnProbability; -@@ -52,7 +53,43 @@ public class MobSpawnSettings { +@@ -52,12 +53,49 @@ public class MobSpawnSettings { this.playerSpawnFriendly = playerSpawnFriendly; } @@ -86,3 +86,9 @@ index 86528ff031014e788d72a8bf7c1c9443512096bb..ff5c6d262b0e5d4fad85edd060460f08 return this.spawners.getOrDefault(spawnGroup, EMPTY_MOB_LIST); } + @Nullable + public MobSpawnSettings.MobSpawnCost getMobSpawnCost(EntityType entityType) { ++ if (!stripped) stripSpawnData(); // Slice + return this.mobSpawnCosts.get(entityType); + } +