Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.konarjg.arcticraft.blocks.tileentities.gui;
- import com.konarjg.arcticraft.init.ModBlocks;
- import com.konarjg.arcticraft.util.Reference;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.util.ResourceLocation;
- public class GuiBarrel extends GuiContainer {
- private InventoryPlayer playerInv;
- private static final ResourceLocation BG_TEXTURE = new ResourceLocation(Reference.MOD_ID, "textures/gui/barrel.png");
- public GuiBarrel(Container inventorySlotsIn, InventoryPlayer playerInv) {
- super(inventorySlotsIn);
- this.playerInv = playerInv;
- }
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
- GlStateManager.color(1, 1, 1, 1);
- mc.getTextureManager().bindTexture(BG_TEXTURE);
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- }
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- String name = I18n.format(ModBlocks.BARREL.getUnlocalizedName() + ".name");
- fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 10, 0x404040);
- fontRenderer.drawString(playerInv.getDisplayName().getUnformattedText(), 8, ySize - 94, 0x404040);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment