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

Datei anzeigen

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