[SPIGOT-4925] Uppercase world names no longer supported Created: 13/May/19 Updated: 20/May/19 Resolved: 20/May/19 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Eccentric Devotion | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 1 |
Labels: | 1.14, world | ||
Environment: |
Mac OS X Windows 10 |
Attachments: |
![]() ![]() ![]() |
Version: | git-Spigot-c8d4cef-907de3f (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT) |
Plugin: | TARDIS, Multiverse-Core |
Guidelines Read: | Yes |
Description |
When trying to create / load a new world with a multi-world plugin (such as Multiverse-Core, TARDIS) the server returns an error: net.minecraft.server.v1_14_R1.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: minecraft:TARDIS_TimeVortex This happens if using the default generator or a custom generator. Code to reproduce: WorldCreator.name("Test_World").type(WorldType.NORMAL).environment(World.Environment.NORMAL).createWorld(); Bug reproduction plugin and server log attached. |
Comments |
Comment by Yannick Lamprecht [ 17/May/19 ] |
@Phoenix616 yes your right the circumstance that one server does have the same exact world name in different cases is very low. It is more of a coincident if that happens. |
Comment by Phoenix616 [ 16/May/19 ] |
I would be advocating for a solution that at least allow uppercase in world names as lots of people have probably been using them and converting tons of plugin data would be really annoying. (especially if the "fix" could be as simple as running the world name through toLowerCase when passing it to Minecraft) I also don't think disallowing worlds with special characters wouldn't be too big of an issue as the case would be but maybe a simple replacement of the special chars could be offered as an option with the warning that it might not be supported in the future? Of course one would need to check that not two worlds use the same lowercase name (which isn't even possible with Windows) but I feel like that case would come up as seldom as special characters. |
Comment by Yannick Lamprecht [ 14/May/19 ] |
In the long term I would deprecate the Bukkit#getWorld(String) call in favour of a then added Bukkit#getWorld(NamespacedKey) call. 1. For new worlds generated and load via a plugin e.g. Multiverse we then have a schema like that multiverse:farmworld multiverse:plotworld 2.1. The fallback name migration for uppercase worlds could be minecraft:tardis_timevortex01 minecraft:tardis_timevortex02 or shift to bukkit:tardis_timevortex01 bukkit:tardis_timevortex02 if it is not a minecraft world.
instead of minecraft:TARDIS_TimeVortex minecraft:Tardis_TimeVortex 2.1.1 This mapping could be saved by spigot in a world_name_mapping.yml so on call to Bukkit#getWorld(String) 2.2 Alternatively force the user to explicitly rename the world using a programmed guide or a manual guide where each step is described.
3. For custom config the plugin developer should update the plugin to support the new format. Old plugins will use the in section 2.1.1 described mechanic. |
Comment by Rincewind [ 14/May/19 ] |
I think you misunderstood me. I was suggesting to throw an exception in Bukkit#getWorld(String), so every user and developer get a quick info, why the features concerning custom worlds are possibly broken. |
Comment by md_5 [ 14/May/19 ] |
An exception is being thrown - it's listed in this ticket. I do realise that it may not be super clear to the layperson, but we're still in the development build phase and the behaviour not beitself may final. Personally I'm still in favour of the change as it's not terrible to have server owners change world names to fit with MC standards, especially preparing for the future possibility that inbuilt vanilla commands get better multiworld support (/tp etc). |
Comment by Rincewind [ 14/May/19 ] |
The scenario I imagine is, that a developer stores locations for custom worlds in a config. Just renaming the world folder (or the world in e.g. MultiVerse) doesn't solve that "bug", because the custom made plugin wouldn't be able to find the world anymore. |
Comment by md_5 [ 14/May/19 ] |
Falls apart for other things though. Eg Test! or any other non alphanumeric world |
Comment by Rincewind [ 14/May/19 ] |
Would it be a solution to invoke #toLowerCase on the input string to provide better backwards compatibility? The only issue would be, that the worlds "Test123" and "test123" couldn't be loaded at the same time. |
Comment by md_5 [ 14/May/19 ] |
The problem is that we need to assign a dimension to each world. In Vanilla the dimensions are world, world_nether, world_the_end irrespective of what level-name is. Spigot also needs to come up with a unique dimension name for all the additional worlds, and for that it uses the name you provide. |
Comment by Eccentric Devotion [ 14/May/19 ] |
Kind of think that if the level-name property in server.properties supports uppercase, then other world names probably should too |
Comment by Eccentric Devotion [ 13/May/19 ] |
Doh, should have checked the regex in the error more carefully and I would have seen it was only lowercase... Thanks for the info. |
Comment by md_5 [ 13/May/19 ] |
Upper case world names are not supported at the moment. I am unsure whether I want to reintroduce support for them as Vanilla does not allow many things to be named uppercase now. |