Record Class EnchantedPageTrade
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.entity.npc.EnchantedPageTrade
- All Implemented Interfaces:
net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing
public record EnchantedPageTrade(int xp)
extends Record
implements net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing
-
Constructor Summary
ConstructorsConstructorDescriptionEnchantedPageTrade(int xp) Creates an instance of aEnchantedPageTraderecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable net.minecraft.world.item.trading.MerchantOffergetOffer(net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity trader, net.minecraft.util.RandomSource random) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intxp()Returns the value of thexprecord component.
-
Constructor Details
-
EnchantedPageTrade
public EnchantedPageTrade(int xp) Creates an instance of aEnchantedPageTraderecord class.- Parameters:
xp- the value for thexprecord component
-
-
Method Details
-
getOffer
@Nullable public @Nullable net.minecraft.world.item.trading.MerchantOffer getOffer(net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity trader, net.minecraft.util.RandomSource random) - Specified by:
getOfferin interfacenet.minecraft.world.entity.npc.villager.VillagerTrades.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 with '=='. -
xp
public int xp()Returns the value of thexprecord component.- Returns:
- the value of the
xprecord component
-