Implemented Secondary Shaft To Large Renderer

This commit is contained in:
Rabbitminers 2023-03-23 18:50:18 +00:00
parent 6cd40cc6f9
commit 9920536cc3

View file

@ -38,6 +38,8 @@ public class StandardBogeyRenderer extends BogeyRenderer {
public void initialiseContraptionModelData(MaterialManager materialManager, BogeySize size) {
// Large
createModelInstances(materialManager, LARGE_BOGEY_WHEELS, BOGEY_DRIVE, BOGEY_PISTON, BOGEY_PIN);
createModelInstances(materialManager, AllBlocks.SHAFT.getDefaultState()
.setValue(ShaftBlock.AXIS, Direction.Axis.X), 2);
// Small
createModelInstances(materialManager, SMALL_BOGEY_WHEELS, 2);
createModelInstances(materialManager, BOGEY_FRAME);
@ -79,11 +81,23 @@ public class StandardBogeyRenderer extends BogeyRenderer {
}
}
public void renderLarge(CompoundTag bogeyData, float wheelAngle, PoseStack ms, int light,
public void renderLarge(CompoundTag bogeyData, float wheelAngle, PoseStack ms, int light,
@Nullable VertexConsumer vb) {
boolean inContraption = vb == null;
Transform<?>[] secondaryShafts = getTransformsFromBlockState(AllBlocks.SHAFT.getDefaultState()
.setValue(ShaftBlock.AXIS, Direction.Axis.X), ms, inContraption, 2);
for (int i : Iterate.zeroAndOne) {
Transform<?> secondShaft = secondaryShafts[i];
secondShaft.translate(-.5f, .25f, .5f + i * -2)
.centre()
.rotateX(wheelAngle)
.unCentre();
finalize(secondShaft, ms, light, vb);
}
Transform<?> bogeyDrive = getTransformFromPartial(BOGEY_DRIVE, ms, inContraption);
finalize(bogeyDrive, ms, light, vb);