Record Class RestaurantOrderModifier
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.order.RestaurantOrderModifier
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IRestaurantOrder.Entry
@ParametersAreNonnullByDefault
public record RestaurantOrderModifier(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider successMultiplier, net.minecraft.world.level.storage.loot.providers.number.NumberProvider failureMultiplier, IRestaurantOrder.Entry.Visibility visibility, boolean persistsToMenu)
extends Record
implements IRestaurantOrder.Entry, net.minecraft.world.level.storage.loot.LootContextUser
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.world.restaurant.order.IRestaurantOrder.Entry
IRestaurantOrder.Entry.Visibility -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RestaurantOrderModifier> -
Constructor Summary
ConstructorsConstructorDescriptionRestaurantOrderModifier(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider successMultiplier, net.minecraft.world.level.storage.loot.providers.number.NumberProvider failureMultiplier, IRestaurantOrder.Entry.Visibility visibility, boolean persistsToMenu) Creates an instance of aRestaurantOrderModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.network.chat.Component> description(net.minecraft.world.level.Level level) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of thefailureMultiplierrecord component.final inthashCode()Returns a hash code value for this object.IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> Returns the value of theingredientrecord component.net.minecraft.world.level.storage.loot.providers.number.NumberProvidermultiplierForStack(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) booleanReturns the value of thepersistsToMenurecord component.net.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of thesuccessMultiplierrecord component.voidsupplyInfo(Consumer<RestaurantOrderModifier.Info> consumer) final StringtoString()Returns a string representation of this record class.voidvalidate(net.minecraft.world.level.storage.loot.ValidationContext context) Returns the value of thevisibilityrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.world.restaurant.order.IRestaurantOrder.Entry
everVisibleMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams
-
Field Details
-
CODEC
-
-
Constructor Details
-
RestaurantOrderModifier
public RestaurantOrderModifier(IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, net.minecraft.world.level.storage.loot.providers.number.NumberProvider successMultiplier, net.minecraft.world.level.storage.loot.providers.number.NumberProvider failureMultiplier, IRestaurantOrder.Entry.Visibility visibility, boolean persistsToMenu) Creates an instance of aRestaurantOrderModifierrecord class.- Parameters:
ingredient- the value for theingredientrecord componentsuccessMultiplier- the value for thesuccessMultiplierrecord componentfailureMultiplier- the value for thefailureMultiplierrecord componentvisibility- the value for thevisibilityrecord componentpersistsToMenu- the value for thepersistsToMenurecord component
-
-
Method Details
-
description
public List<net.minecraft.network.chat.Component> description(net.minecraft.world.level.Level level) -
multiplierForStack
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider multiplierForStack(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) -
supplyInfo
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
ingredient
Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
successMultiplier
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider successMultiplier()Returns the value of thesuccessMultiplierrecord component.- Returns:
- the value of the
successMultiplierrecord component
-
failureMultiplier
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider failureMultiplier()Returns the value of thefailureMultiplierrecord component.- Returns:
- the value of the
failureMultiplierrecord component
-
visibility
Returns the value of thevisibilityrecord component.- Specified by:
visibilityin interfaceIRestaurantOrder.Entry- Returns:
- the value of the
visibilityrecord component
-
persistsToMenu
public boolean persistsToMenu()Returns the value of thepersistsToMenurecord component.- Specified by:
persistsToMenuin interfaceIRestaurantOrder.Entry- Returns:
- the value of the
persistsToMenurecord component
-