forked from MCreator/MCreator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for custom item properties (MCreator#2000)
* Added new UI components (initial) * Added new fields to item GUI (still WIP) * Added state editor and merged properties and models lists * Updated some item templates * Added all needed templates * Some fixes to new list panel * Procedure block and more improvements * Added access to built-in properties, updated help tips and fixed templates * Added new dialog test and improved item model class * Another procedure block fix * More improvements * 1.16 fix * Proper renaming and more template fixes * Fixed tests * A couple more stability improvements * Added help context to entries and fixed properties renaming yet again Also added some indentations to improve code quality * Migrated to string type model keys * Fixed reference * Added help context to the dialog and improved error windows * Some more fixes * Changed validator text * Removed unnecessary check * Simplified another one * Reordered state entry methods * French tips, workspace JSON adapter and more * Added 1.18.x templates + cleanup * Minor fixes * Improved states editing * 1.18.x procedure block * Stability improvements * Renamed property index fix * Further fixes * Validation changes * Fixes again * New GUI components are now fully opaque * Some updates * Resolving conflict * Resolving conflict * Resolving conflict * Added tests and improved entity checks * Fixed tests * Fix tests (pt. 2) * Wrong reference * Reverted indentations in 1.18.2 item registry * Reverted code reformat in ProcedureSelector * Updated to use recently added validator instead of its origin * Removed 1.16.5 support (will not build) * Fix tests? * Fixed tests * Some refactoring - Migrated new components from state strings to state maps - Removed string tokens from state editor - Changed layout of new UI components to allow renaming properties in a proper way and to make state texts more human-readable * Fixed tests * Fixes a bunch of bugs * Further restructuring * Minor changes and fixes * Just to re-run tests * Marked buttons on new entry components as technical * Minor fix * Adapted to the recent changes to list templates system * Cut down the number of files changed * Slight improvement * Once more * Removed procedure block, moved built-in properties to a data list * Added docs to procedure selector constructors * Minor changes to the layout * Removed unused variable to re-run tests * Reverted some layout changes * Refactored property data class * Some optimizations * Improved properties validation * Some more things that could seem suboptimal * Extra refactoring, minor improvements * Improved validation and properties data list * Improved the new data list usage * Fixed tests * Added forgotten warning to property data renaming method * Put the new validator into use in place of a hardcoded one * Future proofing * 1.19.4 support * 1.19.4 data list * Unsupported properties handling * 1.19.4 templates * More validation, updated help tips * Fixed an awful issue with tests * UI optimizations, minor "backport" * New HelpUtils method was in fact redundant * UI strings/tips again * More redundant things * More correct keys * Removed Minecraft 1.18.x support * Removed Minecraft 1.18.x support 2 * Removed Minecraft 1.18.x support 3 * Removed Minecraft 1.18.x support 4 * Minor change * Notes * External properties can not be renamed anymore * More layout changes * Fixed tests * Proper filtering + clearer code * No bounds for "logic" properties * Made UI more MCreator-ish (imatate other UI parts) + scroll panels need ticks defined + JPropertyNameFiled does not need to be JPanel * Was that blindness or dumbness? * Some more UI changes * Removed button that could be confused for some sort of entry duplication * Thinned state entries and removed collapsible panel so we can use grid layout * These are no more relevant * Clearer implementation of multitude of things * Slightly simplified dialog test * Import remove * Shorter stats name * Follow the way livingentitygui handles models * Some minor renames * Technical buttons invasion * Proper decimal precision * Namespaces * Redundant extra key * Number match types * Namespaces 2 * Text * New method, float to double, proper double infinity * Few renames * Integer -> Int * Proper mappings * BTS changes * Tests fix * Another rename * Tests fix 2, minor changes * Filtering * Help tips * Whole MCreator uses true/false not True/False * Seems I will have to rename things myself + tests that also test cases with default and non-default values * Templates fix * Handy but obsolete * Some renames * Non-optimal naming, but follows the way we call it in Item * Did not refactor too much I hope * Default property name could create duplicate names in some cases so the system was removed as no one would or should name properties with same name but number applies anyways * List templates entry is called now data, not item, so existing templates can be reused in list templates without too much hackerty and FTL expression overload * Store states in Item as flat list of state definitions instead * Slight javadoc * GSON does not play well with annonymous classes, use logic data for logic and then in template, we can handle this in templates (replace true/false with 0.0 and 1.0) * Fix serilization * Example of how I envisioned the templates + minor change to Item.java so workspace does not need to be passed and same method can be used * Another fix of template demo, but mappings indeed don't work * CUSTOM: prefix everywhere expect UI, better doubles and test * Serializer update, better border title * Templates * Wrong folders * Seal IPropertyData from any insane things + serializer fix * Slight change to deinifiton yaml * Key and property should be in same line if possible for readability * Match type for external properties * Match type for state editor * 5 extra symbols to fix tests * Serialize property parameters too * Fix OBJ models crashing in FTL in all cases * Simplified FTL conditions * Simpltified items code (also not passing entity from itemstack as this could cause unexpected behaviour + entity can be null and procedure could still run so removed this check) * No initial name to indicate it requires definition * Properties validation before editing state * Missing documentation * Property ID prefixes * Prefixes in item models * Minor indent. fix * A bit nicer generated code * Tests with CUSTOM: prefix * Replaced FTL code with method that may come in handy later in the future (or not, but makes FTL bit shorter) * Slight refactor * Found fix for JSpinner * Avoid static initializer * Small refactor * Tiny refactor * Removing elements from list while forEach can cause CME * Fix properties renaming (another time? :D) * Sorry, but this IS used * Seems we'll have to recreate maps to not reference wrong properties * More null checks * Help tips * Revert "Seems we'll have to recreate maps to not reference wrong properties" This reverts commit 26e26f7. * Property data UUID * Fill map with own properties as they are not compared by UUID * One more tip * Sleep tight, thanks for help * These two are obsolete too * Properties could have duplicate names * Formatting, final attribute * Not so careful * Slight UI change * Procedure template to imitate vanilla logic properties * Procedure change listener --------- Co-authored-by: Klemen <16374228+KlemenDEV@users.noreply.github.com>
- Loading branch information
1 parent
a4bafc6
commit d9c9bf1
Showing
51 changed files
with
1,855 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
7 changes: 7 additions & 0 deletions
7
plugins/generator-1.19.2/forge-1.19.2/mappings/itemproperties.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
_mcreator_prefix: "CUSTOM:" | ||
_mcreator_map_template: "@modid:@name" | ||
damaged: damaged | ||
damage: damage | ||
lefthanded: lefthanded | ||
cooldown: cooldown | ||
custom_model_data: custom_model_data |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
8 changes: 8 additions & 0 deletions
8
plugins/generator-1.19.4/forge-1.19.4/mappings/itemproperties.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
_mcreator_prefix: "CUSTOM:" | ||
_mcreator_map_template: "@modid:@name" | ||
damaged: damaged | ||
damage: damage | ||
lefthanded: lefthanded | ||
cooldown: cooldown | ||
custom_model_data: custom_model_data | ||
trim_type: trim_type |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.