diff --git a/resources/lang/en-US.yml b/resources/lang/en-US.yml index 2bfa0b4ce8..b7f99022a7 100644 --- a/resources/lang/en-US.yml +++ b/resources/lang/en-US.yml @@ -1,5 +1,5 @@ name: Towny -version: 0.154 +version: 0.155 language: english author: ElgarL website: 'http://townyadvanced.github.io/' @@ -1751,4 +1751,8 @@ msg_purchased_blocks_unset: 'The town %s has had their purchased townblocks remo msg_purchased_blocks_changed: 'The town %s has been given %s bought townblocks, they currently have %s bought townblocks.' #Added in 0.154 -msg_comptype_upkeep: 'Upkeep' \ No newline at end of file +msg_comptype_upkeep: 'Upkeep' + +# Added in 0.155 +# Message shown when toggling town upkeep admin setting +msg_town_upkeep_setting_set_to: 'The town %s has had their upkeep setting set to %s.' \ No newline at end of file diff --git a/src/com/palmergames/bukkit/towny/command/TownyAdminCommand.java b/src/com/palmergames/bukkit/towny/command/TownyAdminCommand.java index 033cf8fff9..ef4993b5a0 100644 --- a/src/com/palmergames/bukkit/towny/command/TownyAdminCommand.java +++ b/src/com/palmergames/bukkit/towny/command/TownyAdminCommand.java @@ -152,7 +152,7 @@ public class TownyAdminCommand extends BaseCommand implements CommandExecutor { "forcemerge" ); private static final List adminTownToggleTabCompletes = Stream.concat(TownCommand.townToggleTabCompletes.stream(), - Arrays.asList("forcepvp", "unlimitedclaims").stream()).collect(Collectors.toList()); + Arrays.asList("forcepvp", "unlimitedclaims", "upkeep").stream()).collect(Collectors.toList()); private static final List adminNationTabCompletes = Arrays.asList( "add", @@ -1333,6 +1333,11 @@ public void parseAdminTownCommand(String[] split) throws TownyException { town.setHasUnlimitedClaims(choice.orElse(!town.hasUnlimitedClaims())); town.save(); TownyMessaging.sendMsg(sender, Translatable.of("msg_town_unlimitedclaims_setting_set_to", town.getName(), town.hasUnlimitedClaims())); + } else if (split[2].equalsIgnoreCase("upkeep")) { + + town.setHasUpkeep(choice.orElse(!town.hasUpkeep())); + town.save(); + TownyMessaging.sendMsg(sender, Translatable.of("msg_town_upkeep_setting_set_to", town.getName(), town.hasUpkeep())); } else TownCommand.townToggle(sender, StringMgmt.remArgs(split, 2), true, town);