Package net.minecraft.world.entity.npc
Record Class VillagerTrades.TypeSpecificTrade
java.lang.Object
java.lang.Record
net.minecraft.world.entity.npc.VillagerTrades.TypeSpecificTrade
- All Implemented Interfaces:
VillagerTrades.ItemListing
- Enclosing class:
- VillagerTrades
static record VillagerTrades.TypeSpecificTrade(Map<VillagerType,VillagerTrades.ItemListing> trades)
extends Record
implements VillagerTrades.ItemListing
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<VillagerType,
VillagerTrades.ItemListing> The field for thetrades
record component. -
Constructor Summary
ConstructorDescriptionCreates an instance of aTypeSpecificTrade
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getOffer
(Entity p_300790_, RandomSource p_298667_) final int
hashCode()
Returns a hash code value for this object.oneTradeInBiomes
(VillagerTrades.ItemListing p_297877_, VillagerType... p_298107_) final String
toString()
Returns a string representation of this record class.trades()
Returns the value of thetrades
record component.
-
Field Details
-
trades
The field for thetrades
record component.
-
-
Constructor Details
-
TypeSpecificTrade
TypeSpecificTrade(Map<VillagerType, VillagerTrades.ItemListing> trades) Creates an instance of aTypeSpecificTrade
record class.- Parameters:
trades
- the value for thetrades
record component
-
-
Method Details
-
oneTradeInBiomes
public static VillagerTrades.TypeSpecificTrade oneTradeInBiomes(VillagerTrades.ItemListing p_297877_, VillagerType... p_298107_) -
getOffer
- Specified by:
getOffer
in interfaceVillagerTrades.ItemListing
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
trades
Returns the value of thetrades
record component.- Returns:
- the value of the
trades
record component
-