Dieser Commit ist enthalten in:
Ursprung
dd5f16a279
Commit
e6c49ba3ef
@ -19,8 +19,6 @@ package de.zonlykroks.advancedscripts;
|
|||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
|
|
||||||
public class AdvancedScripts implements ClientModInitializer {
|
public class AdvancedScripts implements ClientModInitializer {
|
||||||
|
|
||||||
public static boolean isOnSteamwar = false;
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
This file is a part of the SteamWar software.
|
|
||||||
|
|
||||||
Copyright (C) 2020 SteamWar.de-Serverteam
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.zonlykroks.advancedscripts.mixin;
|
|
||||||
|
|
||||||
import de.zonlykroks.advancedscripts.AdvancedScripts;
|
|
||||||
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(ConnectScreen.class)
|
|
||||||
public class ConnectScreenMixin {
|
|
||||||
|
|
||||||
@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";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -6,7 +6,6 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"ConnectScreenMixin",
|
|
||||||
"KeyboardMixin"
|
"KeyboardMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren