Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. package me.furt.dexutils.gui;
  2.  
  3. import java.io.IOException;
  4.  
  5. import net.minecraft.client.gui.GuiButton;
  6. import net.minecraft.client.gui.GuiScreen;
  7.  
  8. public class WaypointGui extends GuiScreen {
  9.  
  10.     private GuiButton a;
  11.     private GuiButton b;
  12.  
  13.     @Override
  14.     public void drawScreen(int mouseX, int mouseY, float partialTicks) {
  15.         //this.drawDefaultBackground();
  16.         super.drawScreen(mouseX, mouseY, partialTicks);
  17.     }
  18.    
  19.     @Override
  20.     public boolean doesGuiPauseGame() {
  21.         return false;
  22.     }
  23.    
  24.     public void initGui() {
  25.         this.buttonList.add(this.a = new GuiButton(0, this.width / 2 - 100, this.height / 2 - 24, "This is button a"));
  26.         this.buttonList.add(this.b = new GuiButton(1, this.width / 2 - 100, this.height / 2 + 4, "This is button b"));
  27.     }
  28.    
  29.     @Override
  30.     protected void actionPerformed(GuiButton button) throws IOException {
  31.         if (button == this.a) {
  32.             //Main.packetHandler.sendToServer(...);
  33.             this.mc.displayGuiScreen(null);
  34.             if (this.mc.currentScreen == null)
  35.                 this.mc.setIngameFocus();
  36.         }
  37.         if (button == this.b){
  38.             //Main.packetHandler.sendToServer(...);
  39.             this.mc.displayGuiScreen(null);
  40.             if (this.mc.currentScreen == null)
  41.                 this.mc.setIngameFocus();
  42.         }
  43.     }
  44.    
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement