Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void handleChat(Packet3Chat par1Packet3Chat)
- {
- String delims = "[<>]";
- String[] splits = par1Packet3Chat.message.split(delims,3);
- if(splits.length >= 2){
- if(splits[2].startsWith(" $pingmod-")){
- String[] pings = splits[2].split("-",3);
- for(int i =0; i < pings.length ; i++)
- System.out.println(pings[i]);
- if(splits[1].equalsIgnoreCase(this.mc.session.username)){
- if(pings.length != 3){
- this.mc.ingameGUI.getChatGUI().printChatMessage("§4 Your ping was malformed but we attempted to send it anyway");
- }
- else{
- this.mc.ingameGUI.getChatGUI().printChatMessage("§aYou just sent a ping to §b"+pings[1]+"§a saying §b"+pings[2]);
- mc.sndManager.playSoundFX("davidknag.notif", 1.0F, 1.0F);
- if(pings[1].equalsIgnoreCase(this.mc.session.username)){
- this.mc.ingameGUI.getChatGUI().printChatMessage("§dYou just received a Ping from yourself §dSaying: §b"+pings[2]);
- }
- }
- }else{
- System.out.println("["+this.mc.session.username+"] vs ["+splits[1]+"]");
- if(pings.length != 3){
- this.mc.ingameGUI.getChatGUI().printChatMessage("§b"+splits[1]+"§4 just attempted to send an improperly formatted ping.");
- this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);
- }
- else{
- if(pings[1].equalsIgnoreCase(this.mc.session.username)){
- mc.sndManager.playSoundFX("davidknag.notif", 1.0F, 1.0F);
- this.mc.ingameGUI.getChatGUI().printChatMessage("§dYou just received a Ping from §b"+splits[1]+" §dSaying: §b"+pings[2]);
- }
- else{
- this.mc.ingameGUI.getChatGUI().printChatMessage("§b"+splits[1]+"§a just sent a ping to §b"+pings[1]+"§a saying §b"+pings[2]);
- }
- }
- }
- }else{
- this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);
- ModLoader.clientChat(par1Packet3Chat.message);
- System.out.println(par1Packet3Chat.message);
- }
- }else{
- this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message);
- ModLoader.clientChat(par1Packet3Chat.message);
- System.out.println(par1Packet3Chat.message);
- }
- }
Add Comment
Please, Sign In to add comment