Class ItemIcon
java.lang.Object
io.github.cottonmc.cotton.gui.widget.icon.ItemIcon
- All Implemented Interfaces:
Icon
An icon that draws an item stack.
- Since:
- 2.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisGhost()Checks whether this icon is a ghost item.voidpaint(DrawContext context, int x, int y, int size) Paints this icon.setGhost(boolean ghost) Marks this icon as a ghost or non-ghost icon.
-
Constructor Details
-
ItemIcon
Constructs an item icon.- Parameters:
stack- the drawn item stack- Throws:
NullPointerException- if the stack is null
-
ItemIcon
Constructs an item icon with the item's default stack.- Parameters:
item- the drawn item- Throws:
NullPointerException- if the item is null- Since:
- 3.2.0
-
-
Method Details
-
paint
Description copied from interface:IconPaints this icon. -
isGhost
public boolean isGhost()Checks whether this icon is a ghost item. Ghost items are rendered with a pale overlay.- Returns:
trueif this icon is a ghost item,falseotherwise- Since:
- 9.2.0
-
setGhost
Marks this icon as a ghost or non-ghost icon.- Parameters:
ghost-trueif this icon is a ghost item,falseotherwise- Returns:
- this icon
- Since:
- 9.2.0
-