接口 IMenuProviderExtension

所有已知子接口:
ContainerEntity, MenuProvider
所有已知实现类:
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.
  • 方法详细资料

    • shouldTriggerClientSideContainerClosingOnOpen

      default boolean shouldTriggerClientSideContainerClosingOnOpen()
      返回 true if the existing container should be closed on the client side when opening a new one, false otherwise。
      返回:
      true if the existing container should be closed on the client side when opening a new one, false otherwise
      Implementation Note:
      Returning false prevents the mouse from being (re-)centered when opening a new container.
    • writeClientSideData

      default void writeClientSideData(AbstractContainerMenu menu, RegistryFriendlyByteBuf buffer)
      Allows the menu provider to write additional data to be read by IContainerFactory.create(int, Inventory, RegistryFriendlyByteBuf) when the menu is created on the client-side.
      参数:
      menu - A server-side menu created by this menu provider.
      buffer - Additional data that will be sent to the client.