package ch.deletescape.jterm.commandcontexts;

import ch.deletescape.jterm.CommandUtils;
import ch.deletescape.jterm.io.Printer;

public class Random extends CommandContext {
  private long seedUniquifier = 8682522807148012L;

  @Override
  protected void init() {
    CommandUtils.addListener("random", o -> random());
  }

  private long random() {
    long x = System.currentTimeMillis() * ++seedUniquifier;
    x ^= (x << 21);
    x ^= (x >>> 35);
    x ^= (x << 4);
    Printer.out.println(Math.abs(x));
    return Math.abs(x);
  }
}

package ch.deletescape.jterm.commandcontexts;

import ch.deletescape.jterm.CommandUtils;

public class Random extends CommandContext {
  private java.util.Random rand;

  @Override
  protected void init() {
    CommandUtils.addListener("random", o -> random());
  }

  private long random() {
    if (rand == null) {
      rand = new java.util.Random();
    }
    return rand.nextLong();
  }
}

Replace our own Random implementation with java.util.Random