Search in sources :

Example 51 with SuperByteBuffer

use of com.simibubi.create.foundation.render.SuperByteBuffer in project SteamPowered by TeamMoegMC.

the class BronzeFlywheelRenderer method renderFlywheel.

private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
    BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
    Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
    SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.BRONZE_FLYWHEEL, referenceState, facing);
    kineticRotationTransform(wheel, te, ((Direction) blockState.getValue(HorizontalKineticBlock.HORIZONTAL_FACING)).getAxis(), AngleHelper.rad((double) angle), light);
    wheel.renderInto(ms, vb);
}
Also used : BlockState(net.minecraft.block.BlockState) SuperByteBuffer(com.simibubi.create.foundation.render.SuperByteBuffer) Direction(net.minecraft.util.Direction)

Example 52 with SuperByteBuffer

use of com.simibubi.create.foundation.render.SuperByteBuffer in project SteamPowered by TeamMoegMC.

the class CastIronFlywheelRenderer method renderFlywheel.

private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
    BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
    Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
    SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.CAST_IRON_FLYWHEEL, referenceState, facing);
    kineticRotationTransform(wheel, te, ((Direction) blockState.getValue(HorizontalKineticBlock.HORIZONTAL_FACING)).getAxis(), AngleHelper.rad((double) angle), light);
    wheel.renderInto(ms, vb);
}
Also used : BlockState(net.minecraft.block.BlockState) SuperByteBuffer(com.simibubi.create.foundation.render.SuperByteBuffer) Direction(net.minecraft.util.Direction)

Example 53 with SuperByteBuffer

use of com.simibubi.create.foundation.render.SuperByteBuffer in project SteamPowered by TeamMoegMC.

the class SteelFlywheelRenderer method renderFlywheel.

private void renderFlywheel(KineticTileEntity te, MatrixStack ms, int light, BlockState blockState, float angle, IVertexBuilder vb) {
    BlockState referenceState = blockState.rotate(Rotation.CLOCKWISE_90);
    Direction facing = (Direction) referenceState.getValue(BlockStateProperties.HORIZONTAL_FACING);
    SuperByteBuffer wheel = PartialBufferer.getFacing(SPBlockPartials.STEEL_FLYWHEEL, referenceState, facing);
    kineticRotationTransform(wheel, te, ((Direction) blockState.getValue(HorizontalKineticBlock.HORIZONTAL_FACING)).getAxis(), AngleHelper.rad((double) angle), light);
    wheel.renderInto(ms, vb);
}
Also used : BlockState(net.minecraft.block.BlockState) SuperByteBuffer(com.simibubi.create.foundation.render.SuperByteBuffer) Direction(net.minecraft.util.Direction)

Aggregations

SuperByteBuffer (com.simibubi.create.foundation.render.SuperByteBuffer)53 BlockState (net.minecraft.world.level.block.state.BlockState)30 Direction (net.minecraft.core.Direction)20 VertexConsumer (com.mojang.blaze3d.vertex.VertexConsumer)18 BlockPos (net.minecraft.core.BlockPos)12 PartialModel (com.jozufozu.flywheel.core.PartialModel)11 Axis (net.minecraft.core.Direction.Axis)7 Vec3 (net.minecraft.world.phys.Vec3)7 TransformStack (com.jozufozu.flywheel.util.transform.TransformStack)5 PoseStack (com.mojang.blaze3d.vertex.PoseStack)5 BlockState (net.minecraft.block.BlockState)5 AxisDirection (net.minecraft.core.Direction.AxisDirection)4 BufferBuilder (com.mojang.blaze3d.vertex.BufferBuilder)3 IRotate (com.simibubi.create.content.contraptions.base.IRotate)3 RenderType (net.minecraft.client.renderer.RenderType)3 Direction (net.minecraft.util.Direction)3 ShadeSeparatedBufferBuilder (com.jozufozu.flywheel.core.model.ShadeSeparatedBufferBuilder)2 ShadeSeparatingVertexConsumer (com.jozufozu.flywheel.core.model.ShadeSeparatingVertexConsumer)2 Random (java.util.Random)2 BlockRenderDispatcher (net.minecraft.client.renderer.block.BlockRenderDispatcher)2