-
Notifications
You must be signed in to change notification settings - Fork 2
Create Addon Compatibility
pquality has a feature that decreases the Stress Impact of Create machines. To enable this feature for Create machines in your addon, a few things must be done:
- Tag the Item as Contaminable
- Make sure the Block Entity is Contaminable
By default, any Items which are Blocks (can be placed down) cannot have Contaminants (because they would lose their Contamination once placed), and therefore cannot have a Quality. To fix this, add the Item corresponding to your Create machine to the Item tag (not Block tag) petrolpark:contaminable_blocks.
If your Block Entity is a KineticBlockEntity all you will need to do is add the Block Entity Type to the Block Entity Type tag (not Block tag) pquality:quality_affects_stress_impact. This automatically adds a ContaminationBehaviour to your Block Entity and will cause the Stress Impact to depend on Quality (unless the method calculateStressApplied is overridden).
This is only recommended if you don't have a dependency on pquality. If you do, you should add the ContaminationBehaviour in the addBehaviours method of SmartBlockEntity, and transfer the Contamination of the Item to the Contamination of the Block Entity as suggested in the JavaDocs for ContaminationBehaviour. Then, override calculateStressImpact yourself.
Here's how your datapack should look if you follow this suggested method:
└── data
├── petrolpark
| └── tags
| └── items
| └── contaminable_blocks.json
└── pquality
└── tags
└── block_entity_type
└── quality_affects_stress_impact.json