Search in sources :

Example 1 with BlockSide

use of mcjty.rftoolscontrol.api.parameters.BlockSide in project RFToolsControl by McJty.

the class SideEditor method writeConstantValue.

@Override
protected void writeConstantValue(ParameterValue value) {
    if (value == null || value.getValue() == null) {
        nameLabel.setText("");
        label.setChoice("*");
    } else {
        BlockSide side = (BlockSide) value.getValue();
        nameLabel.setText(side.getNodeName() == null ? "" : side.getNodeName());
        String choice = StringUtils.capitalize(side.toString());
        label.setChoice(choice);
    }
}
Also used : BlockSide(mcjty.rftoolscontrol.api.parameters.BlockSide)

Example 2 with BlockSide

use of mcjty.rftoolscontrol.api.parameters.BlockSide in project RFToolsControl by McJty.

the class InventoryTools method blockSideFromString.

@Nullable
public static BlockSide blockSideFromString(String s) {
    if (s == null) {
        return null;
    }
    if (s.isEmpty()) {
        return null;
    }
    EnumFacing side = getSideFromChar(s.charAt(s.length() - 1));
    int indexOf = s.lastIndexOf(' ');
    if (indexOf <= 0) {
        return new BlockSide(null, side);
    }
    return new BlockSide(s.substring(0, indexOf), side);
}
Also used : BlockSide(mcjty.rftoolscontrol.api.parameters.BlockSide) EnumFacing(net.minecraft.util.EnumFacing) Nullable(javax.annotation.Nullable)

Aggregations

BlockSide (mcjty.rftoolscontrol.api.parameters.BlockSide)2 Nullable (javax.annotation.Nullable)1 EnumFacing (net.minecraft.util.EnumFacing)1