package net.mcreator.puzzle_code.procedures;

import net.minecraft.core.Direction;

public class RotatedDirectionSystemProcedure {
	public static Direction execute(Direction Direction, String Around, String Rotate) {
		if (Direction == null || Around == null || Rotate == null)
			return Direction.NORTH;
		if ((Around).equals("x")) {
			if ((Rotate).equals("Clockwise")) {
				if (Direction == Direction.DOWN) {
					return Direction.NORTH;
				} else if (Direction == Direction.UP) {
					return Direction.SOUTH;
				} else if (Direction == Direction.NORTH) {
					return Direction.DOWN;
				} else if (Direction == Direction.SOUTH) {
					return Direction.UP;
				}
			} else if ((Rotate).equals("Counterclockwise")) {
				if (Direction == Direction.DOWN) {
					return Direction.SOUTH;
				} else if (Direction == Direction.UP) {
					return Direction.NORTH;
				} else if (Direction == Direction.NORTH) {
					return Direction.UP;
				} else if (Direction == Direction.SOUTH) {
					return Direction.DOWN;
				}
			}
		} else if ((Around).equals("y")) {
			if ((Rotate).equals("Clockwise")) {
				if (Direction == Direction.NORTH) {
					return Direction.EAST;
				} else if (Direction == Direction.SOUTH) {
					return Direction.WEST;
				} else if (Direction == Direction.WEST) {
					return Direction.NORTH;
				} else if (Direction == Direction.EAST) {
					return Direction.SOUTH;
				}
			} else if ((Rotate).equals("Counterclockwise")) {
				if (Direction == Direction.NORTH) {
					return Direction.WEST;
				} else if (Direction == Direction.SOUTH) {
					return Direction.EAST;
				} else if (Direction == Direction.WEST) {
					return Direction.SOUTH;
				} else if (Direction == Direction.EAST) {
					return Direction.NORTH;
				}
			}
		} else if ((Around).equals("z")) {
			if ((Rotate).equals("Clockwise")) {
				if (Direction == Direction.DOWN) {
					return Direction.EAST;
				} else if (Direction == Direction.UP) {
					return Direction.WEST;
				} else if (Direction == Direction.WEST) {
					return Direction.UP;
				} else if (Direction == Direction.EAST) {
					return Direction.DOWN;
				}
			} else if ((Rotate).equals("Counterclockwise")) {
				if (Direction == Direction.DOWN) {
					return Direction.WEST;
				} else if (Direction == Direction.UP) {
					return Direction.EAST;
				} else if (Direction == Direction.WEST) {
					return Direction.DOWN;
				} else if (Direction == Direction.EAST) {
					return Direction.UP;
				}
			}
		}
		return Direction;
	}
}
