aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils/render/culling/ReducedWorldProvider.java
blob: 5a2b9d87a7d66bbb541536ac5a9ed4f8b2d2ac92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package de.hysky.skyblocker.utils.render.culling;

import net.minecraft.block.BlockState;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.util.math.BlockPos;

public class ReducedWorldProvider extends WorldProvider {

	@Override
	public boolean isOpaqueFullCube(int x, int y, int z) {
		BlockPos pos = new BlockPos(x, y, z);
		BlockState state = this.world.getBlockState(pos);

		//Fixes edge cases where stairs etc aren't treated as being full blocks for the use case
		boolean isException = state.isIn(BlockTags.STAIRS) || state.isIn(BlockTags.WALLS) || state.isIn(BlockTags.FENCES);

		return isException || this.world.getBlockState(pos).isOpaqueFullCube(this.world, pos);
	}
}