Have getRendererIgnoredBlocks()'s require a level and return a hashset
This commit is contained in:
+4
-5
@@ -23,7 +23,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrappe
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Handles converting {@link ChunkSizedFullDataAccessor}, {@link IIncompleteFullDataSource},
|
||||
@@ -32,7 +32,6 @@ import java.util.HashMap;
|
||||
public class FullDataToRenderDataTransformer
|
||||
{
|
||||
private static final IWrapperFactory WRAPPER_FACTORY = SingletonInjector.INSTANCE.get(IWrapperFactory.class);
|
||||
private static final HashMap<String, ? extends IBlockStateWrapper> RENDERER_IGNORED_BLOCKS = WRAPPER_FACTORY.getRendererIgnoredBlocks();
|
||||
|
||||
|
||||
|
||||
@@ -292,6 +291,7 @@ public class FullDataToRenderDataTransformer
|
||||
boolean colorBelowWithAvoidedBlocks = Config.Client.Advanced.Graphics.Quality.tintWithAvoidedBlocks.get();
|
||||
|
||||
FullDataPointIdMap fullDataMapping = data.getMapping();
|
||||
HashSet<IBlockStateWrapper> blockStatesToIgnore = WRAPPER_FACTORY.getRendererIgnoredBlocks(level.getLevelWrapper());
|
||||
|
||||
boolean isVoid = true;
|
||||
int colorToApplyToNextBlock = -1;
|
||||
@@ -308,10 +308,9 @@ public class FullDataToRenderDataTransformer
|
||||
IBiomeWrapper biome = fullDataMapping.getBiomeWrapper(id);
|
||||
IBlockStateWrapper block = fullDataMapping.getBlockStateWrapper(id);
|
||||
|
||||
if (RENDERER_IGNORED_BLOCKS.containsValue(block))
|
||||
if (blockStatesToIgnore.contains(block))
|
||||
{
|
||||
// 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)
|
||||
// Don't render: air, barriers, light blocks, etc.
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
+7
-2
@@ -23,11 +23,12 @@ import com.seibel.distanthorizons.core.level.IDhLevel;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.worldGeneration.AbstractBatchGenerationEnvironmentWrapper;
|
||||
import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* This handles creating abstract wrapper objects.
|
||||
@@ -41,7 +42,11 @@ public interface IWrapperFactory extends IBindable
|
||||
IBiomeWrapper deserializeBiomeWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper deserializeBlockStateWrapper(String str) throws IOException;
|
||||
IBlockStateWrapper getAirBlockStateWrapper();
|
||||
HashMap<String, ? extends IBlockStateWrapper> getRendererIgnoredBlocks();
|
||||
/**
|
||||
* Returns the set of {@link IBlockStateWrapper}'s that shouldn't be rendered. <br>
|
||||
* Generally this contains blocks like: air, barriers, light blocks, etc.
|
||||
*/
|
||||
HashSet<IBlockStateWrapper> getRendererIgnoredBlocks(ILevelWrapper levelWrapper);
|
||||
|
||||
/**
|
||||
* Specifically designed to be used with the API.
|
||||
|
||||
+1
-2
@@ -2,11 +2,10 @@ 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
|
||||
{
|
||||
/** will only work if a level is currently loaded */
|
||||
String serialize();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user