Advertisement
HalestormXV

Untitled

Mar 21st, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. package halestormxv.gui;
  2.  
  3. import halestormxv.inventory.runeblade.ContainerRuneBlade;
  4. import halestormxv.utility.Reference;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.gui.inventory.GuiContainer;
  7. import net.minecraft.client.renderer.GlStateManager;
  8. import net.minecraft.entity.player.InventoryPlayer;
  9. import net.minecraft.util.EnumHand;
  10. import net.minecraft.util.ResourceLocation;
  11. import net.minecraftforge.items.IItemHandlerModifiable;
  12.  
  13. public class GuiRuneBlade extends GuiContainer
  14. {
  15.     private static final ResourceLocation texture = new ResourceLocation(Reference.MODID.toLowerCase(), "textures/gui/runeblade_slots.png");
  16.  
  17.     public GuiRuneBlade(InventoryPlayer invPlayer, EnumHand hand, IItemHandlerModifiable invBag)
  18.     {
  19.         /**
  20.          * When applying the actual size of the GUI you take the Bottom Right Corner of the image.
  21.          * This will allow you to obtain the proper X and Y coordinates for the actual GUI.
  22.          * The image will still always be a 256x256.
  23.          */
  24.         super(new ContainerRuneBlade(invPlayer, hand, invBag));
  25.         this.xSize = 175;
  26.         this.ySize = 164;
  27.     }
  28.  
  29.     @Override
  30.     protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)
  31.     {
  32.         GlStateManager.color(1, 1, 1, 1);
  33.         Minecraft.getMinecraft().renderEngine.bindTexture(texture);
  34.         this.drawTexturedModalRect((width - xSize) / 2, (height - ySize) / 2, 0, 0, xSize, ySize);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement