9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-31 04:36:29 +00:00

Add actionbar setting when entering region

This commit is contained in:
SamB440
2021-03-18 20:42:07 +00:00
parent fa09d7a003
commit b98f5e8b35
3 changed files with 19 additions and 1 deletions

View File

@@ -73,6 +73,7 @@ public class ConfiguredRegion {
private Regenerate regenerate;
@EditableField(material = XMaterial.NETHER_STAR, name = "Set teleport cooldown", description = "Set the cooldown for teleportation")
private int teleportCooldown;
private boolean showActionbar;
public ConfiguredRegion(@Nullable World world, String id, String customName,
List<DiscoveryReward> rewards, List<RegionEffect> effects) {
@@ -96,6 +97,7 @@ public class ConfiguredRegion {
this.discoveredLore = new ArrayList<>();
this.alwaysShowTitles = false;
this.teleportCooldown = 0;
this.showActionbar = true;
}
public ConfiguredRegion(@Nullable World world, String id, String customName,
@@ -304,6 +306,14 @@ public class ConfiguredRegion {
this.teleportCooldown = teleportCooldown;
}
public boolean showActionbar() {
return showActionbar;
}
public void setShowActionbar(boolean showActionbar) {
this.showActionbar = showActionbar;
}
public void save(IRPGRegionsAPI plugin) {
try {
File file = this.findFile(plugin);

View File

@@ -31,7 +31,8 @@ public enum Translations {
EXIT("&cExit"),
EXIT_LORE("&fExit the GUI", true),
CANNOT_ENTER("&cYou require %0 to enter this area."),
COOLDOWN("&cThat is currently on cooldown.");
COOLDOWN("&cThat is currently on cooldown."),
REGION_ENTER_ACTIONBAR("&a%0");
private final String defaultValue;
private final boolean isList;