Package com.petrolpark.core.shop
Record Class Shop.OfferGeneratorEntry
java.lang.Object
java.lang.Record
com.petrolpark.core.shop.Shop.OfferGeneratorEntry
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser
- Enclosing class:
Shop
public static record Shop.OfferGeneratorEntry(ShopOfferGenerator generator, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight)
extends Record
implements net.minecraft.world.level.storage.loot.LootContextUser
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Shop.OfferGeneratorEntry> -
Constructor Summary
ConstructorsConstructorDescriptionOfferGeneratorEntry(ShopOfferGenerator generator, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight) Creates an instance of aOfferGeneratorEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thegeneratorrecord component.Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.net.minecraft.world.level.storage.loot.providers.number.NumberProviderweight()Returns the value of theweightrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
OfferGeneratorEntry
public OfferGeneratorEntry(ShopOfferGenerator generator, net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight) Creates an instance of aOfferGeneratorEntryrecord class.- Parameters:
generator- the value for thegeneratorrecord componentweight- the value for theweightrecord component
-
-
Method Details
-
getReferencedContextParams
public Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getReferencedContextParams()- Specified by:
getReferencedContextParamsin interfacenet.minecraft.world.level.storage.loot.LootContextUser
-
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). -
generator
Returns the value of thegeneratorrecord component.- Returns:
- the value of the
generatorrecord component
-
weight
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-