Interface IMenuProviderExtension
- All Known Subinterfaces:
ContainerEntity, MenuProvider
- All Known Implementing Classes:
AbstractChestBoat, AbstractFurnaceBlockEntity, AbstractMinecartContainer, BarrelBlockEntity, BaseContainerBlockEntity, BeaconBlockEntity, BlastFurnaceBlockEntity, BrewingStandBlockEntity, ChestBlockEntity, ChestBoat, ChestRaft, CrafterBlockEntity, DispenserBlockEntity, DropperBlockEntity, FurnaceBlockEntity, HopperBlockEntity, LecternBlockEntity, MinecartChest, MinecartHopper, RandomizableContainerBlockEntity, ShulkerBoxBlockEntity, SimpleMenuProvider, SmokerBlockEntity, TrappedChestBlockEntity
public interface IMenuProviderExtension
Extension type for the
MenuProvider interface.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturns whether the existing container should be explicitly closed on the client side when opening a new one.default voidwriteClientSideData(ServerPlayer player, AbstractContainerMenu menu, RegistryFriendlyByteBuf buffer) Allows the menu provider to write additional data to be read byIContainerFactory.create(int, Inventory, RegistryFriendlyByteBuf)when the menu is created on the client-side.default voidwriteClientSideData(AbstractContainerMenu menu, RegistryFriendlyByteBuf buffer) Allows the menu provider to write additional data to be read byIContainerFactory.create(int, Inventory, RegistryFriendlyByteBuf)when the menu is created on the client-side.
-
Method Details
-
shouldTriggerClientSideContainerClosingOnOpen
default boolean shouldTriggerClientSideContainerClosingOnOpen()Returns whether the existing container should be explicitly closed on the client side when opening a new one. Returningfalseprevents the mouse from being (re-)centered when opening a new container.- Returns:
- whether the existing container should be explicitly closed on the client side when opening a new one
-
writeClientSideData
default void writeClientSideData(ServerPlayer player, AbstractContainerMenu menu, RegistryFriendlyByteBuf buffer) Allows the menu provider to write additional data to be read byIContainerFactory.create(int, Inventory, RegistryFriendlyByteBuf)when the menu is created on the client-side.- Parameters:
player- The player opening the menu through this providermenu- A server-side menu created by this menu providerbuffer- Additional data that will be sent to the client
-
writeClientSideData
@OverrideOnly default void writeClientSideData(AbstractContainerMenu menu, RegistryFriendlyByteBuf buffer) Allows the menu provider to write additional data to be read byIContainerFactory.create(int, Inventory, RegistryFriendlyByteBuf)when the menu is created on the client-side.- Parameters:
menu- A server-side menu created by this menu providerbuffer- Additional data that will be sent to the client
-