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 TypeMethodDescriptionvoidpaint(net.minecraft.client.util.math.MatrixStack matrices, int x, int y, int size) Paints this icon.
-
Constructor Details
-
ItemIcon
public ItemIcon(net.minecraft.item.ItemStack stack) Constructs an item icon.- Parameters:
stack- the drawn item stack- Throws:
NullPointerException- if the stack is null
-
ItemIcon
public ItemIcon(net.minecraft.item.Item item) 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
@Environment(CLIENT) public void paint(net.minecraft.client.util.math.MatrixStack matrices, int x, int y, int size) Description copied from interface:IconPaints this icon.
-