feat: Update rendering block ignores
Barrier blocks, structure void blocks, light blocks, and air blocks now share 2 `HashMap`s that define blocks that should be ignored by the LOD builder.
This commit is contained in:
+8
-4
@@ -18,11 +18,13 @@ import com.seibel.distanthorizons.core.pos.DhSectionPos;
|
||||
import com.seibel.distanthorizons.core.util.FullDataPointUtil;
|
||||
import com.seibel.distanthorizons.core.util.LodUtil;
|
||||
import com.seibel.distanthorizons.core.util.RenderDataPointUtil;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IWrapperFactory;
|
||||
import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Handles converting {@link ChunkSizedFullDataAccessor}, {@link IIncompleteFullDataSource},
|
||||
* and {@link IFullDataSource}'s to {@link ColumnRenderSource}.
|
||||
@@ -30,7 +32,7 @@ import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
|
||||
public class FullDataToRenderDataTransformer
|
||||
{
|
||||
private static final IWrapperFactory WRAPPER_FACTORY = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
|
||||
private static final IBlockStateWrapper AIR = WRAPPER_FACTORY.getAirBlockStateWrapper();
|
||||
private static final HashMap<String, ? extends IBlockStateWrapper> RENDERER_IGNORED_BLOCKS = WRAPPER_FACTORY.getRendererIgnoredBlocks();
|
||||
|
||||
|
||||
|
||||
@@ -305,9 +307,11 @@ public class FullDataToRenderDataTransformer
|
||||
int light = FullDataPointUtil.getLight(fullData);
|
||||
IBiomeWrapper biome = fullDataMapping.getBiomeWrapper(id);
|
||||
IBlockStateWrapper block = fullDataMapping.getBlockStateWrapper(id);
|
||||
if (block.equals(AIR))
|
||||
|
||||
if (RENDERER_IGNORED_BLOCKS.containsValue(block))
|
||||
{
|
||||
// we don't render air
|
||||
// Don't render a block that's marked as ignored by the renderer
|
||||
// This map should include air (if it doesn't, the map either got refactored or something is wrong)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -27,6 +27,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.Abstrac
|
||||
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* This handles creating abstract wrapper objects.
|
||||
@@ -40,6 +41,7 @@ public interface IWrapperFactory extends IBindable
|
||||
IBiomeWrapper deserializeBiomeWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper deserializeBlockStateWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper getAirBlockStateWrapper();
|
||||
HashMap<String, ? extends IBlockStateWrapper> getRendererIgnoredBlocks();
|
||||
|
||||
/**
|
||||
* Specifically designed to be used with the API.
|
||||
|
||||
+2
@@ -2,6 +2,8 @@ package com.seibel.distanthorizons.core.wrapperInterfaces.block;
|
||||
|
||||
import com.seibel.distanthorizons.api.interfaces.block.IDhApiBlockStateWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** A Minecraft version independent way of handling Blocks. */
|
||||
public interface IBlockStateWrapper extends IDhApiBlockStateWrapper
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user