Record Class Restaurant
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.Restaurant
@ParametersAreNonnullByDefault
public record Restaurant(String translationKey, List<Restaurant.OrderGeneratorEntry> orderGeneratorEntries, List<RestaurantOrderGenerator.ModifierEntry> globalOrderModifierEntries, net.minecraft.advancements.critereon.EntityPredicate customers, net.minecraft.world.level.storage.loot.providers.number.NumberProvider xpRequiredForLevel)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<Restaurant>> static final com.mojang.serialization.Codec<Restaurant> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, net.minecraft.core.Holder<Restaurant>> -
Constructor Summary
ConstructorsConstructorDescriptionRestaurant(String translationKey, List<Restaurant.OrderGeneratorEntry> orderGeneratorEntries, List<RestaurantOrderGenerator.ModifierEntry> globalOrderModifierEntries, net.minecraft.advancements.critereon.EntityPredicate customers, net.minecraft.world.level.storage.loot.providers.number.NumberProvider xpRequiredForLevel) Creates an instance of aRestaurantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanServe(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Entity entity) net.minecraft.advancements.critereon.EntityPredicateReturns the value of thecustomersrecord component.final booleanIndicates whether some other object is "equal to" this one.static final Optional<ServerRestaurantOrder> generateOrder(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<Restaurant> restaurantHolder, ITeam team, net.minecraft.world.entity.Entity customer) net.minecraft.network.chat.ComponentgetName()Returns the value of theglobalOrderModifierEntriesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theorderGeneratorEntriesrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.net.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of thexpRequiredForLevelrecord component.
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,net.minecraft.core.Holder<Restaurant>> STREAM_CODEC
-
-
Constructor Details
-
Restaurant
public Restaurant(String translationKey, List<Restaurant.OrderGeneratorEntry> orderGeneratorEntries, List<RestaurantOrderGenerator.ModifierEntry> globalOrderModifierEntries, net.minecraft.advancements.critereon.EntityPredicate customers, net.minecraft.world.level.storage.loot.providers.number.NumberProvider xpRequiredForLevel) Creates an instance of aRestaurantrecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord componentorderGeneratorEntries- the value for theorderGeneratorEntriesrecord componentglobalOrderModifierEntries- the value for theglobalOrderModifierEntriesrecord componentcustomers- the value for thecustomersrecord componentxpRequiredForLevel- the value for thexpRequiredForLevelrecord component
-
-
Method Details
-
getName
public net.minecraft.network.chat.Component getName() -
canServe
public boolean canServe(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.entity.Entity entity) -
generateOrder
public static final Optional<ServerRestaurantOrder> generateOrder(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<Restaurant> restaurantHolder, ITeam team, @Nullable net.minecraft.world.entity.Entity customer) -
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). -
translationKey
Returns the value of thetranslationKeyrecord component.- Returns:
- the value of the
translationKeyrecord component
-
orderGeneratorEntries
Returns the value of theorderGeneratorEntriesrecord component.- Returns:
- the value of the
orderGeneratorEntriesrecord component
-
globalOrderModifierEntries
Returns the value of theglobalOrderModifierEntriesrecord component.- Returns:
- the value of the
globalOrderModifierEntriesrecord component
-
customers
public net.minecraft.advancements.critereon.EntityPredicate customers()Returns the value of thecustomersrecord component.- Returns:
- the value of the
customersrecord component
-
xpRequiredForLevel
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider xpRequiredForLevel()Returns the value of thexpRequiredForLevelrecord component.- Returns:
- the value of the
xpRequiredForLevelrecord component
-