use of com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part in project Create by Creators-of-Create.
the class EncasedBeltGenerator method getModelSuffix.
protected String getModelSuffix(BlockState state) {
EncasedBeltBlock.Part part = state.getValue(EncasedBeltBlock.PART);
Axis axis = state.getValue(EncasedBeltBlock.AXIS);
if (part == Part.NONE)
return "single";
String orientation = axis == Axis.Y ? "vertical" : "horizontal";
String section = part == Part.MIDDLE ? "middle" : "end";
return section + "_" + orientation;
}
use of com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part in project Create by Creators-of-Create.
the class EncasedBeltGenerator method getXRotation.
@Override
protected int getXRotation(BlockState state) {
EncasedBeltBlock.Part part = state.getValue(EncasedBeltBlock.PART);
boolean connectedAlongFirst = state.getValue(EncasedBeltBlock.CONNECTED_ALONG_FIRST_COORDINATE);
Axis axis = state.getValue(EncasedBeltBlock.AXIS);
if (part == Part.NONE)
return axis == Axis.Y ? 90 : 0;
if (axis == Axis.X)
return (connectedAlongFirst ? 90 : 0) + (part == Part.START ? 180 : 0);
if (axis == Axis.Z)
return (connectedAlongFirst ? 0 : (part == Part.START ? 270 : 90));
return 0;
}
use of com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part in project Create by Creators-of-Create.
the class EncasedBeltGenerator method getYRotation.
@Override
protected int getYRotation(BlockState state) {
EncasedBeltBlock.Part part = state.getValue(EncasedBeltBlock.PART);
boolean connectedAlongFirst = state.getValue(EncasedBeltBlock.CONNECTED_ALONG_FIRST_COORDINATE);
Axis axis = state.getValue(EncasedBeltBlock.AXIS);
if (part == Part.NONE)
return axis == Axis.X ? 90 : 0;
if (axis == Axis.Z)
return (connectedAlongFirst && part == Part.END ? 270 : 90);
boolean flip = part == Part.END && !connectedAlongFirst || part == Part.START && connectedAlongFirst;
if (axis == Axis.Y)
return (connectedAlongFirst ? 90 : 0) + (flip ? 180 : 0);
return 0;
}