TurtyWurty

DisplayCaseScreen.java

Mar 9th, 2021
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.49 KB | None | 0 0
  1. public class DisplayCaseScreen extends ContainerScreen<DisplayCaseContainer> {
  2.     private static final ResourceLocation DISPLAY_CASE_GUI = new ResourceLocation(GuiWork.MOD_ID, "textures/gui/display_case.png");
  3.    
  4.     public DisplayCaseScreen(DisplayCaseContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
  5.         super(screenContainer, inv, titleIn);
  6.         this.guiLeft = 0;
  7.         this.guiTop = 0;
  8.         this.xSize = 175;
  9.         this.ySize = 201;
  10.     }
  11.  
  12.     @Override
  13.     public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
  14.         this.renderBackground(matrixStack);
  15.         super.render(matrixStack, mouseX, mouseY, partialTicks);
  16.         this.renderHoveredTooltip(matrixStack, mouseX, mouseY);
  17.     }
  18.  
  19.     @SuppressWarnings("deprecation")
  20.     @Override
  21.     protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
  22.         RenderSystem.color4f(1f, 1f, 1f, 1f);
  23.         this.minecraft.getTextureManager().bindTexture(DISPLAY_CASE_GUI);
  24.         this.blit(matrixStack, (this.width - this.xSize) / 2, (this.height - this.ySize) / 2, 0, 0, this.xSize, this.ySize);
  25.     }
  26.  
  27.     @Override
  28.     protected void drawGuiContainerForegroundLayer(MatrixStack matrixStack, int mouseX, int mouseY) {
  29.         this.font.func_243248_b(matrixStack, this.playerInventory.getDisplayName(), (float) this.playerInventoryTitleX, (float) this.playerInventoryTitleY, 4210752);
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment