Interface IContainerFactory<T extends net.minecraft.world.inventory.AbstractContainerMenu>

All Superinterfaces:
net.minecraft.world.inventory.MenuType.MenuSupplier<T>

public interface IContainerFactory<T extends net.minecraft.world.inventory.AbstractContainerMenu> extends net.minecraft.world.inventory.MenuType.MenuSupplier<T>
This extension of MenuType.MenuSupplier allows a mod to handle the extra data it sent to the client when creating the client-side copy of a menu.
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    create(int p_create_1_, net.minecraft.world.entity.player.Inventory p_create_2_)
     
    create(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.RegistryFriendlyByteBuf data)
    Constructs a menu instance on the client-side in response to a menu being opened on the server-side for a player.
  • Method Details

    • create

      T create(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.RegistryFriendlyByteBuf data)
      Constructs a menu instance on the client-side in response to a menu being opened on the server-side for a player.
      Parameters:
      windowId - The AbstractContainerMenu.containerId of the menu on the server-side.
      inv - Player inventory of the player for whom the menu is being created.
      data - Additional data written by the server when the menu was opened. It contains any data written by IMenuProviderExtension.writeClientSideData(AbstractContainerMenu, RegistryFriendlyByteBuf), followed by optional contextual data written by the extraDataWriter argument to IPlayerExtension.openMenu(MenuProvider, Consumer).
      Returns:
      The menu instance to use on the client-side.
    • create

      default T create(int p_create_1_, net.minecraft.world.entity.player.Inventory p_create_2_)
      Specified by:
      create in interface net.minecraft.world.inventory.MenuType.MenuSupplier<T extends net.minecraft.world.inventory.AbstractContainerMenu>