From d817d5762b7fae4b5a5ae6b14317282f17e57766 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sun, 3 Sep 2023 14:35:10 -0400 Subject: [PATCH] Fix Chisels & Bits glass Fixes #71 --- .../dynamic_resources/VoxelBlobMixin.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/embeddedt/vintagefix/mixin/dynamic_resources/VoxelBlobMixin.java b/src/main/java/org/embeddedt/vintagefix/mixin/dynamic_resources/VoxelBlobMixin.java index ff35b34..eaacf5a 100644 --- a/src/main/java/org/embeddedt/vintagefix/mixin/dynamic_resources/VoxelBlobMixin.java +++ b/src/main/java/org/embeddedt/vintagefix/mixin/dynamic_resources/VoxelBlobMixin.java @@ -62,23 +62,27 @@ public boolean filter(BlockRenderLayer layer) { Int2BooleanOpenHashMap layerFilterMap = vfix$layerFilters.get(layer); for(int i = 0; i < array_size; i++) { int blockId = this.values[i]; - boolean isInLayer = false; - synchronized (layerFilterMap) { - if(!layerFilterMap.containsKey(blockId)) { - Block block = Block.getBlockById(blockId); - for(IBlockState state : block.getBlockState().getValidStates()) { - if(state.getBlock() != block) - continue; - isInLayer = block.canRenderInLayer(state, layer); - if(isInLayer) - break; - } - layerFilterMap.put(blockId, isInLayer); - } else - isInLayer = layerFilterMap.get(blockId); + if(blockId != 0) { + boolean isInLayer = false; + synchronized (layerFilterMap) { + if(!layerFilterMap.containsKey(blockId)) { + Block block = Block.getBlockById(blockId); + for(IBlockState state : block.getBlockState().getValidStates()) { + if(state.getBlock() != block) + continue; + isInLayer = block.canRenderInLayer(state, layer); + if(isInLayer) + break; + } + layerFilterMap.put(blockId, isInLayer); + } else + isInLayer = layerFilterMap.get(blockId); + } + if(isInLayer) + return true; + else + this.values[i] = 0; } - if(isInLayer) - return true; } return false; }