EssentialsX

EssentialsX

2M Downloads

unable to set weather

smmmadden opened this issue ยท 8 comments

commented

BungeeCord / Spigot 1.12.1 Servers
Essentials Plugins (all except XMPP) build 527

I've been using /weather clear 1000000 for ages and it's been working, but the last few updates of EssX, sometimes the weather changes from rain to sun and others it doesn't.
image
I've also tried /sun and /weather sun and /weather sun 1000000 and none are turning off rain and there are no messages in the console/logs.

Config.yml - Option to disable weather storm, thunder and lightning are all set to false and permission is still present.
image

Thanks -Steve

commented

I managed to turn it off by /weather storm followed by /weather sun
Typing in /weather thunder shows that I set the weather to sun instead of thunder. Seems like the code is confused.

commented

None of my other plugins on my servers control weather (at least not documented they do). I've always relied on EssentialsX for that. The only place I have permissions and commands enabled is for essentials. Also thunder has been supported in-game for as long as I've been playing (back to 1.8). :-) Here are the official options that I've always used. https://minecraft.gamepedia.com/Weather

Does appear to be a conflict in some plugin as using /essentials:weather storm or /essentials:weather sun work fine. Will continue investigating elsewhere. :-) Thanks!

commented

Let me clarify what I said: EssentialsX will respond to /weather storm by telling Bukkit to start rain in that world. Passing anything else at all as the first parameter (/weather sun, /weather thunder, /weather lightning) will tell Bukkit to stop rain in that world. By extension, thunder is not supported, regardless of what types of weather exist outside of the behaviour of EssentialsX's /weather command.

The only bug that I can see here is down to how Spigot handles weather, but as you noted you can start and stop rain with /weather to work around this. If you'd like to request support for toggling thunder, please create a separate feature request.

commented

thunder isn't a valid weather option - storm will start a storm and any other first argument will stop it. This looks like an inconsistency in the Bukkit API rather than any particular issue with EssentialsX, though you may want to check that you don't have any other plugins that alter the weather behaviour.

commented

I used PlugMan to find out which plugin has this command registered. The only one that gets reported is Essentials. This is only the command being registered, so I still need to check with the 50 other plugins I use to be 100% sure. :-)
image
To confirm what you mentioned for /weather by itself, it displays the help with the choices I can use; /weather <storm/sun> [duration]

So the user has to select one or the other. What was odd is that there is no validation to require storm or sun. I tried /weather sdkdf823kjs and it returned with You set the weather to sun in world. Not a big deal, but would at least make users type only what is allowed.
Should I submit an enhancement to add validation on the parameter choices?

commented

What was odd is that there is no validation to require storm or sun.

As stated above:

EssentialsX will respond to /weather storm ... Passing anything else at all as the first parameter ... will tell Bukkit to stop rain in that world.

The validation isn't a problem, as the command already outputs what the weather was set to when run. In addition, adding validation could break servers that may expect /weather clear or similar to be a valid command. In addition, the <storm/sun> in the usage message aren't incorrect - <...> suggests that an argument is required, and storm and sun are both acceptable options for the first argument.

If, for some reason, you absolutely insist on avoiding ambiguity, you can use /sun and /storm instead. Otherwise, I can't see any compelling reason for adding potentially-breaking validation to the command.

commented

I agree - thanks for the explanation and impact. Definitely don't want to break existing implementations. Go ahead and close this while I'm investigating where the override is coming from, since it is clearly not EssX.

commented

There is almost certainly nothing overriding this - it's more likely Spigot isn't tracking the server's weather properly.