Package net.blueva.arcade.api.setup
Interface SetupDataAPI<L>
- Type Parameters:
L- the location type (platform-specific)
public interface SetupDataAPI<L>
API for modules to save and load game configuration data.
This interface provides methods to persist game-specific settings to JSON configuration
files. It is accessible from SetupContext during arena setup commands.
-
Method Summary
Modifier and TypeMethodDescriptionintgetArenaInt(String path, int defaultValue) Gets an integer from arena configuration.booleangetBoolean(String path, boolean defaultValue) Gets a boolean value from game configuration.doubleGets a double value from game configuration.intGets an integer value from game configuration.getLocation(String path) Gets a location from game configuration.Gets a string value from game configuration.booleanChecks if a path exists in game configuration.voidregisterRegenerationRegion(String path, L pos1, L pos2) Save a region snapshot (bounds + blocks) to game config and register it for regeneration.voidRemoves a value from game configuration.voidsave()Saves all configuration changes to disk.voidsaveRegionBlocks(String path, L pos1, L pos2) Save the blocks within a region to a specific path.voidsetBoolean(String path, boolean value) Saves a boolean value to game configuration.voidSaves a double value to game configuration.voidSaves an integer value to game configuration.voidsetLocation(String path, L location) Saves a location to game configuration.voidsetRegionBounds(String path, L pos1, L pos2) Save region bounds (min/max) to game config.voidSaves a string value to game configuration.voidsetStringList(String path, List<String> values) Saves a list of strings to game configuration.voidsetTeamConfig(int teamCount, int teamSize) Save the team configuration for a game.
-
Method Details
-
setString
Saves a string value to game configuration.- Parameters:
path- the dot-notation path (e.g., "basic.music_time")value- the string value to save
-
setInt
Saves an integer value to game configuration.- Parameters:
path- the dot-notation pathvalue- the integer value to save
-
setDouble
Saves a double value to game configuration.- Parameters:
path- the dot-notation pathvalue- the double value to save
-
setBoolean
Saves a boolean value to game configuration.- Parameters:
path- the dot-notation pathvalue- the boolean value to save
-
setTeamConfig
void setTeamConfig(int teamCount, int teamSize) Save the team configuration for a game.- Parameters:
teamCount- number of teamsteamSize- max players per team
-
setStringList
Saves a list of strings to game configuration.- Parameters:
path- the dot-notation pathvalues- the list of strings to save
-
setLocation
Saves a location to game configuration.- Parameters:
path- the dot-notation pathlocation- the location to save
-
registerRegenerationRegion
Save a region snapshot (bounds + blocks) to game config and register it for regeneration.- Parameters:
path- Base path where the region will be stored (e.g., "game.floor")pos1- First corner of the regionpos2- Second corner of the region
-
saveRegionBlocks
Save the blocks within a region to a specific path.- Parameters:
path- Path where the block list will be stored (e.g., "game.floor.blocks")pos1- First corner of the regionpos2- Second corner of the region
-
setRegionBounds
Save region bounds (min/max) to game config.- Parameters:
path- Base path (e.g., "game.finish_line.bounds")pos1- First positionpos2- Second position
-
getString
Gets a string value from game configuration.- Parameters:
path- the dot-notation path- Returns:
- the string value, or null if not found
-
getInt
Gets an integer value from game configuration.- Parameters:
path- the dot-notation pathdefaultValue- the default value if not found- Returns:
- the integer value, or defaultValue if not found
-
getArenaInt
Gets an integer from arena configuration.- Parameters:
path- the dot-notation pathdefaultValue- the default value if not found- Returns:
- the integer value, or defaultValue if not found
-
getDouble
Gets a double value from game configuration.- Parameters:
path- the dot-notation pathdefaultValue- the default value if not found- Returns:
- the double value, or defaultValue if not found
-
getBoolean
Gets a boolean value from game configuration.- Parameters:
path- the dot-notation pathdefaultValue- the default value if not found- Returns:
- the boolean value, or defaultValue if not found
-
getLocation
Gets a location from game configuration.- Parameters:
path- the dot-notation path- Returns:
- the location, or null if not found
-
has
Checks if a path exists in game configuration.- Parameters:
path- the dot-notation path to check- Returns:
- true if the path exists, false otherwise
-
remove
Removes a value from game configuration.- Parameters:
path- the dot-notation path to remove
-
save
void save()Saves all configuration changes to disk.
-