Record Class SlotListPropertyWrapper

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.config.wrapper.SlotListPropertyWrapper
Record Components:
property - The live configuration Property holding the list of equipment slot groups.
description - The ConfigDescription metadata identifying the configuration property.
fallback - The fallback list of EquipmentSlotGroup values parsed from the datapack JSON definition.

public record SlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback) extends Record
Binds a dynamic configuration property containing a list of EquipmentSlotGroup values to an enchantment's slots definition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback)
    Creates an instance of a SlotListPropertyWrapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    johnsmith.configoverhauled.api.data.ConfigDescription
    Returns the value of the description record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    List<net.minecraft.world.entity.EquipmentSlotGroup>
    Returns the value of the fallback record component.
    final int
    Returns a hash code value for this object.
    boolean
    Determines whether a valid configuration property is bound to this wrapper.
    johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>>
    Returns the value of the property record component.
    List<net.minecraft.world.entity.EquipmentSlotGroup>
    resolve(List<net.minecraft.world.entity.EquipmentSlotGroup> vanillaFallback)
    Resolves the active list of EquipmentSlotGroup values from the bound configuration property.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SlotListPropertyWrapper

      public SlotListPropertyWrapper(johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property, johnsmith.configoverhauled.api.data.ConfigDescription description, List<net.minecraft.world.entity.EquipmentSlotGroup> fallback)
      Creates an instance of a SlotListPropertyWrapper record class.
      Parameters:
      property - the value for the property record component
      description - the value for the description record component
      fallback - the value for the fallback record component
  • Method Details

    • isConfigured

      public boolean isConfigured()
      Determines whether a valid configuration property is bound to this wrapper.
      Returns:
      true if property() is non-null, false otherwise.
    • resolve

      public List<net.minecraft.world.entity.EquipmentSlotGroup> resolve(List<net.minecraft.world.entity.EquipmentSlotGroup> vanillaFallback)
      Resolves the active list of EquipmentSlotGroup values from the bound configuration property.

      Falls back to fallback() or vanillaFallback if the property is unconfigured or empty.

      Parameters:
      vanillaFallback - The baseline equipment slot group list from the enchantment definition.
      Returns:
      The resolved list of EquipmentSlotGroup instances.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • property

      public johnsmith.configoverhauled.api.Property<List<net.minecraft.world.entity.EquipmentSlotGroup>> property()
      Returns the value of the property record component.
      Returns:
      the value of the property record component
    • description

      public johnsmith.configoverhauled.api.data.ConfigDescription description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • fallback

      public List<net.minecraft.world.entity.EquipmentSlotGroup> fallback()
      Returns the value of the fallback record component.
      Returns:
      the value of the fallback record component