net.minecraft.client.gui.screen.ConnectScreen Java Examples

The following examples show how to use net.minecraft.client.gui.screen.ConnectScreen. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void init() {
	super.init();
	reconnectTime = System.currentTimeMillis();
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 35, 200, 20, "Reconnect", (button) -> {
		if (server != null) minecraft.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), minecraft, server));
    }));
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 57, 200, 20,
			(getSettings().get(0).toToggle().state ? "§a" : "§c") + "AutoReconnect ["
					+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
					+ "]", (button) -> {
        getSettings().get(0).toToggle().state = !getSettings().get(0).toToggle().state;
        reconnectTime = System.currentTimeMillis();
    }));
}
 
Example #2
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void render(int int_1, int int_2, float float_1) {
	super.render(int_1, int_2, float_1);
	
	buttons.get(2).setMessage((getSettings().get(0).toToggle().state ? "§aAutoReconnect ["
			+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
			+ "]" : "§cAutoReconnect [" + getSettings().get(1).toSlider().getValue() * 1000 + "]"));
	
	if (reconnectTime + getSettings().get(1).toSlider().getValue() * 1000 < System.currentTimeMillis() && getSettings().get(0).toToggle().state) {
		if (server != null) minecraft.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), minecraft, server));
		reconnectTime = System.currentTimeMillis();
	}
}
 
Example #3
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void init() {
	super.init();
	reconnectTime = System.currentTimeMillis();
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 35, 200, 20, new LiteralText("Reconnect"), (button) -> {
		if (server != null) client.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), client, server));
    }));
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 57, 200, 20,
			new LiteralText((getSettings().get(0).toToggle().state ? "\u00a7a" : "\u00a7c") + "AutoReconnect ["
					+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
					+ "]"), (button) -> {
        getSettings().get(0).toToggle().state = !getSettings().get(0).toToggle().state;
        reconnectTime = System.currentTimeMillis();
    }));
}
 
Example #4
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void render(MatrixStack matrix, int mouseX, int mouseY, float delta) {
	super.render(matrix, mouseX, mouseY, delta);
	
	buttons.get(2).setMessage(new LiteralText((getSettings().get(0).toToggle().state ? "\u00a7aAutoReconnect ["
			+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
			+ "]" : "\u00a7cAutoReconnect [" + getSettings().get(1).toSlider().getValue() * 1000 + "]")));
	
	if (reconnectTime + getSettings().get(1).toSlider().getValue() * 1000 < System.currentTimeMillis() && getSettings().get(0).toToggle().state) {
		if (server != null) client.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), client, server));
		reconnectTime = System.currentTimeMillis();
	}
}
 
Example #5
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void init() {
	super.init();
	reconnectTime = System.currentTimeMillis();
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 35, 200, 20, "Reconnect", (button) -> {
		if (server != null) minecraft.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), minecraft, server));
    }));
	addButton(new ButtonWidget(width / 2 - 100, height / 2 + reasonH / 2 + 57, 200, 20,
			(getSettings().get(0).toToggle().state ? "§a" : "§c") + "AutoReconnect ["
					+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
					+ "]", (button) -> {
        getSettings().get(0).toToggle().state = !getSettings().get(0).toToggle().state;
        reconnectTime = System.currentTimeMillis();
    }));
}
 
Example #6
Source File: AutoReconnect.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
public void render(int int_1, int int_2, float float_1) {
	super.render(int_1, int_2, float_1);
	
	buttons.get(2).setMessage((getSettings().get(0).toToggle().state ? "§aAutoReconnect ["
			+ ((reconnectTime + getSettings().get(1).toSlider().getValue() * 1000) - System.currentTimeMillis())
			+ "]" : "§cAutoReconnect [" + getSettings().get(1).toSlider().getValue() * 1000 + "]"));
	
	if (reconnectTime + getSettings().get(1).toSlider().getValue() * 1000 < System.currentTimeMillis() && getSettings().get(0).toToggle().state) {
		if (server != null) minecraft.openScreen(new ConnectScreen(new MultiplayerScreen(new TitleScreen()), minecraft, server));
		reconnectTime = System.currentTimeMillis();
	}
}