Arena is saved into a YAML file by default.
Every arena system functions are provided by the library.
You can create your arena loader, the default loader loads data from YAML file.
The arena system uses Bukkit serialization to store data.
Arena:
The arena has a lobby location, name as arena ID, and a Map of locations.
How to create a new instance of Arena?
The first parameter is an arena's name.
The second parameter is the lobby location.
The third parameter is a map of locations.
Code (Java):
ArenaFactory arenaFactory
= MiniGame.
getArenaFactory
(
)
Arena arena
= arenaFactory.
createArena
(
"arenaName", player.
getLocation
(
),
new HashMap
<>
(
)
)
;
//or
Arena arena
= arenaFactory.
createArena
(
"arenaName", player.
getLocation
(
)
)
;
How to manage arena locations?
Code (Java):
void addLocation
(name, location
)
;
//Adds new location
Map
<
String, Location
> getLocations
(
)
;
//Gets map of locations
void removeLocation
(name
)
;
//Removes location from map
Location getLocationByName
(name
)
//Gets location by name
Optional
<Location
> getLocation
(name
)
;
//Gets location by name