Guest User

Untitled

a guest
Nov 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.32 KB | None | 0 0
  1.  public void handleChat(Packet3Chat par1Packet3Chat)
  2.     {
  3.         String delims = "[<>]";
  4.         String[] splits = par1Packet3Chat.message.split(delims,3);
  5.         if(splits.length >= 2){
  6.                 if(splits[2].startsWith(" $pingmod-")){
  7.                 String[] pings = splits[2].split("-",3);
  8.                 for(int i =0; i < pings.length ; i++)
  9.                     System.out.println(pings[i]);
  10.                 if(splits[1].equalsIgnoreCase(this.mc.session.username)){
  11.                     if(pings.length != 3){
  12.                         this.mc.ingameGUI.getChatGUI().printChatMessage("§4 Your ping was malformed but we attempted to send it anyway");
  13.                     }
  14.                         else{
  15.                         this.mc.ingameGUI.getChatGUI().printChatMessage("§aYou just sent a ping to §b"+pings[1]+"§a saying §b"+pings[2]);
  16.                         mc.sndManager.playSoundFX("davidknag.notif", 1.0F, 1.0F);
  17.                         if(pings[1].equalsIgnoreCase(this.mc.session.username)){
  18.                             this.mc.ingameGUI.getChatGUI().printChatMessage("§dYou just received a Ping from yourself §dSaying: §b"+pings[2]);
  19.                         }
  20.                     }
  21.                 }else{
  22.                     System.out.println("["+this.mc.session.username+"] vs ["+splits[1]+"]");
  23.                     if(pings.length != 3){
  24.                         this.mc.ingameGUI.getChatGUI().printChatMessage("§b"+splits[1]+"§4 just attempted to send an improperly formatted ping.");
  25.                         this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);                  
  26.                         }
  27.                         else{
  28.                             if(pings[1].equalsIgnoreCase(this.mc.session.username)){
  29.                                 mc.sndManager.playSoundFX("davidknag.notif", 1.0F, 1.0F);
  30.                                 this.mc.ingameGUI.getChatGUI().printChatMessage("§dYou just received a Ping from §b"+splits[1]+" §dSaying: §b"+pings[2]);
  31.                             }
  32.                         else{
  33.                         this.mc.ingameGUI.getChatGUI().printChatMessage("§b"+splits[1]+"§a just sent a ping to §b"+pings[1]+"§a saying §b"+pings[2]);
  34.                     }
  35.                         }
  36.                 }
  37.                 }else{
  38.                  this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);
  39.                     ModLoader.clientChat(par1Packet3Chat.message);
  40.                     System.out.println(par1Packet3Chat.message);
  41.                 }
  42.             }else{
  43.                  this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);
  44.                     ModLoader.clientChat(par1Packet3Chat.message);
  45.                     System.out.println(par1Packet3Chat.message);
  46.                     }
  47.             }
Add Comment
Please, Sign In to add comment