mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-10-07 11:07:33 +02:00
Saves command rank settings to bentobox config.yml
https://github.com/BentoBoxWorld/BentoBox/issues/657
This commit is contained in:
parent
4e0e283ace
commit
2b2ee7e42c
@ -110,7 +110,7 @@ public class BentoBox extends JavaPlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Saving the config now.
|
// Saving the config now.
|
||||||
new Config<>(this, Settings.class).saveConfigObject(settings);
|
saveConfig();
|
||||||
|
|
||||||
// Start Database managers
|
// Start Database managers
|
||||||
playersManager = new PlayersManager(this);
|
playersManager = new PlayersManager(this);
|
||||||
@ -333,6 +333,11 @@ public class BentoBox extends JavaPlugin {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveConfig() {
|
||||||
|
if (settings != null) new Config<>(this, Settings.class).saveConfigObject(settings);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the notifier
|
* @return the notifier
|
||||||
*/
|
*/
|
||||||
|
@ -74,7 +74,7 @@ public class Settings implements DataObject {
|
|||||||
private Set<String> fakePlayers = new HashSet<>();
|
private Set<String> fakePlayers = new HashSet<>();
|
||||||
|
|
||||||
@ConfigComment("Rank required to use a command. e.g., use the invite command. Default is owner rank is required.")
|
@ConfigComment("Rank required to use a command. e.g., use the invite command. Default is owner rank is required.")
|
||||||
@ConfigEntry(path = "general.rank-command", experimental = true)
|
@ConfigEntry(path = "general.rank-command")
|
||||||
private Map<String, Integer> rankCommand = new HashMap<>();
|
private Map<String, Integer> rankCommand = new HashMap<>();
|
||||||
|
|
||||||
@ConfigEntry(path = "panel.close-on-click-outside")
|
@ConfigEntry(path = "panel.close-on-click-outside")
|
||||||
|
@ -57,6 +57,9 @@ public class CommandCycleClick implements ClickHandler {
|
|||||||
}
|
}
|
||||||
// Apply change to panel
|
// Apply change to panel
|
||||||
panel.getInventory().setItem(slot, commandRankClickListener.getPanelItem(command, user).getItem());
|
panel.getInventory().setItem(slot, commandRankClickListener.getPanelItem(command, user).getItem());
|
||||||
|
// Save config
|
||||||
|
plugin.saveConfig();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user