Class RunRecordsService

java.lang.Object
dev.deepcore.records.RunRecordsService

public class RunRecordsService extends Object
Manages global speedrun record persistence using SQLite. Tracks team speedrun completion times with section breakdowns.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RunRecordsService(org.bukkit.plugin.java.JavaPlugin plugin)
    Creates a records service bound to this plugin's data folder and logger.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets all recorded runs.
    long
    Gets the best overall time across all recorded runs.
    long
    Gets the best time for a specific section across all runs.
    void
    Initializes the database connection and creates tables if they don't exist.
    recordRun(long overallTimeMs, long overworldToNetherMs, long netherToBlazeRodsMs, long blazeRodsToEndMs, long netherToEndMs, long endToDragonMs, List<String> participants)
    Records a completed team speedrun with section timings.
    void
    Closes the database connection.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RunRecordsService

      public RunRecordsService(org.bukkit.plugin.java.JavaPlugin plugin)
      Creates a records service bound to this plugin's data folder and logger.
      Parameters:
      plugin - plugin providing data folder and logger context
  • Method Details

    • initialize

      public void initialize()
      Initializes the database connection and creates tables if they don't exist.
    • recordRun

      public RunRecord recordRun(long overallTimeMs, long overworldToNetherMs, long netherToBlazeRodsMs, long blazeRodsToEndMs, long netherToEndMs, long endToDragonMs, List<String> participants)
      Records a completed team speedrun with section timings.
      Parameters:
      overallTimeMs - total elapsed time in milliseconds
      overworldToNetherMs - time from start to reaching Nether
      netherToBlazeRodsMs - time from Nether entry to blaze objective completion
      blazeRodsToEndMs - time from blaze objective completion to End entry
      netherToEndMs - time from Nether to End
      endToDragonMs - time from End to dragon defeat
      participants - participant names included in the run
      Returns:
      the created RunRecord
    • getBestOverallTime

      public long getBestOverallTime()
      Gets the best overall time across all recorded runs.
      Returns:
      the best overall time in milliseconds, or -1 if no records exist
    • getBestSectionTime

      public long getBestSectionTime(String section)
      Gets the best time for a specific section across all runs.
      Parameters:
      section - the section name: "overworld_to_nether", "nether_to_end", or "end_to_dragon"
      Returns:
      the best section time in milliseconds, or -1 if no records exist
    • getAllRecords

      public List<RunRecord> getAllRecords()
      Gets all recorded runs.
      Returns:
      a list of all RunRecords
    • shutdown

      public void shutdown()
      Closes the database connection.