32 lines
1.3 KiB
Java
32 lines
1.3 KiB
Java
package net.minecraft.client.gui.screens.inventory;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.gui.GuiGraphics;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.entity.player.Inventory;
|
|
import net.minecraft.world.inventory.ShulkerBoxMenu;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class ShulkerBoxScreen extends AbstractContainerScreen<ShulkerBoxMenu> {
|
|
private static final ResourceLocation CONTAINER_TEXTURE = ResourceLocation.withDefaultNamespace("textures/gui/container/shulker_box.png");
|
|
|
|
public ShulkerBoxScreen(ShulkerBoxMenu menu, Inventory playerInventory, Component title) {
|
|
super(menu, playerInventory, title);
|
|
this.imageHeight++;
|
|
}
|
|
|
|
@Override
|
|
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
|
|
super.render(guiGraphics, mouseX, mouseY, partialTick);
|
|
this.renderTooltip(guiGraphics, mouseX, mouseY);
|
|
}
|
|
|
|
@Override
|
|
protected void renderBg(GuiGraphics guiGraphics, float partialTick, int mouseX, int mouseY) {
|
|
int i = (this.width - this.imageWidth) / 2;
|
|
int j = (this.height - this.imageHeight) / 2;
|
|
guiGraphics.blit(CONTAINER_TEXTURE, i, j, 0, 0, this.imageWidth, this.imageHeight);
|
|
}
|
|
}
|