Record Class TradeRebalanceVillagerTrades.BookTradeDefinition
java.lang.Object
java.lang.Record
net.minecraft.world.item.trading.TradeRebalanceVillagerTrades.BookTradeDefinition
- Enclosing class:
TradeRebalanceVillagerTrades
private static record TradeRebalanceVillagerTrades.BookTradeDefinition(ResourceKey<VillagerTrade> resourceKey, ResourceKey<VillagerType> villagerType, ResourceKey<Enchantment> enchantment, int level)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceKey<Enchantment> The field for theenchantmentrecord component.private final intThe field for thelevelrecord component.private final ResourceKey<VillagerTrade> The field for theresourceKeyrecord component.private final ResourceKey<VillagerType> The field for thevillagerTyperecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBookTradeDefinition(ResourceKey<VillagerTrade> resourceKey, ResourceKey<VillagerType> villagerType, ResourceKey<Enchantment> enchantment, int level) Creates an instance of aBookTradeDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenchantmentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlevel()Returns the value of thelevelrecord component.Returns the value of theresourceKeyrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevillagerTyperecord component.
-
Field Details
-
resourceKey
The field for theresourceKeyrecord component. -
villagerType
The field for thevillagerTyperecord component. -
enchantment
The field for theenchantmentrecord component. -
level
private final int levelThe field for thelevelrecord component.
-
-
Constructor Details
-
BookTradeDefinition
private BookTradeDefinition(ResourceKey<VillagerTrade> resourceKey, ResourceKey<VillagerType> villagerType, ResourceKey<Enchantment> enchantment, int level) Creates an instance of aBookTradeDefinitionrecord class.- Parameters:
resourceKey- the value for theresourceKeyrecord componentvillagerType- the value for thevillagerTyperecord componentenchantment- the value for theenchantmentrecord componentlevel- the value for thelevelrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
resourceKey
Returns the value of theresourceKeyrecord component.- Returns:
- the value of the
resourceKeyrecord component
-
villagerType
Returns the value of thevillagerTyperecord component.- Returns:
- the value of the
villagerTyperecord component
-
enchantment
Returns the value of theenchantmentrecord component.- Returns:
- the value of the
enchantmentrecord component
-
level
public int level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-