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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package lv.enes.mc.eris_alchemy.client;
import lv.enes.mc.eris_alchemy.ErisAlchemy;
import lv.enes.mc.eris_alchemy.menu.AlchemicalChestMenu;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;
public class AlchemicalChestScreen extends AbstractContainerScreen<AlchemicalChestMenu> {
public static final ResourceLocation TEXTURE =
new ResourceLocation(ErisAlchemy.ID, "textures/gui/container/alchemical_chest.png");
public static final int TEXTURE_WIDTH = 248;
public static final int TEXTURE_HEIGHT = 237;
public AlchemicalChestScreen(AlchemicalChestMenu menu, Inventory inventory, Component title) {
super(menu, inventory, title);
imageWidth = TEXTURE_WIDTH;
imageHeight = TEXTURE_HEIGHT;
}
@Override
public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
renderBackground(graphics);
super.render(graphics, mouseX, mouseY, delta);
renderTooltip(graphics, mouseX, mouseY);
}
@Override
protected void renderBg(GuiGraphics graphics, float delta, int mouseX, int mouseY) {
int x = (width - imageWidth) / 2;
int y = (height - imageHeight) / 2;
graphics.blit(TEXTURE, x, y, 0, 0, imageWidth, imageHeight);
}
@Override
protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
// Don't render any labels, there's no space for them lol
}
}
|