Record Class ServerRestaurantOrder
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.order.ServerRestaurantOrder
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IRestaurantOrder
@ParametersAreNonnullByDefault
public record ServerRestaurantOrder(int id, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, List<RestaurantOrderModifier> modifiers, List<ServerRestaurantOrder.RewardEntry> rewardEntries)
extends Record
implements IRestaurantOrder, 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
IRestaurantOrder.Entry -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ServerRestaurantOrder> Fields inherited from interface petrolpark.mc.library.core.world.restaurant.order.IRestaurantOrder
SERVER_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionServerRestaurantOrder(int id, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, List<RestaurantOrderModifier> modifiers, List<ServerRestaurantOrder.RewardEntry> rewardEntries) Creates an instance of aServerRestaurantOrderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> Returns the value of theingredientrecord component.Returns the value of themodifiersrecord component.Returns the value of therewardEntriesrecord component.booleantest(net.minecraft.world.item.ItemStack stack) 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
-
CODEC
-
-
Constructor Details
-
ServerRestaurantOrder
public ServerRestaurantOrder(int id, IAdvancedIngredient<? super net.minecraft.world.item.ItemStack> ingredient, List<RestaurantOrderModifier> modifiers, List<ServerRestaurantOrder.RewardEntry> rewardEntries) Creates an instance of aServerRestaurantOrderrecord class.- Parameters:
id- the value for theidrecord componentingredient- the value for theingredientrecord componentmodifiers- the value for themodifiersrecord componentrewardEntries- the value for therewardEntriesrecord component
-
-
Method Details
-
test
public boolean test(net.minecraft.world.item.ItemStack stack) -
stripForMenu
-
modifiersInfo
- Specified by:
modifiersInfoin interfaceIRestaurantOrder
-
rewardsInfo
- Specified by:
rewardsInfoin interfaceIRestaurantOrder
-
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 '=='. -
id
public int id()Returns the value of theidrecord component.- Specified by:
idin interfaceIRestaurantOrder- Returns:
- the value of the
idrecord component
-
ingredient
Returns the value of theingredientrecord component.- Specified by:
ingredientin interfaceIRestaurantOrder- Returns:
- the value of the
ingredientrecord component
-
modifiers
Returns the value of themodifiersrecord component.- Returns:
- the value of the
modifiersrecord component
-
rewardEntries
Returns the value of therewardEntriesrecord component.- Returns:
- the value of the
rewardEntriesrecord component
-