Skip to content

Commit

Permalink
Added max level in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
byteful authored and byteful committed Aug 29, 2022
1 parent 261195e commit 275b6df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ protected void handle(LevelToolsItem tool, Player player, double modifier) {
if (tool.getXp() >= tool.getMaxXp()) {
int newLevel = tool.getLevel() + 1;

if (newLevel >= LevelToolsPlugin.getInstance().getConfig().getInt("max_level")) {
return;
}

final LevelToolsLevelIncreaseEvent levelEvent =
new LevelToolsLevelIncreaseEvent(tool, player, newLevel, false);

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ update:
# Should LevelTools check for updates periodically?
periodically: true

# The max level that tools can reach.
max_level: 500

# Configuration for messages.
messages:
no_permission: "&cYou do not have permission to execute this command!"
Expand Down

0 comments on commit 275b6df

Please sign in to comment.