mailbox gui texture
This commit is contained in:
parent
5330dd2b4e
commit
ecce95c09f
|
@ -1,21 +1,41 @@
|
||||||
package com.danitheskunk.skunkstuff.Blocks;
|
package com.danitheskunk.skunkstuff.Blocks;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.HopperScreen;
|
||||||
|
import net.minecraft.client.gui.screens.inventory.ShulkerBoxScreen;
|
||||||
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Inventory;
|
import net.minecraft.world.entity.player.Inventory;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class ScreenMailbox extends AbstractContainerScreen<MenuMailbox> {
|
public class ScreenMailbox extends AbstractContainerScreen<MenuMailbox> {
|
||||||
|
private static final ResourceLocation LOCATION =
|
||||||
|
new ResourceLocation(Blocks.namespace,
|
||||||
|
"textures/gui/container/mailbox.png");
|
||||||
|
|
||||||
public ScreenMailbox(MenuMailbox handler, Inventory inventory, Component title) {
|
public ScreenMailbox(MenuMailbox handler, Inventory inventory, Component title) {
|
||||||
super(handler, inventory, title);
|
super(handler, inventory, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
|
||||||
|
this.renderBackground(matrices);
|
||||||
|
super.render(matrices, mouseX, mouseY, delta);
|
||||||
|
this.renderTooltip(matrices, mouseX, mouseY);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderBg(PoseStack matrices, float delta, int mouseX,
|
protected void renderBg(PoseStack matrices, float delta, int mouseX,
|
||||||
int mouseY) {
|
int mouseY) {
|
||||||
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
RenderSystem.setShaderTexture(0, LOCATION);
|
||||||
|
int i = (this.width - this.imageWidth) / 2;
|
||||||
|
int j = (this.height - this.imageHeight) / 2;
|
||||||
|
this.blit(matrices, i, j, 0, 0, this.imageWidth, this.imageHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Loading…
Reference in New Issue