Added a "reset all the settings" button to the player Settings Panel

Implements https://github.com/BentoBoxWorld/BentoBox/issues/1011
This commit is contained in:
Florian CUNY 2019-10-28 17:42:43 +01:00
parent 5ef74bd0f4
commit 6607060b99
2 changed files with 16 additions and 0 deletions

View File

@ -162,6 +162,17 @@ public class SettingsTab implements Tab, ClickHandler {
.clickHandler(this)
.build());
}
// Add the reset everything to default - it's only in the player's settings panel
if (island != null) {
icons.put(8, new PanelItemBuilder().icon(Material.TNT)
.name(user.getTranslation(PROTECTION_PANEL + "reset-to-default.name"))
.description(user.getTranslation(PROTECTION_PANEL + "reset-to-default.description"))
.clickHandler((panel, user1, clickType, slot) -> {
island.setFlagsDefaults();
return true;
})
.build());
}
return icons;
}

View File

@ -1139,6 +1139,11 @@ protection:
name: "&cExpert Settings"
description: "&aDisplays all the available settings."
click-to-switch: "&eClick &ato switch to the &r[next]&r&a."
reset-to-default:
name: "&cReset to default"
description: |+
&aResets &c&lALL &r&athe settings to their
&adefault value.
PROTECTION:
title: "&6Protection"
description: |-