package net.mcreator.puzzle_code.procedures;

import net.minecraft.core.Direction;

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