Search in sources :

Example 1 with Value

use of link.infra.indium.renderer.RenderMaterialImpl.Value in project Indium by comp500.

the class TerrainFallbackConsumer method accept.

@Override
public void accept(BakedModel model) {
    final Supplier<Random> random = blockInfo.randomSupplier;
    final Value defaultMaterial = blockInfo.defaultAo && model.useAmbientOcclusion() ? MATERIAL_SHADED : MATERIAL_FLAT;
    final BlockState blockState = blockInfo.blockState;
    for (int i = 0; i < 6; i++) {
        final Direction face = ModelHelper.faceFromIndex(i);
        final List<BakedQuad> quads = model.getQuads(blockState, face, random.get());
        final int count = quads.size();
        if (count != 0) {
            for (int j = 0; j < count; j++) {
                final BakedQuad q = quads.get(j);
                renderQuad(q, face, defaultMaterial);
            }
        }
    }
    final List<BakedQuad> quads = model.getQuads(blockState, null, random.get());
    final int count = quads.size();
    if (count != 0) {
        for (int j = 0; j < count; j++) {
            final BakedQuad q = quads.get(j);
            renderQuad(q, null, defaultMaterial);
        }
    }
}
Also used : BakedQuad(net.minecraft.client.render.model.BakedQuad) BlockState(net.minecraft.block.BlockState) Random(java.util.Random) Value(link.infra.indium.renderer.RenderMaterialImpl.Value) Direction(net.minecraft.util.math.Direction)

Aggregations

Random (java.util.Random)1 Value (link.infra.indium.renderer.RenderMaterialImpl.Value)1 BlockState (net.minecraft.block.BlockState)1 BakedQuad (net.minecraft.client.render.model.BakedQuad)1 Direction (net.minecraft.util.math.Direction)1