Browse Source

1.1 Update

Unknown 6 years ago
parent
commit
91ae2900bc
2 changed files with 4 additions and 2 deletions
  1. 1 1
      build.gradle
  2. 3 1
      src/main/java/me/shedaniel/lightoverlay/LightOverlay.java

+ 1 - 1
build.gradle

@@ -11,7 +11,7 @@ buildscript {
 apply plugin: 'net.minecraftforge.gradle'
 apply plugin: 'net.minecraftforge.gradle'
 apply plugin: 'eclipse'
 apply plugin: 'eclipse'
 
 
-version = "1.0"
+version = "1.1"
 group = "me.shedaniel" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
 group = "me.shedaniel" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
 archivesBaseName = "LightOverlay"
 archivesBaseName = "LightOverlay"
 
 

+ 3 - 1
src/main/java/me/shedaniel/lightoverlay/LightOverlay.java

@@ -21,6 +21,7 @@ import net.minecraft.util.math.shapes.VoxelShape;
 import net.minecraft.util.text.TranslationTextComponent;
 import net.minecraft.util.text.TranslationTextComponent;
 import net.minecraft.world.LightType;
 import net.minecraft.world.LightType;
 import net.minecraft.world.World;
 import net.minecraft.world.World;
+import net.minecraft.world.biome.Biome;
 import net.minecraftforge.api.distmarker.Dist;
 import net.minecraftforge.api.distmarker.Dist;
 import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.api.distmarker.OnlyIn;
 import net.minecraftforge.client.event.InputEvent;
 import net.minecraftforge.client.event.InputEvent;
@@ -118,7 +119,8 @@ public class LightOverlay {
             GlStateManager.disableBlend();
             GlStateManager.disableBlend();
             BlockPos playerPos = new BlockPos(playerEntity.posX, playerEntity.posY, playerEntity.posZ);
             BlockPos playerPos = new BlockPos(playerEntity.posX, playerEntity.posY, playerEntity.posZ);
             BlockPos.getAllInBox(playerPos.add(-reach, -reach, -reach), playerPos.add(reach, reach, reach)).forEach(pos -> {
             BlockPos.getAllInBox(playerPos.add(-reach, -reach, -reach), playerPos.add(reach, reach, reach)).forEach(pos -> {
-                if (world.getBiome(pos).getSpawningChance() > 0) {
+                Biome biome = world.getBiome(pos);
+                if (biome.getSpawningChance() > 0 && !biome.getSpawns(EntityClassification.MONSTER).isEmpty()) {
                     CrossType type = LightOverlay.getCrossType(pos, world, playerEntity);
                     CrossType type = LightOverlay.getCrossType(pos, world, playerEntity);
                     if (type != CrossType.NONE) {
                     if (type != CrossType.NONE) {
                         VoxelShape shape = world.getBlockState(pos).getCollisionShape(world, pos);
                         VoxelShape shape = world.getBlockState(pos).getCollisionShape(world, pos);