package net.mcreator.puzzle_code.procedures;

import net.minecraft.core.Direction;

public class GetXOffsetSystemProcedure {
	public static double execute(double x, Direction Direction, String Offset) {
		if (Direction == null || Offset == null)
			return 0;
		if ((Offset).equals("Back")) {
			return x + (Direction.getOpposite()).getStepX();
		} else if ((Offset).equals("Front")) {
			return x + Direction.getStepX();
		} else if ((Offset).equals("Left")) {
			return x + RotatedDirectionSystemProcedure.execute(Direction, "y", "Counterclockwise").getStepX();
		} else if ((Offset).equals("Right")) {
			return x + RotatedDirectionSystemProcedure.execute(Direction, "y", "Clockwise").getStepX();
		} else if ((Offset).equals("Top")) {
			return x + RotatedDirectionSystemProcedure.execute(Direction, "z", "Counterclockwise").getStepX();
		} else if ((Offset).equals("Bottom")) {
			return x + RotatedDirectionSystemProcedure.execute(Direction, "z", "Clockwise").getStepX();
		}
		return x + Direction.getStepX();
	}
}
