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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyExport(com.google.gson.JsonObject root)
    Mutates the enchantment JSON tree during the export phase, unwrapping dynamic configuration structures back into their static fallback representations.
    void
    applyImport(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 to targetNamespace.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.Transformer
      Mutates the enchantment JSON tree during the import phase, wrapping static values into dynamic configuration structures bound to targetNamespace.
      Specified by:
      applyImport in interface DataTransformerRegistry.Transformer
      Parameters:
      root - The root enchantment JsonObject being 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.Transformer
      Mutates the enchantment JSON tree during the export phase, unwrapping dynamic configuration structures back into their static fallback representations.
      Specified by:
      applyExport in interface DataTransformerRegistry.Transformer
      Parameters:
      root - The root enchantment JsonObject being mutated.