diff options
Diffstat (limited to 'src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java')
-rw-r--r-- | src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java b/src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java new file mode 100644 index 0000000..187904d --- /dev/null +++ b/src/main/java/ganarchy/friendcode/mixin/LanPingerMixin.java @@ -0,0 +1,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() { + + } +} |