Record Class ItemsForEmeralds
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.entity.npc.trading.trades.ItemsForEmeralds
- All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing
public record ItemsForEmeralds(net.minecraft.world.item.ItemStack itemStack, int emeraldCost, int maxUses, int xpReward, float priceMultiplier)
extends Record
implements net.minecraft.world.entity.npc.VillagerTrades.ItemListing
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemsForEmeralds(net.minecraft.world.item.ItemStack itemStack, int emeraldCost, int maxUses) ItemsForEmeralds(net.minecraft.world.item.ItemStack itemStack, int emeraldCost, int maxUses, int xpReward, float priceMultiplier) Creates an instance of aItemsForEmeraldsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theemeraldCostrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.trading.MerchantOffergetOffer(net.minecraft.world.entity.Entity trader, net.minecraft.util.RandomSource randomSource) final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackReturns the value of theitemStackrecord component.intmaxUses()Returns the value of themaxUsesrecord component.floatReturns the value of thepriceMultiplierrecord component.final StringtoString()Returns a string representation of this record class.intxpReward()Returns the value of thexpRewardrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ItemsForEmeralds
public ItemsForEmeralds(net.minecraft.world.item.ItemStack itemStack, int emeraldCost, int maxUses) -
ItemsForEmeralds
public ItemsForEmeralds(net.minecraft.world.item.ItemStack itemStack, int emeraldCost, int maxUses, int xpReward, float priceMultiplier) Creates an instance of aItemsForEmeraldsrecord class.- Parameters:
itemStack- the value for theitemStackrecord componentemeraldCost- the value for theemeraldCostrecord componentmaxUses- the value for themaxUsesrecord componentxpReward- the value for thexpRewardrecord componentpriceMultiplier- the value for thepriceMultiplierrecord component
-
-
Method Details
-
getOffer
public net.minecraft.world.item.trading.MerchantOffer getOffer(net.minecraft.world.entity.Entity trader, net.minecraft.util.RandomSource randomSource) - Specified by:
getOfferin interfacenet.minecraft.world.entity.npc.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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
itemStack
public net.minecraft.world.item.ItemStack itemStack()Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-
emeraldCost
public int emeraldCost()Returns the value of theemeraldCostrecord component.- Returns:
- the value of the
emeraldCostrecord component
-
maxUses
public int maxUses()Returns the value of themaxUsesrecord component.- Returns:
- the value of the
maxUsesrecord component
-
xpReward
public int xpReward()Returns the value of thexpRewardrecord component.- Returns:
- the value of the
xpRewardrecord component
-
priceMultiplier
public float priceMultiplier()Returns the value of thepriceMultiplierrecord component.- Returns:
- the value of the
priceMultiplierrecord component
-