Record Class VaultConfig

java.lang.Object
java.lang.Record
net.minecraft.world.level.block.entity.vault.VaultConfig

public record VaultConfig(ResourceKey<LootTable> lootTable, double activationRange, double deactivationRange, ItemStack keyItem, Optional<ResourceKey<LootTable>> overrideLootTableToDisplay, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector) extends Record
  • Field Details

    • lootTable

      private final ResourceKey<LootTable> lootTable
      The field for the lootTable record component.
    • activationRange

      private final double activationRange
      The field for the activationRange record component.
    • deactivationRange

      private final double deactivationRange
      The field for the deactivationRange record component.
    • keyItem

      private final ItemStack keyItem
      The field for the keyItem record component.
    • overrideLootTableToDisplay

      private final Optional<ResourceKey<LootTable>> overrideLootTableToDisplay
      The field for the overrideLootTableToDisplay record component.
    • playerDetector

      private final PlayerDetector playerDetector
      The field for the playerDetector record component.
    • entitySelector

      private final PlayerDetector.EntitySelector entitySelector
      The field for the entitySelector record component.
    • TAG_NAME

      static final String TAG_NAME
      See Also:
    • DEFAULT

      static VaultConfig DEFAULT
    • CODEC

      static com.mojang.serialization.Codec<VaultConfig> CODEC
  • Constructor Details

    • VaultConfig

      private VaultConfig()
    • VaultConfig

      public VaultConfig(ResourceKey<LootTable> p_335368_, double p_335328_, double p_335598_, ItemStack p_328193_, Optional<ResourceKey<LootTable>> p_333693_)
    • VaultConfig

      public VaultConfig(ResourceKey<LootTable> lootTable, double activationRange, double deactivationRange, ItemStack keyItem, Optional<ResourceKey<LootTable>> overrideLootTableToDisplay, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector)
      Creates an instance of a VaultConfig record class.
      Parameters:
      lootTable - the value for the lootTable record component
      activationRange - the value for the activationRange record component
      deactivationRange - the value for the deactivationRange record component
      keyItem - the value for the keyItem record component
      overrideLootTableToDisplay - the value for the overrideLootTableToDisplay record component
      playerDetector - the value for the playerDetector record component
      entitySelector - the value for the entitySelector record component
  • Method Details

    • validate

      private com.mojang.serialization.DataResult<VaultConfig> validate()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • lootTable

      public ResourceKey<LootTable> lootTable()
      Returns the value of the lootTable record component.
      Returns:
      the value of the lootTable record component
    • activationRange

      public double activationRange()
      Returns the value of the activationRange record component.
      Returns:
      the value of the activationRange record component
    • deactivationRange

      public double deactivationRange()
      Returns the value of the deactivationRange record component.
      Returns:
      the value of the deactivationRange record component
    • keyItem

      public ItemStack keyItem()
      Returns the value of the keyItem record component.
      Returns:
      the value of the keyItem record component
    • overrideLootTableToDisplay

      public Optional<ResourceKey<LootTable>> overrideLootTableToDisplay()
      Returns the value of the overrideLootTableToDisplay record component.
      Returns:
      the value of the overrideLootTableToDisplay record component
    • playerDetector

      public PlayerDetector playerDetector()
      Returns the value of the playerDetector record component.
      Returns:
      the value of the playerDetector record component
    • entitySelector

      public PlayerDetector.EntitySelector entitySelector()
      Returns the value of the entitySelector record component.
      Returns:
      the value of the entitySelector record component