[SPIGOT-3304] Weather command duration not working Created: 09/Jun/17  Updated: 09/Jun/17  Resolved: 09/Jun/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: SpiderRobotMan Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Craftbukkit, bug
Environment:

CraftBukkit


Attachments: Text File CommandWeather.patch    
Plugin: N/A

 Description   

Steps to reproduce:

  1. Enter the server
  2. Clear the weather with "/weather clear"
  3. Run the command "/weather rain 10"

Expected result:

  • Rain lasts for only the time you enter

Actual result:

  • Rain lasts until cleared

This was tested on both Vanilla 1.12 and CraftBukkit 1.12, it was only reproducible on CraftBukkit, I did not test on Spigot.

 

This is due to the duration being set before it is set to rain or thunder, I have attached a patch for the CommandWeather class that resolves this bug.



 Comments   
Comment by SpiderRobotMan [ 09/Jun/17 ]

I beleive the fix lies in the WorldData class at line 455 and 483, the methods set the duration to 0, so the vanilla command has its duration values overridden.

Comment by SpiderRobotMan [ 09/Jun/17 ]

@md_5 I figured that may be the case, this fixed what I had needed it to for now but I figured I'd open a bug report so that someone with more experience could find a proper solution.

Comment by md_5 [ 09/Jun/17 ]

That's likely not a proper fix. The fix probably should be outside the command methods and fix the behaviour of the other methods to match vanilla instead.

Generated at Tue Apr 22 07:03:26 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.