Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cclloyd.ccmodpack;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.inventory.GuiContainer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.entity.player.InventoryPlayer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class WirelessChestGuiContainer extends GuiContainer {
- /**
- * GuiInventoryBasic is a simple gui that does nothing but draw a background image and a line of text on the screen
- * everything else is handled by the vanilla container code
- */
- private static final ResourceLocation texture = new ResourceLocation("ccmodpack", "textures/gui/container/wirelessChest.png");
- private WirelessChestEntity wirelessChestEntity;
- public WirelessChestGuiContainer(InventoryPlayer invPlayer, WirelessChestEntity tile) {
- super(new WirelessChestContainer(invPlayer, tile));
- wirelessChestEntity = tile;
- // Set the width and height of the gui. Should match the size of the texture!
- xSize = 176;
- ySize = 184;
- this.xSize = 176;
- this.ySize = 184;
- }
- // draw the background for the GUI - rendered first
- @Override
- protected void drawGuiContainerBackgroundLayer(float partialTicks, int x, int y) {
- // Bind the image texture of our custom container
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- // Draw the image
- GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
- drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- }
- // draw the foreground for the GUI - rendered after the slots, but before the dragged items and tooltips
- // renders relative to the top left corner of the background
- @Override
- protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
- //final int LABEL_XPOS = 5;
- //final int LABEL_YPOS = 5;
- //fontRendererObj.drawString(wirelessChestEntity.getDisplayName().getUnformattedText(), LABEL_XPOS, LABEL_YPOS, Color.darkGray.getRGB());
- this.buttonList.add(new GuiButton(1, this.width / 2 - 20, 18, 40, 20, "-1000"));
- this.buttonList.add(new GuiButton(2, this.height / 2 + 20, 18, 40, 20, "+1000"));
- }
- @Override
- protected void actionPerformed(GuiButton button) {
- if(button.id==1){
- WirelessChestChangeFrequencyGuiScreen wirelessChestChangeFrequencyScreen = new WirelessChestChangeFrequencyGuiScreen();
- this.mc.displayGuiScreen((WirelessChestChangeFrequencyGuiScreen)wirelessChestChangeFrequencyScreen);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment