Record Class RestaurantOrderItem.MenuProvider
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.world.restaurant.RestaurantOrderItem.MenuProvider
- All Implemented Interfaces:
net.minecraft.world.inventory.MenuConstructor,net.minecraft.world.MenuProvider,net.neoforged.neoforge.client.extensions.IMenuProviderExtension
- Enclosing class:
RestaurantOrderItem
-
Constructor Summary
ConstructorsConstructorDescriptionMenuProvider(ICustomer customer, boolean canServe) Creates an instance of aMenuProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanServe()Returns the value of thecanServerecord component.createMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) customer()Returns the value of thecustomerrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.Componentfinal inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.voidwriteClientSideData(net.minecraft.world.inventory.AbstractContainerMenu menu, net.minecraft.network.RegistryFriendlyByteBuf buffer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpen
-
Constructor Details
-
MenuProvider
Creates an instance of aMenuProviderrecord class.- Parameters:
customer- the value for thecustomerrecord componentcanServe- the value for thecanServerecord component
-
-
Method Details
-
createMenu
@Nullable public RestaurantOrderMenu createMenu(int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.entity.player.Player player) - Specified by:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
getDisplayName
public net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider
-
writeClientSideData
public void writeClientSideData(net.minecraft.world.inventory.AbstractContainerMenu menu, net.minecraft.network.RegistryFriendlyByteBuf buffer) - Specified by:
writeClientSideDatain interfacenet.neoforged.neoforge.client.extensions.IMenuProviderExtension
-
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 '=='. -
customer
Returns the value of thecustomerrecord component.- Returns:
- the value of the
customerrecord component
-
canServe
public boolean canServe()Returns the value of thecanServerecord component.- Returns:
- the value of the
canServerecord component
-