Record Class SimpleItemListing
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.entity.npc.trading.SimpleItemListing
- All Implemented Interfaces:
net.minecraft.world.entity.npc.VillagerTrades.ItemListing
public record SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier)
extends Record
implements net.minecraft.world.entity.npc.VillagerTrades.ItemListing
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SimpleItemListing> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SimpleItemListing> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses) SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward) SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier) SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier) Creates an instance of aSimpleItemListingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.item.trading.MerchantOffergetOffer(net.minecraft.world.entity.Entity p_219693_, net.minecraft.util.RandomSource p_219694_) final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.ItemStackitem1()Returns the value of theitem1record component.net.minecraft.world.item.ItemStackitem2()Returns the value of theitem2record component.intmaxUses()Returns the value of themaxUsesrecord component.floatReturns the value of thepriceMultiplierrecord component.net.minecraft.world.item.ItemStackresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.intxpReward()Returns the value of thexpRewardrecord component.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleItemListing> STREAM_CODEC
-
-
Constructor Details
-
SimpleItemListing
public SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier) -
SimpleItemListing
public SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward) -
SimpleItemListing
public SimpleItemListing(int emeralds, net.minecraft.world.item.ItemStack result, int maxUses) -
SimpleItemListing
public SimpleItemListing(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2, net.minecraft.world.item.ItemStack result, int maxUses, int xpReward, float priceMultiplier) Creates an instance of aSimpleItemListingrecord class.- Parameters:
item1- the value for theitem1record componentitem2- the value for theitem2record componentresult- the value for theresultrecord 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 p_219693_, net.minecraft.util.RandomSource p_219694_) - 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 '=='. -
item1
public net.minecraft.world.item.ItemStack item1()Returns the value of theitem1record component.- Returns:
- the value of the
item1record component
-
item2
public net.minecraft.world.item.ItemStack item2()Returns the value of theitem2record component.- Returns:
- the value of the
item2record component
-
result
public net.minecraft.world.item.ItemStack result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord 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
-