Dieser Commit ist enthalten in:
Ursprung
7895f0f2c9
Commit
dd5f16a279
@ -17,19 +17,24 @@
|
||||
package de.zonlykroks.advancedscripts.mixin;
|
||||
|
||||
import de.zonlykroks.advancedscripts.AdvancedScripts;
|
||||
import net.minecraft.client.network.ClientLoginNetworkHandler;
|
||||
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ConnectScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.network.ServerAddress;
|
||||
import net.minecraft.client.network.ServerInfo;
|
||||
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ClientLoginNetworkHandler.class)
|
||||
public class ClientLoginNetworkHandlerMixin {
|
||||
@Mixin(ConnectScreen.class)
|
||||
public class ConnectScreenMixin {
|
||||
|
||||
@Inject(method = "onSuccess", at = @At("TAIL"))
|
||||
public void isOnSteamwar(LoginSuccessS2CPacket packet, CallbackInfo ci) {
|
||||
String adress = ((ClientLoginNetworkHandler) (Object)this).serverInfo.address;
|
||||
@Inject(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("TAIL"))
|
||||
private static void isOnSteamwar(Screen screen, MinecraftClient client, ServerAddress address, ServerInfo info, CallbackInfo ci) {
|
||||
String adress = address.getAddress();
|
||||
|
||||
AdvancedScripts.isOnSteamwar = adress == "steamwar.de" || adress == "78.31.71.136";
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
accessWidener v1 named
|
||||
|
||||
accessible field net/minecraft/client/network/ClientLoginNetworkHandler serverInfo Lnet/minecraft/client/network/ServerInfo;
|
||||
accessible field net/minecraft/client/network/ClientPlayNetworkHandler serverInfo Lnet/minecraft/client/network/ServerInfo;
|
||||
accessible field net/minecraft/client/Keyboard client Lnet/minecraft/client/MinecraftClient;
|
@ -6,7 +6,7 @@
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
"ClientLoginNetworkHandlerMixin",
|
||||
"ConnectScreenMixin",
|
||||
"KeyboardMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren