mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 06:27:41 +01:00
Implemented Secondary Shaft To Large Renderer
This commit is contained in:
parent
6cd40cc6f9
commit
9920536cc3
1 changed files with 15 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue