Skip to content

Create Addon Compatibility

petrolpark edited this page Jan 25, 2025 · 10 revisions

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

Tag the Item

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.

Make sure the Block Entity is Contaminable

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.

Datapack Structure

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

For Developers

   Creating a New Quality
   Create Addon Compatibility

Changelogs

   0.0.1
   0.0.2
   0.1.0
   0.2.0
   0.2.1

Clone this wiki locally