-
Notifications
You must be signed in to change notification settings - Fork 67
V1.5 #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jeantkg
wants to merge
52
commits into
CustomiesDevs:master
Choose a base branch
from
Amblydia:v1.5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
V1.5 #167
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
- added new item components - remove the use src-namespace-prefix - added ItemManager (this turns json into a custom item) - added CustomiesItem class
- Updated custom slime block JSON to use full_block geometry and slime_block texture. - Refactored BlockComponentsTrait to utilize RenderMethod enum for material instances. - Modified BlockManager to register blocks using a closure that captures components. - Enhanced CustomiesBlock to support dynamic component registration from JSON. - Introduced VanillaBlockComponents class to centralize component identifiers and their mappings. - Updated individual block component classes to use the new VanillaBlockComponents constants. - Implemented fromJson methods for various components to facilitate JSON parsing. - Added support for new render methods and tint methods in Material class. - Improved documentation and type safety across block component implementations.
…onents class - Added fromJson method to various item component classes to facilitate the creation of component instances from JSON data. - Introduced VanillaItemComponents class to define constants for all item component identifiers and manage their associated classes. - Enhanced item component interfaces to include fromJson method for better JSON handling.
…d custom example block and item JSON files
…sTrait and BlockComponentsTrait files; implement new ItemProperties class for better component management
…ystem - Added BlockBreakInfoComponent to manage block breaking properties such as hardness, tool type, tool harvest level, and blast resistance. - Updated CustomiesBlock to utilize BlockBreakInfoComponent for dynamic block properties. - Enhanced BlockComponents interface with getComponent method for better component retrieval. - Modified VanillaBlockComponents to support custom component registration. - Refactored item components to use VanillaItemComponents for consistency. - Improved ItemProperties to handle component mappings and apply them correctly. - Updated various item component classes to return their names from VanillaItemComponents.
- Updated `ItemComponent` interface to clarify property mapping return values. - Modified `LiquidClippedComponent`, `MaxStackSizeComponent`, `ShouldDespawnComponent`, and `StackedByDataComponent` to return actual property values instead of a placeholder string. - Enhanced `UseAnimationComponent` to use string constants for animations and added a mapping for converting them to integers. - Updated `UseModifiersComponent` to return the actual use duration value. - Removed `BlockManager` and `ItemManager` classes, consolidating their functionality into a new `BehaviorManager` class for better organization and management of custom items and blocks from JSON files. - Introduced `BlockComponentRegistry` and `ItemComponentRegistry` for centralized management of component mappings, allowing for easier registration and retrieval of components. - Updated `CustomiesBlock` and `CustomiesItem` constructors to utilize the new registries for component instantiation from JSON data.
…usage in multiple classes
…and name parameters
is_hidden_in_commands went in the wrong list
…rove permutation handling
… refactor withComponent method in Permutation
…bools and improve error handling in getArrayTag method
…poundTag for permutations
…t handling and NBT serialization
- Removed obsolete BlockPermutations, BlockPermutationsTrait, BlockState, BlockStates, BlockStatesTrait, BooleanState, IntRangeState, IntState, StringState, BlockTrait, BlockTraits, BlockTraitsTrait, PlacementDirectionTrait, and PlacementPositionTrait interfaces and traits. - Introduced new BlockPermutation and BlockPermutations classes to handle block permutations. - Implemented BlockComponents and BlockComponentsTrait for managing block components. - Established BlockState and BlockStates interfaces for state management, along with their respective implementations. - Created a comprehensive registry system for block permutations and states from JSON data. - Enhanced item component management with ItemComponentsTrait for better item handling.
…methods, improve NBT handling, and ensure compatibility with upcoming features.
- Introduced BlockPermutation and BlockPermutations interface for managing block permutations. - Added BlockPermutationsTrait to handle adding and retrieving permutations. - Removed obsolete BlockProperty, Permutable, and related classes. - Simplified BlockState management by consolidating state handling into BlockState class. - Updated CustomiesBlock to utilize new permutation and state structures. - Removed unused traits and streamlined component initialization in ItemComponentsTrait. - Adjusted BehaviorManager and Block registries to align with new structure.
Moved BlockComponents and BlockComponentsTrait to a new namespace, refactored CustomiesBlockFactory for better creative inventory and permutation handling, and made most block components final. Improved validation for materials, enhanced TransformationComponent and RandomOffsetComponent, and added block state templates. Also included .editorconfig and .gitattributes for consistent code style and line endings.
Renamed ExampleBlock.php from src/block/example to src/examples and updated its namespace accordingly for better organization.
Moved creative group management to CreativeInventoryInfo and refactored block/item registration to use it. Removed Permutations.php and moved Cartesian product logic to BlockPermutation. Improved docblocks and type hints across block, item, and entity classes for clarity and maintainability.
Refactored block and item property classes by moving them from the properties namespace to a new utils namespace. Updated all relevant imports and usages to reflect the new locations. This improves code organization and clarifies the purpose of these utility classes.
Added checks in BlockComponentsTrait and ItemComponentsTrait to ensure components are only initialized if none are set yet. This avoids redundant component addition and potential side effects.
Moved utility classes from 'utils' to 'properties' namespaces for both blocks and items, updating all references accordingly. Extracted cartesian product logic from BlockPermutation to a new Permutations class. Improved CollisionBoxComponent to use default/no collision boxes from Box, and added validation for box types. Enhanced item property handling in CustomiesItemFactory, including property ordering and type casting, and added a method to sort CompoundTags. Removed the ExampleBlock from examples.
Moved creative inventory registration for items and blocks into CreativeInventoryInfo::registerCreativeInfo, consolidating duplicate logic from CustomiesBlockFactory and CustomiesItemFactory. This improves maintainability and centralizes creative inventory handling.
improved collision box logic to handle enabled/disabled states
Introduces stricter input validation and error handling for various item and block components, such as destructible, durability, compostable, food, and enchantable components. Adds new helper methods, improves type safety, and enhances extensibility (e.g., new EffectType enum, support for potion effects in FoodComponent, and improved handling of reach/conditions in weapon components). Also fixes enum usage in DamageCause and updates constructors and docblocks for clarity and correctness.
Eliminated unnecessary imports of CreativeGroup from CustomiesBlockFactory, CustomiesItemFactory.
… improved block handling
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.
What this PR contains: