Fix Accidental Bug which causes Autoban
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
c5020eaef1
Commit
59884f9834
@ -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) {
|
||||||
ModSender.sendInformationPacket();
|
if(player == MinecraftClient.getInstance().player) {
|
||||||
|
ModSender.sendInformationPacket();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -6,7 +6,7 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"MixinClientPlayNetworkHandler"
|
"ClientWorldMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren