Search in sources :

Example 1 with Part

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;
}
Also used : Part(com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part) Axis(net.minecraft.core.Direction.Axis)

Example 2 with Part

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;
}
Also used : Part(com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part) Axis(net.minecraft.core.Direction.Axis)

Example 3 with Part

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;
}
Also used : Part(com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part) Axis(net.minecraft.core.Direction.Axis)

Aggregations

Part (com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock.Part)3 Axis (net.minecraft.core.Direction.Axis)3