Skip to content

Support for multiple worlds#1

Open
Kryolisc wants to merge 1 commit into
EdouardCourty:masterfrom
Kryolisc:master
Open

Support for multiple worlds#1
Kryolisc wants to merge 1 commit into
EdouardCourty:masterfrom
Kryolisc:master

Conversation

@Kryolisc

@Kryolisc Kryolisc commented Nov 1, 2022

Copy link
Copy Markdown

I've implemented support for multiple worlds as I needed that for a server I maintain. Maybe this would be interesting for somebody else.

This PR restructures the config a bit, so worlds can be added to a list, allowing for per-world config:

worlds:
  world:
    # ...
    update_rate: 80
    # ...
    force_daylightcycle_false: true
worlds:
  <worldName1>:
    ...
  <worldName2>:
    ...

Another thing I had to change is the UpdateTimeHandler. It can now be used as a regular object, so multiple instances can be created and run.
Because other worlds besides the "world" are being loaded at some point later in the startup process, the UpdateTimeHandler instances will not be started at plugin load, but instead when the server is done loading. This should ensure that all worlds are loaded and can be found by the plugin.
This version works fine on the before mentioned server (Paper 1.19), but I wasn't able to do extensive testing for other versions.

That said, I also updated the Paper dependency for 1.19 and added the api-version property to plugins.yml, but that should hardly even matter, as the plugin doesn't really use version-specific APIs.

@EdouardCourty

Copy link
Copy Markdown
Owner

Hi, sorry for not replying earlier, this project was kind of on hold.

I've changed a few things, as well as I've added support for timezone.

If you'd be okay with rebasing your PR, I'd be happy to implement your changes after review!

Thanks a lot for contributing <3

@EdouardCourty

Copy link
Copy Markdown
Owner

I'll try to rebase it myself, it doesn't seem too crazy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants