🟢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.

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.

void addLocation(name, location); //Addes 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

Arena options (The arena stores options in YAML).

Thanks to arena options you can store some custom values.

Options options = arena.options();
//or
Options options = arena.getOptionsOrCreate();

options.setValue("key", "value"); //sets the value
Object value = options.getValue("key"); //gets the value
Object value = options.getValueOrDefault("key", "default"); //gets the value, or default value