Package dev.deepcore.records
Class RunRecordsService
java.lang.Object
dev.deepcore.records.RunRecordsService
Manages global speedrun record persistence using SQLite.
Tracks team speedrun completion times with section breakdowns.
-
Constructor Summary
ConstructorsConstructorDescriptionRunRecordsService(org.bukkit.plugin.java.JavaPlugin plugin) Creates a records service bound to this plugin's data folder and logger. -
Method Summary
Modifier and TypeMethodDescriptionGets all recorded runs.longGets the best overall time across all recorded runs.longgetBestSectionTime(String section) Gets the best time for a specific section across all runs.voidInitializes 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.voidshutdown()Closes the database connection.
-
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 millisecondsoverworldToNetherMs- time from start to reaching NethernetherToBlazeRodsMs- time from Nether entry to blaze objective completionblazeRodsToEndMs- time from blaze objective completion to End entrynetherToEndMs- time from Nether to EndendToDragonMs- time from End to dragon defeatparticipants- 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
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
Gets all recorded runs.- Returns:
- a list of all RunRecords
-
shutdown
public void shutdown()Closes the database connection.
-