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 Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleThe field for theactivationRangerecord component.(package private) static com.mojang.serialization.Codec<VaultConfig> private final doubleThe field for thedeactivationRangerecord component.(package private) static VaultConfigprivate final PlayerDetector.EntitySelectorThe field for theentitySelectorrecord component.private final ItemStackThe field for thekeyItemrecord component.private final ResourceKey<LootTable> The field for thelootTablerecord component.private final Optional<ResourceKey<LootTable>> The field for theoverrideLootTableToDisplayrecord component.private final PlayerDetectorThe field for theplayerDetectorrecord component.(package private) static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateVaultConfig(ResourceKey<LootTable> p_335999_, double p_323704_, double p_323499_, ItemStack p_323661_, Optional<ResourceKey<LootTable>> p_323481_) VaultConfig(ResourceKey<LootTable> lootTable, double activationRange, double deactivationRange, ItemStack keyItem, Optional<ResourceKey<LootTable>> overrideLootTableToDisplay, PlayerDetector playerDetector, PlayerDetector.EntitySelector entitySelector) Creates an instance of aVaultConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theactivationRangerecord component.doubleReturns the value of thedeactivationRangerecord component.Returns the value of theentitySelectorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.keyItem()Returns the value of thekeyItemrecord component.Returns the value of thelootTablerecord component.Returns the value of theoverrideLootTableToDisplayrecord component.Returns the value of theplayerDetectorrecord component.final StringtoString()Returns a string representation of this record class.private com.mojang.serialization.DataResult<VaultConfig> validate()
-
Field Details
-
lootTable
The field for thelootTablerecord component. -
activationRange
private final double activationRangeThe field for theactivationRangerecord component. -
deactivationRange
private final double deactivationRangeThe field for thedeactivationRangerecord component. -
keyItem
The field for thekeyItemrecord component. -
overrideLootTableToDisplay
The field for theoverrideLootTableToDisplayrecord component. -
playerDetector
The field for theplayerDetectorrecord component. -
entitySelector
The field for theentitySelectorrecord component. -
TAG_NAME
- See Also:
-
DEFAULT
-
CODEC
-
-
Constructor Details
-
VaultConfig
private VaultConfig() -
VaultConfig
public VaultConfig(ResourceKey<LootTable> p_335999_, double p_323704_, double p_323499_, ItemStack p_323661_, Optional<ResourceKey<LootTable>> p_323481_) -
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 aVaultConfigrecord class.- Parameters:
lootTable- the value for thelootTablerecord componentactivationRange- the value for theactivationRangerecord componentdeactivationRange- the value for thedeactivationRangerecord componentkeyItem- the value for thekeyItemrecord componentoverrideLootTableToDisplay- the value for theoverrideLootTableToDisplayrecord componentplayerDetector- the value for theplayerDetectorrecord componententitySelector- the value for theentitySelectorrecord component
-
-
Method Details
-
validate
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
lootTable
Returns the value of thelootTablerecord component.- Returns:
- the value of the
lootTablerecord component
-
activationRange
public double activationRange()Returns the value of theactivationRangerecord component.- Returns:
- the value of the
activationRangerecord component
-
deactivationRange
public double deactivationRange()Returns the value of thedeactivationRangerecord component.- Returns:
- the value of the
deactivationRangerecord component
-
keyItem
Returns the value of thekeyItemrecord component.- Returns:
- the value of the
keyItemrecord component
-
overrideLootTableToDisplay
Returns the value of theoverrideLootTableToDisplayrecord component.- Returns:
- the value of the
overrideLootTableToDisplayrecord component
-
playerDetector
Returns the value of theplayerDetectorrecord component.- Returns:
- the value of the
playerDetectorrecord component
-
entitySelector
Returns the value of theentitySelectorrecord component.- Returns:
- the value of the
entitySelectorrecord component
-