Record Class RestaurantOrderGenerator
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.order.RestaurantOrderGenerator
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser
@ParametersAreNonnullByDefault
public record RestaurantOrderGenerator(IngredientRandomizer order, List<RestaurantOrderGenerator.ModifierEntry> modifiers, List<RestaurantOrderGenerator.RewardsEntry> rewards)
extends Record
implements net.minecraft.world.level.storage.loot.LootContextUser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<RestaurantOrderGenerator>> static final com.mojang.serialization.Codec<RestaurantOrderGenerator> static final com.mojang.serialization.Codec<RestaurantOrderGenerator> -
Constructor Summary
ConstructorsConstructorDescriptionRestaurantOrderGenerator(IngredientRandomizer order, List<RestaurantOrderGenerator.ModifierEntry> modifiers, List<RestaurantOrderGenerator.RewardsEntry> rewards) Creates an instance of aRestaurantOrderGeneratorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.generate(net.minecraft.world.level.storage.loot.LootContext context, int id, Stream<RestaurantOrderGenerator.ModifierEntry> additionalModifiers) final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.order()Returns the value of theorderrecord component.rewards()Returns the value of therewardsrecord component.final StringtoString()Returns a string representation of this record class.voidvalidate(net.minecraft.world.level.storage.loot.ValidationContext context) 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
getReferencedContextParams
-
Field Details
-
UNVALIDATED_DIRECT_CODEC
public static final com.mojang.serialization.Codec<RestaurantOrderGenerator> UNVALIDATED_DIRECT_CODEC -
DIRECT_CODEC
-
CODEC
public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<RestaurantOrderGenerator>> CODEC
-
-
Constructor Details
-
RestaurantOrderGenerator
public RestaurantOrderGenerator(IngredientRandomizer order, List<RestaurantOrderGenerator.ModifierEntry> modifiers, List<RestaurantOrderGenerator.RewardsEntry> rewards) Creates an instance of aRestaurantOrderGeneratorrecord class.- Parameters:
order- the value for theorderrecord componentmodifiers- the value for themodifiersrecord componentrewards- the value for therewardsrecord component
-
-
Method Details
-
generate
public ServerRestaurantOrder generate(net.minecraft.world.level.storage.loot.LootContext context, int id, Stream<RestaurantOrderGenerator.ModifierEntry> additionalModifiers) -
validate
public void validate(net.minecraft.world.level.storage.loot.ValidationContext context) - Specified by:
validatein 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). -
order
Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-
rewards
Returns the value of therewardsrecord component.- Returns:
- the value of the
rewardsrecord component
-