Skip to content

Conversation

@jeantkg
Copy link
Contributor

@jeantkg jeantkg commented Jan 10, 2026

What this PR contains:

  • Update to both Item and Block Components
  • Update to Block States and Permutation

jeantkg and others added 30 commits September 25, 2025 21:28
- 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.
…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.
is_hidden_in_commands went in the wrong list
… refactor withComponent method in Permutation
…bools and improve error handling in getArrayTag method
jeantkg and others added 22 commits December 19, 2025 22:32
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants