Class ClientBundleTooltip

java.lang.Object
net.minecraft.client.gui.screens.inventory.tooltip.ClientBundleTooltip
All Implemented Interfaces:
ClientTooltipComponent

public class ClientBundleTooltip extends Object implements ClientTooltipComponent
  • Field Details

    • PROGRESSBAR_BORDER_SPRITE

      private static final Identifier PROGRESSBAR_BORDER_SPRITE
    • PROGRESSBAR_FILL_SPRITE

      private static final Identifier PROGRESSBAR_FILL_SPRITE
    • PROGRESSBAR_FULL_SPRITE

      private static final Identifier PROGRESSBAR_FULL_SPRITE
    • SLOT_HIGHLIGHT_BACK_SPRITE

      private static final Identifier SLOT_HIGHLIGHT_BACK_SPRITE
    • SLOT_HIGHLIGHT_FRONT_SPRITE

      private static final Identifier SLOT_HIGHLIGHT_FRONT_SPRITE
    • SLOT_BACKGROUND_SPRITE

      private static final Identifier SLOT_BACKGROUND_SPRITE
    • SLOT_MARGIN

      private static final int SLOT_MARGIN
      See Also:
    • SLOT_SIZE

      private static final int SLOT_SIZE
      See Also:
    • GRID_WIDTH

      private static final int GRID_WIDTH
      See Also:
    • PROGRESSBAR_HEIGHT

      private static final int PROGRESSBAR_HEIGHT
      See Also:
    • PROGRESSBAR_WIDTH

      private static final int PROGRESSBAR_WIDTH
      See Also:
    • PROGRESSBAR_BORDER

      private static final int PROGRESSBAR_BORDER
      See Also:
    • PROGRESSBAR_FILL_MAX

      private static final int PROGRESSBAR_FILL_MAX
      See Also:
    • PROGRESSBAR_MARGIN_Y

      private static final int PROGRESSBAR_MARGIN_Y
      See Also:
    • BUNDLE_FULL_TEXT

      private static final Component BUNDLE_FULL_TEXT
    • BUNDLE_EMPTY_TEXT

      private static final Component BUNDLE_EMPTY_TEXT
    • BUNDLE_EMPTY_DESCRIPTION

      private static final Component BUNDLE_EMPTY_DESCRIPTION
    • contents

      private final BundleContents contents
  • Constructor Details

    • ClientBundleTooltip

      public ClientBundleTooltip(BundleContents contents)
  • Method Details

    • getHeight

      public int getHeight(Font font)
      Specified by:
      getHeight in interface ClientTooltipComponent
    • getWidth

      public int getWidth(Font font)
      Specified by:
      getWidth in interface ClientTooltipComponent
    • showTooltipWithItemInHand

      public boolean showTooltipWithItemInHand()
      Specified by:
      showTooltipWithItemInHand in interface ClientTooltipComponent
    • getEmptyBundleBackgroundHeight

      private static int getEmptyBundleBackgroundHeight(Font font)
    • backgroundHeight

      private int backgroundHeight()
    • itemGridHeight

      private int itemGridHeight()
    • getContentXOffset

      private static int getContentXOffset(int tooltipWidth)
    • gridSizeY

      private int gridSizeY()
    • slotCount

      private int slotCount()
    • renderImage

      public void renderImage(Font font, int x, int y, int w, int h, GuiGraphics graphics)
      Specified by:
      renderImage in interface ClientTooltipComponent
    • renderEmptyBundleTooltip

      private static void renderEmptyBundleTooltip(Font font, int x, int y, int w, int h, GuiGraphics graphics)
    • renderBundleWithItemsTooltip

      private void renderBundleWithItemsTooltip(Font font, int x, int y, int w, int h, GuiGraphics graphics, org.apache.commons.lang3.math.Fraction weight)
    • getShownItems

      private List<ItemStackTemplate> getShownItems(int amountOfItemsToShow)
    • shouldRenderSurplusText

      private static boolean shouldRenderSurplusText(boolean isOverflowing, int column, int row)
    • shouldRenderItemSlot

      private static boolean shouldRenderItemSlot(List<? extends ItemInstance> shownItems, int slotNumber)
    • getAmountOfHiddenItems

      private int getAmountOfHiddenItems(List<ItemStackTemplate> shownItems)
    • renderSlot

      private void renderSlot(int slotNumber, int drawX, int drawY, List<ItemStackTemplate> shownItems, int slotIndex, Font font, GuiGraphics graphics)
    • renderCount

      private static void renderCount(int drawX, int drawY, int hiddenItemCount, Font font, GuiGraphics graphics)
    • drawSelectedItemTooltip

      private void drawSelectedItemTooltip(Font font, GuiGraphics graphics, int x, int y, int w)
    • drawProgressbar

      private static void drawProgressbar(int x, int y, Font font, GuiGraphics graphics, org.apache.commons.lang3.math.Fraction weight)
    • drawEmptyBundleDescriptionText

      private static void drawEmptyBundleDescriptionText(int x, int y, Font font, GuiGraphics graphics)
    • getEmptyBundleDescriptionTextHeight

      private static int getEmptyBundleDescriptionTextHeight(Font font)
    • getProgressBarFill

      private static int getProgressBarFill(org.apache.commons.lang3.math.Fraction weight)
    • getProgressBarTexture

      private static Identifier getProgressBarTexture(org.apache.commons.lang3.math.Fraction weight)
    • getProgressBarFillText

      private static @Nullable Component getProgressBarFillText(org.apache.commons.lang3.math.Fraction weight)