Repository navigation
Improve translation of commands - #6833
Open
eclipseisoffline wants to merge 9 commits into
Open
eclipseisoffline wants to merge 9 commits into
eclipseisoffline wants to merge 9 commits into
Conversation
…rom our Java registry cache
…_SOURCE, ENTITY_ANCHOR, INT_RANGE/FLOAT_RANGE, GAMEMODE, RESOURCE_OR_TAG_KEY, RESOURCE_KEY, TEMPLATE_MIRROR/TEMPLATE_ROTATION, HEIGHTMAP, DIALOG, SWING_ANIMATION argument types
* Fix: Use soft enums for mixed-case command literals * Intern soft enum names by exact value set * Fix Javadoc --------- Co-authored-by: Eclipse <eclipse@eclipseisoffline.xyz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to improve the translation of server commands drastically.
For one, the PR changes the
JavaCommandsTranslatorto try to fetch theRESOURCEandRESOURCE_OR_TAGargument types from our registry cache system. This allows these argument types to work with more registries (specifically, all registries Geyser tracks, listed inJavaRegistries. To work with all vanilla registries, Geyser would have to track them all).This also allows the removal of a lot of boilerplate code regarding enchantment, entity type, item, and biome name suggestions. This includes the
WorldManager#getBiomeIdentifiers(boolean)method, which was only implemented by the Spigot-native world manager. This also allows the removal of thegetBiomeSuggestions(boolean)method from our world adapters (see GeyserMC/geyser-adapters#11).On top of this, the PR also adds support for the following argument types:
SCORE_HOLDER,COMPONENT,PARTICLE,ITEM_SLOT,ITEM_SLOTS,SLOT_SOURCE,ENTITY_ANCHOR,INT_RANGE,FLOAT_RANGE,GAMEMODE,RESOURCE_OR_TAG_KEY,RESOURCE_KEY,TEMPLATE_MIRROR,TEMPLATE_ROTATION,HEIGHTMAP,DIALOG, and,SWING_ANIMATION.This allows these argument types to have better suggestions shown to players.
TO-DO for further improvements:
Supersedes #6826.