Package com.petrolpark.core.trade
Record Class ExperimentalWanderingTraderTradeListingReference
java.lang.Object
java.lang.Record
com.petrolpark.core.trade.ExperimentalWanderingTraderTradeListingReference
- All Implemented Interfaces:
ITradeListingReference
public record ExperimentalWanderingTraderTradeListingReference(int group, int index)
extends Record
implements ITradeListingReference
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.petrolpark.core.trade.ITradeListingReference
ITradeListingReference.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ExperimentalWanderingTraderTradeListingReference> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, ExperimentalWanderingTraderTradeListingReference> Fields inherited from interface com.petrolpark.core.trade.ITradeListingReference
FAILURE, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionExperimentalWanderingTraderTradeListingReference(int group, int index) Creates an instance of aExperimentalWanderingTraderTradeListingReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.entity.npc.VillagerTrades.ItemListingget()getType()intgroup()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
public static final com.mojang.serialization.MapCodec<ExperimentalWanderingTraderTradeListingReference> CODEC -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,ExperimentalWanderingTraderTradeListingReference> STREAM_CODEC
-
-
Constructor Details
-
ExperimentalWanderingTraderTradeListingReference
public ExperimentalWanderingTraderTradeListingReference(int group, int index) Creates an instance of aExperimentalWanderingTraderTradeListingReferencerecord class.- Parameters:
group- the value for thegrouprecord componentindex- the value for theindexrecord component
-
-
Method Details
-
get
public net.minecraft.world.entity.npc.VillagerTrades.ItemListing get()- Specified by:
getin interfaceITradeListingReference
-
getType
- Specified by:
getTypein interfaceITradeListingReference
-
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 '=='. -
group
public int group()Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-