package xyz.wbsite.jmacro; import java.awt.*; public class JRoot extends Robot { private static final int MAX_DELAY = 60000; public JRoot() throws AWTException { } public JRoot(GraphicsDevice screen) throws AWTException { super(screen); } @Override public synchronized void delay(int ms) { checkDelayArgument(ms); try { Thread.sleep(ms); } catch (InterruptedException e) { throw new RuntimeException(e); } } private void checkDelayArgument(int ms) { if (ms < 0 || ms > MAX_DELAY) { throw new IllegalArgumentException("Delay must be to 0 to 60,000ms"); } } }