Skip to content

Lobby library that allows for a level inventory with 'consumable levels', reward descriptions are set in a configuration and rewards can be consumed by a single other plugin.

Notifications You must be signed in to change notification settings

Exorath/GameLevelLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GameLevelLib

Lobby plugin that allows for a level inventory with 'consumable levels'

reward descriptions are set in a configuration and rewards can be consumed by a single other plugin.

Configuration

//Setup LevelsConfig with an example reward
LevelsConfig config = new LevelsConfig("CakeWars", "mg.cw");
config.addRewardHandler(new LevelHandler() {
  @Override
  public List<String> getRewards() {
    return Arrays.asList(new String[]{"Reward 1", "Reward 2"})
  }
       
  @Override
  public void handleReward(Player player) {
       //grant rewards
  }
       
  @Override
  public int getItemType() {
    return 0;//0 is default, 1 is special level item (fe. level 10), it will be displayed prettier
  }
});

//Register library
GameLevelLib lib = new GameLevelLib(gameLevelServiceAPI, plugin, levelsConfig, levelSlot);
Bukkit.getPluginManager().registerEvents(lib, plugin)

//Force open inventory
lib.openInventory(player);

About

Lobby library that allows for a level inventory with 'consumable levels', reward descriptions are set in a configuration and rewards can be consumed by a single other plugin.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages