mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-28 22:05:01 +01:00
Update copycat occlusion
This commit is contained in:
parent
e03c191edd
commit
37b49a2c45
2 changed files with 11 additions and 7 deletions
|
@ -9,7 +9,7 @@ import com.simibubi.create.foundation.placement.IPlacementHelper;
|
|||
import com.simibubi.create.foundation.placement.PlacementHelpers;
|
||||
import com.simibubi.create.foundation.placement.PlacementOffset;
|
||||
|
||||
import com.simibubi.create.foundation.utility.worldWrappers.OcclusionTestWorld;
|
||||
import com.simibubi.create.foundation.utility.worldWrappers.OcclusionTestLevel;
|
||||
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -188,12 +188,16 @@ public class CopycatPanelBlock extends WaterloggedCopycatBlock {
|
|||
if (material.skipRendering(otherMaterial, dir.getOpposite()))
|
||||
return isOccluded(state, neighborState, dir.getOpposite());
|
||||
|
||||
OcclusionTestWorld occlusionTestWorld = new OcclusionTestWorld();
|
||||
occlusionTestWorld.setBlock(pos, material);
|
||||
occlusionTestWorld.setBlock(otherPos, otherMaterial);
|
||||
if (material.isSolidRender(occlusionTestWorld, pos) && otherMaterial.isSolidRender(occlusionTestWorld, otherPos))
|
||||
if(!Block.shouldRenderFace(otherMaterial, occlusionTestWorld, pos, dir.getOpposite(), otherPos))
|
||||
OcclusionTestLevel occlusionTestLevel = new OcclusionTestLevel();
|
||||
occlusionTestLevel.setBlock(pos, material);
|
||||
occlusionTestLevel.setBlock(otherPos, otherMaterial);
|
||||
if (material.isSolidRender(occlusionTestLevel, pos) && otherMaterial.isSolidRender(occlusionTestLevel, otherPos))
|
||||
if(!Block.shouldRenderFace(otherMaterial, occlusionTestLevel, pos, dir.getOpposite(), otherPos)) {
|
||||
occlusionTestLevel.clear();
|
||||
return isOccluded(state, neighborState, dir.getOpposite());
|
||||
}
|
||||
|
||||
occlusionTestLevel.clear();
|
||||
}
|
||||
|
||||
return state.getValue(FACING) == dir.getOpposite()
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
|||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
public class OcclusionTestWorld implements BlockGetter {
|
||||
public class OcclusionTestLevel implements BlockGetter {
|
||||
private final Map<BlockPos, BlockState> blocks = new HashMap<>();
|
||||
|
||||
public void setBlock(BlockPos pos, BlockState state) {
|
Loading…
Reference in a new issue