spenk

Untitled

Apr 15th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import net.minecraft.client.Minecraft;
  4.  
  5. public class mod_CustomGui extends BaseMod{
  6.    
  7.     private Minecraft minecraft;
  8.     private mod_CustomGui instance;
  9.     private ModLoader loader;
  10.  
  11.     public String getVersion(){
  12.     return "1.2.5";
  13.     }
  14.  
  15.     public void load(){
  16.     loader.setInGameHook(this, true, true);
  17.     loader.setInGUIHook(this, true, true);
  18.     loader.registerPacketChannel(this, "CustomGui");
  19.     }
  20.  
  21.     public void openGui(EntityPlayer player){
  22.     loader.openGUI(player, new CustomGuiScreen(player.worldObj, minecraft, player));
  23.     }
  24.    
  25.     public void HandlePacket(Packet250CustomPayload packet)
  26.     {
  27.         if (!packet.channel.equals("CustomGui")) return;
  28.         String[] data = new String(packet.data).split(":");
  29.         String command = data[0];
  30.         if (command.equalsIgnoreCase("OpenGui")){
  31.             this.openGui(minecraft.thePlayer);
  32.         }
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment