Fix Accidental Bug which causes Autoban
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
zOnlyKroks 2022-04-27 18:01:28 +02:00
Ursprung c5020eaef1
Commit 59884f9834
2 geänderte Dateien mit 11 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -16,19 +16,22 @@
package de.steamwar.modsender.mixin;
import de.steamwar.modsender.ModSender;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
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(ClientPlayNetworkHandler.class)
public class MixinClientPlayNetworkHandler {
@Mixin(ClientWorld.class)
public class ClientWorldMixin {
@Inject(at = @At("TAIL"), method = "onGameJoin")
private void connect(GameJoinS2CPacket packet, CallbackInfo ci) {
ModSender.sendInformationPacket();
@Inject(at = @At("HEAD"), method = "addPlayer")
private void onAddPlayer(int id, AbstractClientPlayerEntity player, CallbackInfo ci) {
if(player == MinecraftClient.getInstance().player) {
ModSender.sendInformationPacket();
}
}
}

Datei anzeigen

@ -6,7 +6,7 @@
"mixins": [
],
"client": [
"MixinClientPlayNetworkHandler"
"ClientWorldMixin"
],
"injectors": {
"defaultRequire": 1