Class MycelDump

java.lang.Object
my.celium.org.diag.MycelDump

public final class MycelDump extends Object
/mycel dump: one JSON report with versions, every loaded mod, each Mycel mod's config and the tail of logs/latest.log. It is always saved to mycel-dumps/ and, unless allowDumpUploads is off in mycel.json, uploaded to pastes.dev and opened with the viewer at VIEWER.

IP addresses, access tokens and the OS home folder are removed before anything leaves the machine. Pastes are public to anyone with the link.

  • Field Details

    • VIEWER

      public static final String VIEWER
      Viewer base; the paste key is appended.
      See Also:
    • FORMAT_VERSION

      public static final int FORMAT_VERSION
      Bumped when the JSON shape changes incompatibly; the viewer reads it.
      See Also:
  • Method Details

    • setUploadsEnabled

      public static void setUploadsEnabled(boolean enabled)
      Called by Mycel from the global config; mods should not call this.
    • uploadsEnabled

      public static boolean uploadsEnabled()
    • cooldownSeconds

      public static long cooldownSeconds()
      Seconds left before another upload is allowed, 0 when ready.
    • collect

      public static com.google.gson.JsonObject collect(net.minecraft.server.MinecraftServer server)
      Builds the report. Call on the server thread: it reads live config values.
    • redact

      public static String redact(String text)
      Removes IP addresses, tokens and the OS home folder (which names the OS user).
    • toJson

      public static String toJson(com.google.gson.JsonObject dump)
      Pretty JSON text of a report.
    • save

      public static Path save(String json) throws IOException
      Writes the report to <game dir>/mycel-dumps/dump-<time>.json and returns the path.
      Throws:
      IOException
    • upload

      public static CompletableFuture<String> upload(String json)
      Uploads to pastes.dev off the game thread. Completes with the paste key, or exceptionally with a short, player-readable message.
    • viewerUrl

      public static String viewerUrl(String key)
      Viewer link for a paste key.