Class DataTransformerRegistry.EffectsTransformer
java.lang.Object
johnsmith.enchantmentcore.api.registry.DataTransformerRegistry.EffectsTransformer
- All Implemented Interfaces:
DataTransformerRegistry.Transformer
- Enclosing class:
DataTransformerRegistry
public static class DataTransformerRegistry.EffectsTransformer
extends Object
implements DataTransformerRegistry.Transformer
Recursive
DataTransformerRegistry.Transformer implementation that traverses the "effects" tree of an
enchantment JSON object, converting registered DataTransformerRegistry.getEffectProperties() nodes via
ValueImporterRegistry and ValueExporterRegistry while respecting type and structural exclusions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyExport(com.google.gson.JsonObject root) Mutates the enchantment JSON tree during the export phase, unwrapping dynamic configuration structures back into their static fallback representations.voidapplyImport(com.google.gson.JsonObject root, String targetNamespace, String enchantmentName) Mutates the enchantment JSON tree during the import phase, wrapping static values into dynamic configuration structures bound totargetNamespace.
-
Constructor Details
-
EffectsTransformer
public EffectsTransformer()
-
-
Method Details
-
applyImport
public void applyImport(com.google.gson.JsonObject root, String targetNamespace, String enchantmentName) Description copied from interface:DataTransformerRegistry.TransformerMutates the enchantment JSON tree during the import phase, wrapping static values into dynamic configuration structures bound totargetNamespace.- Specified by:
applyImportin interfaceDataTransformerRegistry.Transformer- Parameters:
root- The root enchantmentJsonObjectbeing mutated.targetNamespace- The mod namespace assigned to the generated configuration properties.enchantmentName- The path identifier of the target enchantment (used as the config group name).
-
applyExport
public void applyExport(com.google.gson.JsonObject root) Description copied from interface:DataTransformerRegistry.TransformerMutates the enchantment JSON tree during the export phase, unwrapping dynamic configuration structures back into their static fallback representations.- Specified by:
applyExportin interfaceDataTransformerRegistry.Transformer- Parameters:
root- The root enchantmentJsonObjectbeing mutated.
-