Class WItem
java.lang.Object
io.github.cottonmc.cotton.gui.widget.WWidget
io.github.cottonmc.cotton.gui.widget.WItem
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether this widget can be resized usingWWidget.setSize(int, int).intReturns the animation duration of thisWItem.List<net.minecraft.world.item.ItemStack> getItems()voidpaint(net.minecraft.client.gui.GuiGraphicsExtractor context, int x, int y, int mouseX, int mouseY) Paints this widget.setDuration(int duration) Sets the item list of thisWItemand resets the animation state.voidtick()Executes a client-side tick for this widget.Methods inherited from class WWidget
addNarrations, addPainters, addTooltip, canFocus, canFocusForTextInput, canHover, getAbsoluteX, getAbsoluteY, getFocusModel, getHeight, getHost, getParent, getWidth, getX, getY, hit, hoveredProperty, isActivationKey, isFocused, isHovered, isNarratable, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onHidden, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, onPreeditUpdated, onShown, releaseFocus, renderTooltip, requestFocus, setHost, setHovered, setLocation, setParent, setSize, shouldRenderInDarkMode, validate
-
Constructor Details
-
WItem
-
WItem
public WItem(net.minecraft.tags.TagKey<? extends net.minecraft.world.level.ItemLike> tag) -
WItem
public WItem(net.minecraft.world.item.ItemStack stack)
-
-
Method Details
-
canResize
public boolean canResize()Description copied from class:WWidgetChecks whether this widget can be resized usingWWidget.setSize(int, int). -
tick
-
paint
@Environment(CLIENT) public void paint(net.minecraft.client.gui.GuiGraphicsExtractor context, int x, int y, int mouseX, int mouseY) Description copied from class:WWidgetPaints this widget. -
getDuration
public int getDuration()Returns the animation duration of thisWItem.Defaults to 25 screen ticks.
-
setDuration
-
getItems
-
setItems
-