summary refs log tree commit diff stats
path: root/src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java
blob: 187904d17bdfd9f12c30eaeeaf3e5bba81a8d36e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ganarchy.friendcode.mixin;

import ganarchy.friendcode.client.LanSendPing;
import net.minecraft.client.network.LanServerPinger;
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(LanServerPinger.class)
public class LanPingerMixin implements LanSendPing {
    @Inject(
        method = "run()V",
        remap = false,
        at = @At(
            remap = false,
            value = "INVOKE",
            target = "Ljava/net/InetAddress;getByName(Ljava/lang/String;)Ljava/net/InetAddress;"
        )
    )
    public void onSendPing(CallbackInfo info) {
        this.friendcodeSendPing();
    }

    @Override
    public void friendcodeSendPing() {

    }
}