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
Modifier and TypeFieldDescriptionprivate final double
The field for theactivationRange
record component.(package private) static com.mojang.serialization.Codec
<VaultConfig> private final double
The field for thedeactivationRange
record component.(package private) static VaultConfig
private final PlayerDetector.EntitySelector
The field for theentitySelector
record component.private final ItemStack
The field for thekeyItem
record component.private final ResourceKey
<LootTable> The field for thelootTable
record component.private final Optional
<ResourceKey<LootTable>> The field for theoverrideLootTableToDisplay
record component.private final PlayerDetector
The field for theplayerDetector
record component.(package private) static final String
-
Constructor Summary
ModifierConstructorDescriptionprivate
VaultConfig
(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 aVaultConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the value of theactivationRange
record component.double
Returns the value of thedeactivationRange
record component.Returns the value of theentitySelector
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.keyItem()
Returns the value of thekeyItem
record component.Returns the value of thelootTable
record component.Returns the value of theoverrideLootTableToDisplay
record component.Returns the value of theplayerDetector
record component.final String
toString()
Returns a string representation of this record class.private com.mojang.serialization.DataResult
<VaultConfig> validate()
-
Field Details
-
lootTable
The field for thelootTable
record component. -
activationRange
private final double activationRangeThe field for theactivationRange
record component. -
deactivationRange
private final double deactivationRangeThe field for thedeactivationRange
record component. -
keyItem
The field for thekeyItem
record component. -
overrideLootTableToDisplay
The field for theoverrideLootTableToDisplay
record component. -
playerDetector
The field for theplayerDetector
record component. -
entitySelector
The field for theentitySelector
record 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 aVaultConfig
record class.- Parameters:
lootTable
- the value for thelootTable
record componentactivationRange
- the value for theactivationRange
record componentdeactivationRange
- the value for thedeactivationRange
record componentkeyItem
- the value for thekeyItem
record componentoverrideLootTableToDisplay
- the value for theoverrideLootTableToDisplay
record componentplayerDetector
- the value for theplayerDetector
record componententitySelector
- the value for theentitySelector
record 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 thelootTable
record component.- Returns:
- the value of the
lootTable
record component
-
activationRange
public double activationRange()Returns the value of theactivationRange
record component.- Returns:
- the value of the
activationRange
record component
-
deactivationRange
public double deactivationRange()Returns the value of thedeactivationRange
record component.- Returns:
- the value of the
deactivationRange
record component
-
keyItem
Returns the value of thekeyItem
record component.- Returns:
- the value of the
keyItem
record component
-
overrideLootTableToDisplay
Returns the value of theoverrideLootTableToDisplay
record component.- Returns:
- the value of the
overrideLootTableToDisplay
record component
-
playerDetector
Returns the value of theplayerDetector
record component.- Returns:
- the value of the
playerDetector
record component
-
entitySelector
Returns the value of theentitySelector
record component.- Returns:
- the value of the
entitySelector
record component
-