Advertisement
ViiRuS

Basic Gui Template/Block File Code Snippet

Dec 18th, 2011
4,202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. Basic Gui File:
  2.  
  3. package net.minecraft.src;
  4.  
  5. import java.awt.image.BufferedImage;
  6. import org.lwjgl.opengl.GL11;
  7.  
  8. public class GuiWhatever extends GuiScreen {
  9.     public GuiWhatever()
  10.     {
  11.     }
  12.    
  13.     public void initGui() {
  14.         controlList.clear();
  15.     }
  16.  
  17.     public boolean doesGuiPauseGame()
  18.     {
  19.         return false;
  20.     }
  21.    
  22.     public void onGuiClosed()
  23.     {
  24.    
  25.     }
  26.    
  27.     public void drawScreen(int i, int j, float f)
  28.     {
  29.         drawDefaultBackground();
  30.         drawGradientRect(20, 20, width - 20, height - 20, 0x60500000, 0xa0803030);
  31.         drawRect(60, 60, width - 60, height - 60, 0xFF0000FF);
  32.         drawCenteredString(fontRenderer, "Random", width / 2, 45, 0xffffff);
  33.         super.drawScreen(i, j, f);
  34.     }
  35.  
  36. }
  37.  
  38. ---------------------------------------------------------------------------
  39. Block File Code Snippet:
  40.  
  41. public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
  42.     {
  43.     ModLoader.OpenGUI(entityplayer, new GuiWhatever());
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement