Merge pull request #5 from lixfel/chaoscaot/1.19.3
AltAuth 1.19.3 Support
Dieser Commit ist enthalten in:
Commit
0a91d72fc7
@ -10,6 +10,8 @@ import net.minecraft.client.gui.widget.ButtonWidget;
|
|||||||
import net.minecraft.screen.ScreenTexts;
|
import net.minecraft.screen.ScreenTexts;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class TrustServerScreen extends ConfirmScreen {
|
public class TrustServerScreen extends ConfirmScreen {
|
||||||
private static final Text FORCE_MOJANG = Text.translatable("gui.altauth.confirm.force_mojang");
|
private static final Text FORCE_MOJANG = Text.translatable("gui.altauth.confirm.force_mojang");
|
||||||
private static final Text TRUST_ONCE = Text.translatable("gui.altauth.confirm.once");
|
private static final Text TRUST_ONCE = Text.translatable("gui.altauth.confirm.once");
|
||||||
@ -25,24 +27,22 @@ public class TrustServerScreen extends ConfirmScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addButtons(int y) {
|
protected void addButtons(int y) {
|
||||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, y, 150, 20, this.yesText, (button) -> {
|
this.addDrawableChild(ButtonWidget.builder(this.yesText, button -> {
|
||||||
ClientConfig.INSTANCE.allowedServers.add(server);
|
ClientConfig.INSTANCE.allowedServers.add(server);
|
||||||
ClientConfig.INSTANCE.save();
|
ClientConfig.INSTANCE.save();
|
||||||
|
|
||||||
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
||||||
}));
|
}).dimensions(this.width / 2 - 155, y, 150, 20).build());
|
||||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, y, 150, 20, FORCE_MOJANG, (button) -> {
|
this.addDrawableChild(ButtonWidget.builder(FORCE_MOJANG, button -> {
|
||||||
ClientConfig.INSTANCE.forcedMojang.add(AltAuth.address.getAddress());
|
ClientConfig.INSTANCE.forcedMojang.add(AltAuth.address.getAddress());
|
||||||
ClientConfig.INSTANCE.save();
|
ClientConfig.INSTANCE.save();
|
||||||
|
|
||||||
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
||||||
}));
|
}).dimensions(this.width / 2 + 5, y, 150, 20).build());
|
||||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, y + 25, 150, 20, TRUST_ONCE, (button) -> {
|
this.addDrawableChild(ButtonWidget.builder(TRUST_ONCE, button -> {
|
||||||
AltAuth.trustOnce = true;
|
AltAuth.trustOnce = true;
|
||||||
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
ConnectScreen.connect(parent, client, AltAuth.address, null);
|
||||||
}));
|
}).dimensions(this.width / 2 - 155, y + 25, 150, 20).build());
|
||||||
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, y + 25, 150, 20, this.noText, (button) -> {
|
this.addDrawableChild(ButtonWidget.builder(this.noText, button -> client.setScreen(parent)).dimensions(this.width / 2 + 5, y + 25, 150, 20).build());
|
||||||
client.setScreen(parent);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.ModifyArg;
|
|||||||
@Mixin(ConnectScreen.class)
|
@Mixin(ConnectScreen.class)
|
||||||
public class ConnectScreenMixin {
|
public class ConnectScreenMixin {
|
||||||
|
|
||||||
@ModifyArg(method = "connect(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;Lnet/minecraft/client/network/ServerInfo;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ConnectScreen;connect(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;)V"), index = 1)
|
@ModifyArg(method = "connect(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;Lnet/minecraft/client/network/ServerInfo;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ConnectScreen;connect(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;Lnet/minecraft/client/network/ServerInfo;)V"), index = 1)
|
||||||
private static ServerAddress copyServerAddress(ServerAddress address) {
|
private static ServerAddress copyServerAddress(ServerAddress address) {
|
||||||
AltAuth.address = address;
|
AltAuth.address = address;
|
||||||
return address;
|
return address;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
|
|
||||||
minecraft_version=1.19.2
|
minecraft_version=1.19.3
|
||||||
yarn_mappings=1.19.2+build.4
|
yarn_mappings=1.19.3+build.2
|
||||||
loader_version=0.14.9
|
loader_version=0.14.11
|
||||||
|
|
||||||
version=1.0.0
|
version=1.0.0
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren