Search in sources :

Example 1 with QuadBuilder

use of net.katsstuff.mirror.client.baked.QuadBuilder in project Solar by ArekkuusuJerii.

the class BakedAlternator method addBaseQuads.

private void addBaseQuads(List<BakedQuad> quads, VertexFormat format) {
    QuadBuilder out = QuadBuilder.withFormat(format).setFrom(0.5F, 8.5F, 0.5F).setTo(7.5F, 15.5F, 7.5F).addFace(EnumFacing.UP, 9F, 16F, 9F, 16F, base).addFace(EnumFacing.DOWN, 9F, 16F, 0F, 7F, base).addFace(EnumFacing.NORTH, 9F, 16F, 0F, 7F, base).addFace(EnumFacing.SOUTH, 9F, 16F, 9F, 16F, base).addFace(EnumFacing.WEST, 0F, 7F, 0F, 7F, base).addFace(EnumFacing.EAST, 0F, 7F, 9F, 16F, base);
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 4; j++) {
            out = out.rotate(EnumFacing.Axis.Y, 90F);
            quads.addAll(out.bakeJava());
        }
        out = out.rotate(EnumFacing.Axis.X, 180F);
    }
}
Also used : QuadBuilder(net.katsstuff.mirror.client.baked.QuadBuilder)

Example 2 with QuadBuilder

use of net.katsstuff.mirror.client.baked.QuadBuilder in project Solar by ArekkuusuJerii.

the class BakedCosmicResonator method getQuads.

@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, VertexFormat format) {
    return cache.compute(state, quads -> {
        if (state == null) {
            quads.addAll(QuadBuilder.withFormat(format).setFrom(5, 5, 5).setTo(11, 11, 11).addAll(5F, 11F, 5F, 11F, full_moon).bakeJava());
        } else {
            MoonPhase phase = state.getValue(MOON_PHASE);
            QuadBuilder builder = QuadBuilder.withFormat(format).setFrom(5, 5, 5).setTo(11, 11, 11).setHasBrightness(true);
            switch(phase) {
                case NEW_MOON:
                    builder = builder.addAll(5F, 11F, 5F, 11F, new_moon);
                    break;
                case FULL_MOON:
                    builder = builder.addAll(5F, 11F, 5F, 11F, full_moon);
                    break;
                case ECLIPSE:
                    builder = builder.addAll(5F, 11F, 5F, 11F, eclipse);
                    break;
                default:
                    {
                        boolean inverse = phase.ordinal() > 4;
                        builder = builder.addFace(EAST, 5F, 11F, 5F, 11F, inverse ? new_moon : full_moon).addFace(WEST, 5F, 11F, 5F, 11F, inverse ? full_moon : new_moon).addFace(UP, 5F, 11F, 5F, 11F, phases.get(phase)).addFace(DOWN, 5F, 11F, 5F, 11F, phases.get(phase)).mirror().addFace(NORTH, 5F, 11F, 5F, 11F, phases.get(phase)).mirror().addFace(SOUTH, 5F, 11F, 5F, 11F, phases.get(phase));
                    }
            }
            quads.addAll(builder.bakeJava());
        }
    });
}
Also used : MoonPhase(arekkuusu.solar.api.state.MoonPhase) QuadBuilder(net.katsstuff.mirror.client.baked.QuadBuilder)

Example 3 with QuadBuilder

use of net.katsstuff.mirror.client.baked.QuadBuilder in project Solar by ArekkuusuJerii.

the class BakedQelaion method getQuads.

@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, VertexFormat format) {
    return cache.compute(state, quads -> {
        boolean hasNode = state != null && state.getValue(BlockQelaion.HAS_NODE);
        quads.addAll(BlockBaker.QELAION.getQuads());
        quads.addAll(QuadBuilder.withFormat(format).setFrom(5, 5, 5).setTo(11, 11, 11).addAll(0, 9, 0, 9, hasNode ? on : off).setHasBrightness(true).bakeJava());
        if (state instanceof IExtendedBlockState) {
            Direction direction = ((IExtendedBlockState) state).getValue(Direction.DIR_UNLISTED);
            if (direction != null && direction != Direction.NON) {
                QuadBuilder builder = QuadBuilder.withFormat(format).setFrom(2, 2, 2).setTo(14, 14, 14);
                for (EnumFacing facing : direction.getFacings()) builder = builder.addFace(facing, 2, 14, 2, 14, base);
                quads.addAll(builder.bakeJava());
            }
        }
    });
}
Also used : IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) EnumFacing(net.minecraft.util.EnumFacing) QuadBuilder(net.katsstuff.mirror.client.baked.QuadBuilder) Direction(arekkuusu.solar.api.state.Direction)

Aggregations

QuadBuilder (net.katsstuff.mirror.client.baked.QuadBuilder)3 Direction (arekkuusu.solar.api.state.Direction)1 MoonPhase (arekkuusu.solar.api.state.MoonPhase)1 EnumFacing (net.minecraft.util.EnumFacing)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1