Skip to content

Commit

Permalink
Change target online mode message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenni0451 committed Jan 3, 2025
1 parent 18015eb commit 303c5b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/net/lenni0451/miniconnect/Main.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package net.lenni0451.miniconnect;

import net.lenni0451.miniconnect.proxy.StateRegistry;
import net.lenni0451.miniconnect.proxy.event.HAProxyEnableHandler;
import net.lenni0451.miniconnect.proxy.event.PacketHandlerRegistry;
import net.lenni0451.miniconnect.proxy.event.RedirectionHandler;
import net.lenni0451.miniconnect.proxy.event.ViaLoadHandler;
import net.lenni0451.miniconnect.proxy.event.*;
import net.lenni0451.miniconnect.server.LobbyServerInitializer;
import net.raphimc.netminecraft.netty.connection.NetServer;
import net.raphimc.viaproxy.ViaProxy;
Expand Down Expand Up @@ -46,6 +43,7 @@ public void onEnable() {
ViaProxy.EVENT_MANAGER.register(new PacketHandlerRegistry());
ViaProxy.EVENT_MANAGER.register(new ViaLoadHandler());
ViaProxy.EVENT_MANAGER.register(new HAProxyEnableHandler());
ViaProxy.EVENT_MANAGER.register(new OnlineModeHandler());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package net.lenni0451.miniconnect.proxy.event;

import net.lenni0451.lambdaevents.EventHandler;
import net.raphimc.viaproxy.plugins.events.JoinServerRequestEvent;

public class OnlineModeHandler {

@EventHandler(priority = Integer.MIN_VALUE)
public void onJoinServerRequest(final JoinServerRequestEvent event) {
if (event.isCancelled()) return;
event.getProxyConnection().kickClient("§cThe server is in online mode and requires authentication.\n§aPlease reconnect and authenticate by clicking on Login (key).");
}

}

0 comments on commit 303c5b4

Please sign in to comment.