-
-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new permission flag to toggle snowfall, like you would for firespread #7690
base: master
Are you sure you want to change the base?
Conversation
some things i know need to be looked at:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can undo the changes to this class, there's no more room available in the perm hud scoreboard, its already at 15 lines.
@@ -2240,6 +2253,7 @@ public enum ConfigNodes { | |||
"default_perm_flags.town.default.explosion", | |||
"false"), | |||
FLAGS_TOWN_DEF_MOBS("default_perm_flags.town.default.mobs", "false"), | |||
FLAGS_TOWN_DEF_SNOW("default_perm_flags.town.default.snow", "true"), // TODO: fruit add node to config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO ready to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class needs more help lines, the ones I've spotted are
TA_TOWN_TOGGLE,
TOWN_TOGGLE_HELP,
PLOT_GROUP_TOGGLE,
PLOT_TOGGLE
case "snow": | ||
checkPermOrThrow(player, PermissionNodes.TOWNY_COMMAND_PLOT_TOGGLE_SNOW.getNode()); | ||
tryToggleTownBlockSnow(player, townBlock, split, choice); | ||
TownyMessaging.sendMsg(player, Translatable.of("msg_changed_snow", "the Plot", townBlock.getPermissions().snow ? Translatable.of("enabled") : Translatable.of("disabled"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does need a break;
added to the end of it, I think you'd mentioned this.
@@ -2039,6 +2064,9 @@ public void plotGroupToggle(Player player, Resident resident, PlotGroup plotGrou | |||
tryToggleTownBlockMobs(player, groupBlock, split, choice); | |||
endingMessage = Translatable.of("msg_changed_mobs", Translatable.of("msg_the_plot_group"), groupBlock.getPermissions().mobs ? Translatable.of("enabled") : Translatable.of("disabled")); | |||
break; | |||
case "snow": | |||
tryToggleTownBlockSnow(player, groupBlock, split, choice); | |||
endingMessage = Translatable.of("msg_changed_snow", Translatable.of("msg_the_plot_group"), groupBlock.getPermissions().snow ? Translatable.of("enabled") : Translatable.of("disabled")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another missed break;
// Set the toggle setting. | ||
town.setSnow(preEvent.getFutureState()); | ||
|
||
// TODO: add these messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO complete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding anything to the SQLSource also requires an addition to the SQLSchema class, so the columns will be created.
@@ -617,6 +619,7 @@ msg_changed_public: '&cThe Town''s public status is now %s.' | |||
msg_changed_expl: '&cExplosions in %s are now %s.' | |||
msg_changed_fire: '&cFirespread in %s is now %s.' | |||
msg_changed_mobs: '&cMonster spawns in %s are now %s.' | |||
msg_changed_snow: '&cSnowfall in %s is now %s' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a period on the end of this string.
msg_perm_hud_snowfall: 'Snowfall: ' | ||
#Seen in /plot perm hud: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
Description:
I made this pull request as in my experience many people dread making towns in snow due to the constant covering of your builds in snow. It takes a lot of time and maintenance to keep your town clean, I've seen some go to the extreme of placing thousands of iron bars at the highest Y level to prevent snowfall. I think it is fair to add the ability to toggle this for players, if lag is a concern server admins can force snowfall on or otherwise remove access to turning it off.
New Nodes/Commands/ConfigOptions:
New config nodes:
new_world_settings.snow.world_snowfall_enabled
new_world_settings.snow.force_snow_on
New commands and their permissions:
/town toggle snow
towny.command.town.toggle.snow
/plot toggle snow
towny.command.plot.toggle.snow
/res toggle snow
towny.command.resident.toggle.snow
/tw toggle snow
towny.command.townyworld.toggle.snow
/tw toggle forcesnow
towny.command.townyworld.toggle.forcesnow
Relevant Towny Issue ticket:
N/A
By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.