diff options
author | makamys <makamys@outlook.com> | 2021-05-23 10:10:26 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-23 10:10:26 +0200 |
commit | 0b85478110c9cba9a6d200d176ffc3cf09a61b30 (patch) | |
tree | 2e5c2fa0500d5b325c2bfeb1aebc196765183031 /src | |
parent | 79cd910660eb3caa9e181772372e920a3b92c7ee (diff) | |
download | Neodymium-0b85478110c9cba9a6d200d176ffc3cf09a61b30.tar.gz Neodymium-0b85478110c9cba9a6d200d176ffc3cf09a61b30.tar.bz2 Neodymium-0b85478110c9cba9a6d200d176ffc3cf09a61b30.zip |
Ignore BOP logs and GT6 tile entities in, make blacklist configurable
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/makamys/lodmod/LODMod.java | 16 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java index 91f965f..7d29e5b 100644 --- a/src/main/java/makamys/lodmod/LODMod.java +++ b/src/main/java/makamys/lodmod/LODMod.java @@ -13,6 +13,10 @@ import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; import java.io.File; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -40,6 +44,7 @@ public class LODMod public static LODRenderer renderer; public static int chunkLoadsPerTick; + public static List<Class> blockClassBlacklist; private File configFile; @@ -57,6 +62,17 @@ public class LODMod config.load(); chunkLoadsPerTick = config.get("Options", "chunkLoadsPerTick", 64).getInt(); + blockClassBlacklist = Arrays.stream(config.get("Options", "blockClassBlacklist", "net.minecraft.block.BlockRotatedPillar;biomesoplenty.common.blocks.BlockBOPLog;gregapi.block.multitileentity.MultiTileEntityBlock").getString().split(";")) + .map(className -> { + try { + return Class.forName(className); + } catch (ClassNotFoundException e) { + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + if(config.hasChanged()) { config.save(); } diff --git a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java index 77b9a93..04c16a4 100644 --- a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java +++ b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java @@ -20,7 +20,6 @@ import makamys.lodmod.LODMod; import net.minecraft.block.Block; import net.minecraft.block.BlockGrass; import net.minecraft.block.BlockLeaves; -import net.minecraft.block.BlockLog; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlasSprite; @@ -45,7 +44,12 @@ public class SimpleChunkMesh extends Mesh { } private static boolean isBad(Block block) { - return block instanceof BlockLog; + for(Class clazz : LODMod.blockClassBlacklist) { + if(clazz.isInstance(block)) { + return true; + } + } + return false; } public static List<SimpleChunkMesh> generateSimpleMeshes(Chunk target){ |