Skip to content

Commit

Permalink
Fix Chisels & Bits glass
Browse files Browse the repository at this point in the history
Fixes #71
  • Loading branch information
embeddedt committed Sep 3, 2023
1 parent 8b1e2d7 commit d817d57
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d817d57

Please sign in to comment.