RonanPlugins / BetterRTP

Official wiki of the BetterRTP plugin!
https://www.spigotmc.org/resources/36081/
MIT License
111 stars 86 forks source link

No WorldType declared warning despite type being specified. #83

Closed mibby closed 2 years ago

mibby commented 2 years ago

Plugin Version: RandomTP » Version #3.1.0-5 - compiled as of commit https://github.com/SuperRonanCraft/BetterRTP/commit/1c61ac9d6048e18afa2f04645bd79cae12397879

Describe The Bug: I have a button that runs the command rtp player <player> rw from console. On the first rtp to the world, BetterRTP complains that the WorldType is not declared, despite being declared and existing in the config.

How To Reproduce:

  1. Add a button that runs the command rtp player <player> rw from console.
  2. Hit the button in the world spawn.
  3. Get randomly teleported to the rw world.
  4. BetterRTP complains.

Expected Behavior: No warning when RTPing into the world for the first time.

Screenshots/Error Log:

[13:16:05] [Server thread/WARN]: [BetterRTP] Seems like the world `rw` does not have a `WorldType` declared. Please add/fix this in the config.yml file! This world will be treated as an overworld!

Additional Context:

In the config.yml

WorldType:
- world: NORMAL
- world_nether: NETHER
- world_the_end: NORMAL
- rw: NORMAL
SuperRonanCraft commented 2 years ago

mhh, this might be caused because this world might be loading in after the server starts up. Any plugins you are using to spawn in this custom world so I can debug the issue.

mibby commented 2 years ago

Just Multiverse-Core. rw is just a simple secondary world for resource gathering, no plugins generate that world.

SuperRonanCraft commented 2 years ago

Just Multiverse-Core. rw is just a simple secondary world for resource gathering, no plugins generate that world.

Okay, that is weird, Multiverse should be loading in the world before BetterRTP has a chance to load up. If by any chance, would you be able to see if Multiverse is loading in after BetterRTP, please let me know, should be like [Multiverse] has been enabled! and then [BetterRTP] has been enabled! or something similar. I will try to see if I can replicate this or force betterrtp to load in after in a future patch.

mibby commented 2 years ago

Nope, unfortunately it seems Multiverse loads after BetterRTP.

    Line 74: [08:00:21] [Server thread/INFO]: [BetterRTP] Loading BetterRTP v3.1.0-5
    Line 77: [08:00:21] [Server thread/INFO]: [Multiverse-Core] Loading Multiverse-Core v4.3.1-b861
    Line 369: [08:00:36] [Server thread/INFO]: [BetterRTP] Enabling BetterRTP v3.1.0-5
    Line 373: [08:00:36] [Server thread/INFO]: [Multiverse-Core] Enabling Multiverse-Core v4.3.1-b861
    Line 374: [08:00:36] [Server thread/INFO]: [Multiverse-Core] We are aware of the warning about the deprecated event. There is no alternative that allows us to do what we need to do and performance impact is negligible. It is safe to ignore.
    Line 409: [08:00:39] [Server thread/INFO]: [Multiverse-Core] World 'witp' was unloaded from Multiverse.
    Line 410: [08:00:40] [Server thread/INFO]: [Multiverse-Core] World 'witp' was unloaded from Bukkit.
    Line 411: [08:00:40] [Server thread/INFO]: [Multiverse-Core] World 'witp' was DELETED.
    Line 414: [08:00:40] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'witp' - Env: NORMAL - Type: FLAT & generator: VoidGen
    Line 675: [08:00:51] [Craft Scheduler Thread - 7 - ItemJoin/INFO]: [ItemJoin] Hooked into { Multiverse-Core, PerWorldInventory, WorldGuard, HeadDatabase, PlaceholderAPI, ProtocolLib, Citizens, Vault }
    Line 702: [08:00:52] [Server thread/INFO]: [Magic] Multiverse-Core found, will respect PVP settings
    Line 815: [08:54:13] [Server thread/WARN]: [BetterRTP] Seems like the world `rw` does not have a `WorldType` declared. Please add/fix this in the config.yml file! This world will be treated as an overworld!

Making Multiverse-Core a softdepend in the plugin.yml would probably fix the issue I presume.

SuperRonanCraft commented 2 years ago

Oh, oof, I will work on this then, might be an easy fix, just find it weird why Multiverse would load after just for you, when it works for me and many others O_O

SuperRonanCraft commented 2 years ago

Making Multiverse-Core a softdepend in the plugin.yml would probably fix the issue I presume.

That would be the easy solution, wish I saw this before I just posted the new 3.2.0 patch. I will post another update tomorrow for this.

mibby commented 2 years ago

just find it weird why Multiverse would load after just for you, when it works for me and many others O_O

Most likely because I have quite a heavy plugin environment that adjusts the initialization order of plugins due to different soft & hard dependencies.

I manually added Multiverse-Core to the plugin.yml softdepends in version 3.1.0-5 and can confirm it seems to fix the issue.

SuperRonanCraft commented 2 years ago

Okay, ima put in loadbefore, just so I dont get confused in a couple months as say "What did I add for multiverse", should still work the same ;) I will be releasing this in a couple minutes

mibby commented 2 years ago

Why loadbefore? Doesn't that make it so BetterRTP will load first? We would want Multiverse-Core to load first, then BetterRTP. Otherwise you'll run into the same issue as this ticket since BetterRTP is already loading before Multiverse for me. The only way to ensure that BRTP loads after is to make it a softdepend.

SuperRonanCraft commented 2 years ago

Why loadbefore? Doesn't that make it so BetterRTP will load first? We would want Multiverse-Core to load first, then BetterRTP. Otherwise you'll run into the same issue as this ticket since BetterRTP is already loading before Multiverse for me. The only way to ensure that BRTP loads after is to make it a softdepend.

It works the opposite way, I know it doesnt sound like it, but I looked it up, give 3.2.1-1 a try and see if it works, if not let me know once more ;)

mibby commented 2 years ago

It works the opposite way, I know it doesnt sound like it, but I looked it up

Where? Spigot wiki clearly states; https://www.spigotmc.org/wiki/plugin-yml/

loadbefore

Same with the old bukkit wiki. https://bukkit.fandom.com/wiki/Plugin_YAML

Even the Javadocs. https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/PluginDescriptionFile.html#getLoadBefore()

We want Multiverse to load before BetterRTP, not after. It would only make sense to use loadbefore if it was defined in Multiverse-Core's plugin.yml to load before BetterRTP. Since MV won't do that due to being a plugin incompatibility, BetterRTP should use softdepend to load after Multiverse. You using loadbefore is equivalent to if you added BetterRTP to Multiverse's softdepend, which is not what fixes the issue.

SuperRonanCraft commented 2 years ago

Bahh, good point, my brain is on auto-pilot and wasn't thinking... I will do this asap

SuperRonanCraft commented 2 years ago

Uploaded 3.2.1-2 ;) I'm a good programmer, I swear

mibby commented 2 years ago

All good and confirmed working as intended now, thanks.