Fix CustomModelData for paper#231
Merged
Maxlego08 merged 3 commits intoMaxlego08:developfrom Mar 18, 2026
Merged
Conversation
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 pull request refactors and improves the handling of the
CustomModelDataComponentacross the codebase, with a particular focus on simplifying data structures and adding better support for Paper/Folia servers. The main changes include removing the use ofOptionalfor component lists, improving data loading logic, and introducing Paper-specific implementations for custom model data components.Refactoring and simplification of
CustomModelDataComponent:Optionalfor thecolors,flags,floats, andstringsfields inCustomModelDataComponent, replacing them with non-optional lists and updating constructors and getters accordingly. This simplifies the API and usage throughout the codebase.applymethod inCustomModelDataComponentto check for non-empty lists instead of usingOptional.ifPresent, ensuring properties are only set when data is present.Component loader improvements:
SpigotCustomModelDataItemComponentLoaderto remove allOptionalusage, streamline list extraction, and add helper methods (getFloats,getBooleans,getStrings,getColors) for cleaner and more maintainable code. [1] [2]PaperCustomModelDataComponentLoaderthat extends the Spigot loader and constructs a Paper-specificCustomModelDatausing the Paper API, enabling enhanced support for Paper/Folia servers.PaperCustomModelDataComponentclass that applies the PaperCustomModelDatato item stacks.General codebase cleanup:
MenuItemStackFormMapclass, cleaning up legacy or unnecessary code.Plugin initialization logic:
PaperCustomModelDataComponentLoaderwhen running on Paper or Folia, ensuring the correct loader is used based on the server type.