Fix LOD color generation

This commit is contained in:
James Seibel
2021-02-26 17:40:53 -06:00
parent fb0ff2a00c
commit 7acad77eda
2 changed files with 4 additions and 13 deletions
@@ -10,9 +10,9 @@ import com.backsun.lod.objects.LodWorld;
import com.backsun.lod.util.LodUtils;
import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
import net.minecraft.world.server.ServerWorld;
/**
* This object is in charge of creating Lod
@@ -53,7 +53,7 @@ public class LodBuilder
DimensionType dim = chunk.getWorld().getDimensionType();
World world = LodUtils.getServerWorldFromDimension(dim);
ServerWorld world = LodUtils.getServerWorldFromDimension(dim);
if (world == null)
@@ -9,7 +9,6 @@ import com.backsun.lod.util.enums.LodLocation;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.color.BlockColors;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
@@ -497,11 +496,7 @@ public class LodChunk
for(int y = topStart; !foundBlock && y >= topMin && y < topMax; y += topIncrement)
{
int ci;
if(chunkSections[i].getBlockState(x, y, z).getBlock() == Blocks.WATER)
// this is a special case since getColor on water generally returns white
ci = waterColor;
else
ci = bc.getColor(chunkSections[i].getBlockState(x, y, z), null, new BlockPos(x,y,z), 0);
ci = chunkSections[i].getBlockState(x, y, z).getMaterial().getColor().colorValue;
if(ci == 0)
{
@@ -635,11 +630,7 @@ public class LodChunk
}
int ci;
if(chunkSections[i].getBlockState(x, y, z).getBlock() == Blocks.WATER)
// this is a special case since getColor on water generally returns white
ci = waterColor;
else
ci = bc.getColor(chunkSections[i].getBlockState(x, y, z), null, new BlockPos(x,y,z), 0);
ci = chunkSections[i].getBlockState(x, y, z).getMaterial().getColor().colorValue;
if (ci == 0) {
// skip air or invisible blocks