Class RotatingItemIcon

java.lang.Object
com.ldtteam.blockui.UiRenderMacros
com.ldtteam.blockui.Pane
com.ldtteam.blockui.controls.ItemIcon
com.minecolonies.core.client.gui.blockui.RotatingItemIcon

public class RotatingItemIcon extends com.ldtteam.blockui.controls.ItemIcon
Variation of the ItemIcon which accepts multiple items and slowly rotates between them. * TODO: This needs to be ported to BlockUI at a later stage, with a proper animation handler, * instead of being backed by a timer, increased through the draw methods. * Conferred with Nightenom that we keep this in Minecolonies for the time being.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.ldtteam.blockui.UiRenderMacros

    com.ldtteam.blockui.UiRenderMacros.ResolvedBlit
  • Field Summary

    Fields inherited from class com.ldtteam.blockui.controls.ItemIcon

    DEFAULT_ITEMSTACK_SIZE, FIX_VANILLA_TOOLTIP, itemStack, renderItemDecorations, tooltipUpdateScheduled

    Fields inherited from class com.ldtteam.blockui.Pane

    alignment, cursor, debugging, enabled, focus, height, hoverSource, id, lastClickedPane, mc, onHover, onHoverId, parent, visible, wasCursorInPane, width, window, x, y

    Fields inherited from class com.ldtteam.blockui.UiRenderMacros

    HALF_BIAS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawSelf(com.ldtteam.blockui.BOGuiGraphics ms, double mx, double my)
     
    void
    setDuration(int duration)
    The duration to switch between items, in ticks.
    void
    setItems(@NotNull List<net.minecraft.world.item.ItemStack> items)
    Set all possible items.

    Methods inherited from class com.ldtteam.blockui.controls.ItemIcon

    appendTooltip, clearDataAndScheduleTooltipUpdate, getItem, getModifiedItemStackTooltip, isDataEmpty, isItemEmpty, modifyTooltipName, onItemUpdate, onUpdate, renderItemDecorations, setItem, setItemFromBlockState, setRenderItemDecorations, updateTooltipIfNeeded, wrapShift, wrapShift

    Methods inherited from class com.ldtteam.blockui.Pane

    canHandleClick, clearFocus, click, disable, draw, drawHidden, drawLast, drawSelfLast, enable, findFirstPaneByType, findPaneByID, findPaneByType, findPaneOfTypeByID, getAlignment, getCursor, getFocus, getHeight, getHoverPane, getID, getParent, getWidth, getWindow, getX, getY, handleClick, handleHover, handleRightClick, hide, isClickable, isEnabled, isFocus, isPointInPane, isVisible, moveBy, off, on, onFocus, onFocusLost, onKeyTyped, onMouseDrag, parseChildren, putInside, rightClick, scissorsEnd, scissorsStart, scrollInput, setAlignment, setCursor, setEnabled, setFocus, setFocus, setHoverPane, setID, setParentView, setPosition, setSize, setVisible, setWindow, shouldDraw, show, wasCursorInPane

    Methods inherited from class com.ldtteam.blockui.UiRenderMacros

    blit, blit, blit, blit, blitRepeatable, blitSprite, blitSprite, drawEntity, drawLineRect, drawLineRect, drawLineRect, drawLineRectGradient, drawLineRectGradient, drawLineRectGradient, fill, fill, fillGradient, fillGradient, hLine, hLine, line, line, populateBlitTriangles, populateFillGradientTriangles, populateFillTriangles, resolveSprite, vLine, vLine

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RotatingItemIcon

      public RotatingItemIcon()
      Default constructor.
  • Method Details

    • setItems

      public void setItems(@NotNull @NotNull List<net.minecraft.world.item.ItemStack> items)
      Set all possible items.
      Parameters:
      items - the full list of items.
    • setDuration

      public void setDuration(int duration)
      The duration to switch between items, in ticks. Defaults to 40 (2 seconds), minimum of 1 tick.
      Parameters:
      duration - the new duration.
    • drawSelf

      public void drawSelf(com.ldtteam.blockui.BOGuiGraphics ms, double mx, double my)
      Overrides:
      drawSelf in class com.ldtteam.blockui.controls.ItemIcon