-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathItemIconButton.java
More file actions
25 lines (19 loc) · 837 Bytes
/
ItemIconButton.java
File metadata and controls
25 lines (19 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package dev.xpple.seedmapper.seedmap;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.Tooltip;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
public class ItemIconButton extends Button {
public static final int ICON_SIZE = 16;
private final ItemStack item;
protected ItemIconButton(int x, int y, ItemStack item, Component message, OnPress onPress) {
super(x, y, ICON_SIZE, ICON_SIZE, message, onPress, DEFAULT_NARRATION);
this.item = item;
this.setTooltip(Tooltip.create(message));
}
@Override
protected void renderContents(GuiGraphics guiGraphics, int i, int j, float f) {
guiGraphics.renderItem(this.item, this.getX(), this.getY());
}
}