Skip to content

Instantly share code, notes, and snippets.

@mooman219
Created June 11, 2013 22:58
Show Gist options
  • Save mooman219/5761512 to your computer and use it in GitHub Desktop.
Save mooman219/5761512 to your computer and use it in GitHub Desktop.
public void sendChatMessage(String par1Str)
{
if(par1Str.length() > 7 && par1Str.substring(0, 6).equalsIgnoreCase("/shard")) {
int slot = 0;
try {
slot = Integer.parseInt(par1Str.charAt(7) + "");
} catch(Exception e) {}
this.sendQueue.addToSendQueue(new Packet3Chat("/shard"));
this.sendQueue.addToSendQueue(new Packet3Chat("/suicide"));
sleep(4L);
this.sendQueue.addToSendQueue(new Packet102WindowClick(1, slot, 0, 0, new ItemStack(35, 1, 0), (short) 1));
sleep(2L);
this.sendQueue.addToSendQueue(new Packet3Chat("confirm"));
} else {
this.sendQueue.addToSendQueue(new Packet3Chat(par1Str));
}
}
public void sleep(long time) {
try {
Thread.sleep(time);
} catch(InterruptedException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment