Class EmptyPreviewProvider

java.lang.Object
com.misterpemodder.shulkerboxtooltip.api.provider.EmptyPreviewProvider
All Implemented Interfaces:
PreviewProvider

public class EmptyPreviewProvider extends Object implements PreviewProvider
A PreviewProvider that does nothing.
Since:
1.3.0
  • Field Details

    • INSTANCE

      public static final PreviewProvider INSTANCE
      The EmptyPreviewProvider instance.
      Since:
      1.3.0
  • Constructor Details

    • EmptyPreviewProvider

      protected EmptyPreviewProvider()
      Default constructor.
  • Method Details

    • getInventoryMaxSize

      public int getInventoryMaxSize(PreviewContext context)
      Description copied from interface: PreviewProvider
      Returns the maximum amount of slots this preview can display.
      Specified by:
      getInventoryMaxSize in interface PreviewProvider
      Parameters:
      context - The preview context.
      Returns:
      The maximum inventory size for the given stack.
    • shouldDisplay

      public boolean shouldDisplay(PreviewContext context)
      Description copied from interface: PreviewProvider
      Queries if the preview window should be displayed for the given context. Should return false if the inventory is empty.
      Specified by:
      shouldDisplay in interface PreviewProvider
      Parameters:
      context - The preview context.
      Returns:
      Whether the preview should be displayed.
    • getInventory

      public List<net.minecraft.world.item.ItemStack> getInventory(PreviewContext context)
      Description copied from interface: PreviewProvider
      Fetches the items to be displayed in the preview.
      Specified by:
      getInventory in interface PreviewProvider
      Parameters:
      context - The preview context.
      Returns:
      The list of items, may not be null or contain null elements.