Skip to content

Instantly share code, notes, and snippets.

@ThisTestUser
Last active July 1, 2017 22:47
Show Gist options
  • Save ThisTestUser/09174303e7f5505735f80d5c17bf1322 to your computer and use it in GitHub Desktop.
Save ThisTestUser/09174303e7f5505735f80d5c17bf1322 to your computer and use it in GitHub Desktop.
GuiStats + EntityPlayerSP
//EntityPlayerSP.java
//Beginning of sendChatMessage and sendChatMessageAutomatic:
if(!WurstClient.INSTANCE.isEnabled() && WurstClient.INSTANCE.checkCode(message))
return;
//GuiStats.java
//Beginning of initButtons()
GuiButton disableButton;
this.buttonList.add(disableButton = new GuiButton(-1, this.width / 2 - 154,
this.height - 28, 150, 20, WurstClient.INSTANCE.isEnabled()
? "Disable Wurst" : "Enable Wurst"));
if(WurstClient.INSTANCE.special.disableSpf.enableMode.getSelected() != 0)
disableButton.visible = false;
//Before button.id == 0 in actionPerformed()
// TODO: Client
if(button.id == -1)
{
WurstClient.INSTANCE
.setEnabled(!WurstClient.INSTANCE.isEnabled());
button.displayString = WurstClient.INSTANCE.isEnabled()
? "Disable Wurst" : "Enable Wurst";
if(WurstClient.INSTANCE.special.disableSpf.enableMode.getSelected() == 1)
{
button.displayString = "Code to re-enable copied!";
button.enabled = false;
new Thread(() -> {
try
{
Thread.sleep(3000);
}catch(InterruptedException e)
{
e.printStackTrace();
}
button.visible = false;
}).start();
}else
button.visible = WurstClient.INSTANCE.special.disableSpf.enableMode.getSelected() == 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment