Changing ValidatedIdentifier namespaces
MincraftEinstein opened this issue ยท 5 comments
This is more of a suggestion than a bug.
When trying to use a different namespace in a ValidatedIdentifier, I (and I think most people) would delete the existing value including the namespace, and start typing the new namespace and value. The issue is that when typing, the default Minecraft namespace gets inserted in front of all existing text. This is a helpful feature if the value always needs to be prepended with the default namespace, but if you want to change the namespace this gets kind of annoying because the only way I have found to be able to change it is by typing out the new namespace and value, and then deleting the prepended minecraft:
I'm not entirely sure the circumstances you are referring to. I can delete an identifier and type one in with a new namespace no problem, as shown in the example video
2024-10-25.08-07-52.mp4
It must be only when using an unvalidated ValidatedIdenifier I guess. Probably should have done this in the first place rather than trying to explain it.
2024-10-25.11-39-12.mp4
public ValidatedIdentifier testConfig = new ValidatedIdentifier(ResourceLocation.withDefaultNamespace("test_value"));
The reason I'm not validating the configs/giving them suggestions is that I am using it for a biome config and you can't have biome registry access without world access so there's no way to validate the config on the title screen
I see.. interesting behavior, I will look into it.
Regarding this specific use case, I believe that the screen should already be restricting out-of-game access to that setting, unless it is specifically @NonSync
or @ClientModifiable
in your case. Sorry user nonsync if github notified you about this, accident
(looking at the video again, it probably is Nonsync, seeing as the settings appear to be client-relevant)
If it is being restricted, using the Biome registry key in the ofRegistryKey method is likely a good option since it can only be modified in-game already. If it isn't being restricted (and it's not Nonsync/Clientmodifiable), that is a bug and I'd like to know about it.
I'm using it as a client side only config so there isn't any syncing and or disabling outside of worlds, its just a validated identifier, nothing special.