Search in sources :

Example 1 with RelativeDirection

use of com.lowdragmc.multiblocked.api.pattern.util.RelativeDirection in project Multiblocked by Low-Drag-MC.

the class JsonBlockPatternWidget method onDirChange.

private void onDirChange(int index, String candidate) {
    RelativeDirection dir = RelativeDirection.valueOf(candidate);
    RelativeDirection[] newDirs = new RelativeDirection[3];
    newDirs[index] = dir;
    for (int i = 0; i < pattern.structureDir.length; i++) {
        if (pattern.structureDir[i].isSameAxis(dir) && i != index) {
            newDirs[i] = pattern.structureDir[index];
        } else if (i != index) {
            newDirs[i] = pattern.structureDir[i];
        }
        selectors[i].setValue(newDirs[i].name());
    }
    pattern.changeDir(newDirs[0], newDirs[1], newDirs[2]);
    sceneWidget.reloadBlocks();
}
Also used : RelativeDirection(com.lowdragmc.multiblocked.api.pattern.util.RelativeDirection)

Aggregations

RelativeDirection (com.lowdragmc.multiblocked.api.pattern.util.RelativeDirection)1