Interface IExtendedInventoryScreen


@Experimental public interface IExtendedInventoryScreen
Screens which have special support for rendering the ExtendedInventory. The Menu associated with this Screen should implement IExtendedInventoryMenu.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether the rendering of the ExtendedInventory is entirely overridden.
    net.minecraft.client.renderer.Rect2i
    getCombinedInventoryHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
    Get the location of the of the "window" which shows the combined Slots of appropriate side of the hotbar and the non-hotbar Slots of the Extended Inventory, including the border around the Slots.
    List<net.minecraft.client.renderer.Rect2i>
    Get any portion of the screen obscured by the Extended Inventory being rendered, so JEI will not render anything there.
    net.minecraft.client.renderer.Rect2i
    getInventoryLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
    Get the location of the of the "window" which shows the Slots of the Extended Inventory not on the hotbar, including the border around the Slots.
    net.minecraft.client.renderer.Rect2i
    getLeftHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
    Get the location of the of the "window" which shows the left-hand-side hotbar Slots of the Extended Inventory, including the border around the Slots.
    net.minecraft.client.renderer.Rect2i
    getRightHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
    Get the location of the of the "window" which shows the right-hand-side hotbar Slots of the Extended Inventory, including the border around the Slots.
  • Method Details

    • customExtendedInventoryRendering

      default boolean customExtendedInventoryRendering()
      Whether the rendering of the ExtendedInventory is entirely overridden. If this returns false, the backgrounds and Slot backgrounds will be rendered as usual (e.g. as in vanilla Chests). This method should be effectively static.
      Returns:
      true if you handle rendering all Extended Inventory things in the appropriate render method of this Screen
    • getLeftHotbarLocation

      net.minecraft.client.renderer.Rect2i getLeftHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
      Get the location of the of the "window" which shows the left-hand-side hotbar Slots of the Extended Inventory, including the border around the Slots. This will be called if customExtendedInventoryRendering() returns false. This should match the specifications of this method. This method gets called when the Screen opens, or whenever ExtendedInventoryClientHandler.refreshClientInventoryMenu(ExtendedInventory) gets called, so call that if the location of the Extended Inventory Slots should change (you may also have to change the locations of the Slots in the Menu attached to this Screen).
      Parameters:
      extendedInventory -
      leftHotbarSlots - The number of hotbar Slots to render to the left of the vanilla hotbar, according to the Player's configurations.
      renderMainInventoryLeft - Whether to render the Inventory Slots not in the hotbar to the left of the vanilla Inventory
      Returns:
      An area in which to render the background of this section of the Extended Inventory, or null if it should not be rendered
    • getRightHotbarLocation

      net.minecraft.client.renderer.Rect2i getRightHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
      Get the location of the of the "window" which shows the right-hand-side hotbar Slots of the Extended Inventory, including the border around the Slots. This will be called if customExtendedInventoryRendering() returns false. This should match the specifications of this method. This method gets called when the Screen opens, or whenever ExtendedInventoryClientHandler.refreshClientInventoryMenu(ExtendedInventory) gets called, so call that if the location of the Extended Inventory Slots should change (you may also have to change the locations of the Slots in the Menu attached to this Screen).
      Parameters:
      extendedInventory -
      leftHotbarSlots - The number of hotbar Slots to render to the left of the vanilla hotbar, according to the Player's configurations.
      renderMainInventoryLeft - Whether to render the Inventory Slots not in the hotbar to the left of the vanilla Inventory
      Returns:
      An area in which to render the background of this section of the Extended Inventory, or null if it should not be rendered
    • getInventoryLocation

      net.minecraft.client.renderer.Rect2i getInventoryLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
      Get the location of the of the "window" which shows the Slots of the Extended Inventory not on the hotbar, including the border around the Slots. This will be called if customExtendedInventoryRendering() returns false. This should match the specifications of this method. This method gets called when the Screen opens, or whenever ExtendedInventoryClientHandler.refreshClientInventoryMenu(ExtendedInventory) gets called, so call that if the location of the Extended Inventory Slots should change (you may also have to change the locations of the Slots in the Menu attached to this Screen).
      Parameters:
      extendedInventory -
      leftHotbarSlots - The number of hotbar Slots to render to the left of the vanilla hotbar, according to the Player's configurations.
      renderMainInventoryLeft - Whether to render the Inventory Slots not in the hotbar to the left of the vanilla Inventory
      Returns:
      An area in which to render the background of this section of the Extended Inventory, or null if it should not be rendered
    • getCombinedInventoryHotbarLocation

      net.minecraft.client.renderer.Rect2i getCombinedInventoryHotbarLocation(ExtendedInventory extendedInventory, int leftHotbarSlots, boolean renderMainInventoryLeft)
      Get the location of the of the "window" which shows the combined Slots of appropriate side of the hotbar and the non-hotbar Slots of the Extended Inventory, including the border around the Slots. This will be called if customExtendedInventoryRendering() returns false. This should match the specifications of this method. This method gets called when the Screen opens, or whenever ExtendedInventoryClientHandler.refreshClientInventoryMenu(ExtendedInventory) gets called, so call that if the location of the Extended Inventory Slots should change (you may also have to change the locations of the Slots in the Menu attached to this Screen).
      Parameters:
      extendedInventory -
      leftHotbarSlots - The number of hotbar Slots to render to the left of the vanilla hotbar, according to the Player's configurations.
      renderMainInventoryLeft - Whether to render the Inventory Slots not in the hotbar to the left of the vanilla Inventory
      Returns:
      An area in which to render the background of this section of the Extended Inventory, or null if it should not be rendered
    • getExtendedInventoryGuiAreas

      List<net.minecraft.client.renderer.Rect2i> getExtendedInventoryGuiAreas(ExtendedInventory extendedInventory)
      Get any portion of the screen obscured by the Extended Inventory being rendered, so JEI will not render anything there. It is acceptable for this to be empty if the JEI extra GUI areas are handled in another way.