use of net.dries007.tfc.common.blocks.DirectionPropertyBlock in project TerraFirmaCraft by TerraFirmaCraft.
the class SheetPileBlockEntityRenderer method render.
@Override
public void render(SheetPileBlockEntity pile, float partialTick, PoseStack poseStack, MultiBufferSource buffer, int packedLight, int packedOverlay) {
final BlockState state = pile.getBlockState();
if (state.getBlock() instanceof DirectionPropertyBlock) {
final Function<ResourceLocation, TextureAtlasSprite> textureAtlas = Minecraft.getInstance().getTextureAtlas(RenderHelpers.BLOCKS_ATLAS);
final VertexConsumer builder = buffer.getBuffer(RenderType.cutout());
for (Direction direction : Helpers.DIRECTIONS) {
if (// The properties are authoritative on which sides should be rendered
state.getValue(DirectionPropertyBlock.getProperty(direction))) {
final Metal metal = pile.getOrCacheMetal(direction);
final TextureAtlasSprite sprite = textureAtlas.apply(metal.getTextureId());
renderSheet(poseStack, sprite, builder, direction, packedLight, packedOverlay);
}
}
}
}
Aggregations