]> git.lizzy.rs Git - LightOverlay.git/commitdiff
Fix an issue where crosses appear in mushroom biomes (#56)
authorIan Howell <ian.howell0@gmail.com>
Thu, 3 Sep 2020 11:02:24 +0000 (06:02 -0500)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 11:02:24 +0000 (19:02 +0800)
Co-authored-by: Your Name <you@example.com>
fabric/src/main/java/me/shedaniel/lightoverlay/fabric/LightOverlay.java
forge/src/main/java/me/shedaniel/lightoverlay/forge/LightOverlayClient.java

index 86affd0dbb8c2013b733b2dd5afaa22b0db2e642..e6cae4a74b35dabad4ecb1a3883a6efa592db1dc 100644 (file)
@@ -117,9 +117,12 @@ public class LightOverlay implements ClientModInitializer {
                                     map.put(blockPos.asLong(), Integer.valueOf(level));
                                 }
                             } else {
-                                CrossType type = getCrossType(blockPos, downPos, world, block, sky, entityContext);
-                                if (type != CrossType.NONE) {
-                                    map.put(blockPos.asLong(), type);
+                                SpawnSettings spawnSettings = world.getBiomeAccess().getBiome(blockPos).getSpawnSettings();
+                                if (spawnSettings.getCreatureSpawnProbability() > 0 && !spawnSettings.getSpawnEntry(EntityCategory.MONSTER).isEmpty()) {
+                                    CrossType type = getCrossType(blockPos, downPos, world, block, sky, entityContext);
+                                    if (type != CrossType.NONE) {
+                                        map.put(blockPos.asLong(), type);
+                                    }
                                 }
                             }
                         }
index 1ff0c8a3108bbe14603d07ee53a55c131962d0b2..87fa87572fcaef4d7c0d3ea6d60e1741f1f9f548 100644 (file)
@@ -261,9 +261,12 @@ public class LightOverlayClient {
                                     map.put(blockPos.toLong(), Integer.valueOf(level));
                                 }
                             } else {
-                                CrossType type = getCrossType(blockPos, downPos, world, block, sky, entityContext);
-                                if (type != CrossType.NONE) {
-                                    map.put(blockPos.toLong(), type);
+                                MobSpawnInfo spawnInfo = world.getBiomeManager().getBiome(blockPos).func_242433_b();
+                                if (spawnInfo.func_242557_a() > 0 && !spawnInfo.func_242559_a(EntityClassification.MONSTER).isEmpty()) {
+                                    CrossType type = getCrossType(blockPos, downPos, world, block, sky, entityContext);
+                                    if (type != CrossType.NONE) {
+                                        map.put(blockPos.toLong(), type);
+                                    }
                                 }
                             }
                         }