Search in sources :

Example 6 with MultiplayerScreen

use of net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen in project Client by MatHax.

the class MultiplayerScreenMixin method onInit.

@Inject(method = "init", at = @At("TAIL"))
private void onInit(CallbackInfo info) {
    Version.UpdateChecker.checkForLatest = true;
    addDrawableChild(new ButtonWidget(width - 77, 2, 75, 20, new LiteralText("Accounts"), button -> client.setScreen(GuiThemes.get().accountsScreen())));
    addDrawableChild(new ButtonWidget(width - 154, 2, 75, 20, new LiteralText("Proxies"), button -> client.setScreen(GuiThemes.get().proxiesScreen())));
    addDrawableChild(new ButtonWidget(width - 231, 2, 75, 20, new LiteralText("Servers"), button -> client.setScreen(new ServerManagerScreen(GuiThemes.get(), (MultiplayerScreen) client.currentScreen))));
    if (LastServerInfo.getLastServer() != null)
        addDrawableChild(new ButtonWidget(width / 2 - 154, 10, 100, 20, new LiteralText("Last Server"), button -> LastServerInfo.reconnect(client.currentScreen)));
}
Also used : LiteralText(net.minecraft.text.LiteralText) Inject(org.spongepowered.asm.mixin.injection.Inject) IMultiplayerScreen(mathax.client.mixininterface.IMultiplayerScreen) Color(mathax.client.utils.render.color.Color) Version(mathax.client.utils.Version) ServerInfo(net.minecraft.client.network.ServerInfo) CallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInfo) Mixin(org.spongepowered.asm.mixin.Mixin) Proxies(mathax.client.systems.proxies.Proxies) NameProtect(mathax.client.systems.modules.misc.NameProtect) LastServerInfo(mathax.client.utils.misc.LastServerInfo) At(org.spongepowered.asm.mixin.injection.At) Utils(mathax.client.utils.Utils) MatHax(mathax.client.MatHax) Proxy(mathax.client.systems.proxies.Proxy) GuiThemes(mathax.client.gui.GuiThemes) MultiplayerServerListWidget(net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget) MatrixStack(net.minecraft.client.util.math.MatrixStack) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget) Screen(net.minecraft.client.gui.screen.Screen) ServerManagerScreen(mathax.client.gui.screens.servermanager.ServerManagerScreen) MultiplayerScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen) Modules(mathax.client.systems.modules.Modules) Shadow(org.spongepowered.asm.mixin.Shadow) Text(net.minecraft.text.Text) IMultiplayerScreen(mathax.client.mixininterface.IMultiplayerScreen) MultiplayerScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen) ServerManagerScreen(mathax.client.gui.screens.servermanager.ServerManagerScreen) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget) LiteralText(net.minecraft.text.LiteralText) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

MultiplayerScreen (net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen)6 TitleScreen (net.minecraft.client.gui.screen.TitleScreen)3 SelectWorldScreen (net.minecraft.client.gui.screen.world.SelectWorldScreen)3 LiteralText (net.minecraft.text.LiteralText)3 Screen (net.minecraft.client.gui.screen.Screen)2 OptionsScreen (net.minecraft.client.gui.screen.option.OptionsScreen)2 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)2 RealmsMainScreen (net.minecraft.client.realms.gui.screen.RealmsMainScreen)2 MatrixStack (net.minecraft.client.util.math.MatrixStack)2 TranslatableText (net.minecraft.text.TranslatableText)2 Inject (org.spongepowered.asm.mixin.injection.Inject)2 JsonObject (com.google.gson.JsonObject)1 JsonPrimitive (com.google.gson.JsonPrimitive)1 EventTick (dev.hypnotic.event.events.EventTick)1 DiscordRPCModule (dev.hypnotic.module.misc.DiscordRPCModule)1 HypnoticMainMenu (dev.hypnotic.ui.HypnoticMainMenu)1 BodyHandlers (java.net.http.HttpResponse.BodyHandlers)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 List (java.util.List)1