-
Notifications
You must be signed in to change notification settings - Fork 0
/
AHServerEventHandler.java
35 lines (26 loc) · 1.25 KB
/
AHServerEventHandler.java
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
30
31
32
33
34
35
package org.auioc.mcmod.arnicalib.server.event;
import static org.auioc.mcmod.arnicalib.ArnicaLib.LOGGER;
import org.apache.logging.log4j.Marker;
import org.auioc.mcmod.arnicalib.base.log.LogUtil;
import org.auioc.mcmod.arnicalib.mod.server.command.AHServerCommands;
import org.auioc.mcmod.arnicalib.server.event.impl.ServerLoginEvent;
import net.minecraft.network.ConnectionProtocol;
import net.minecraftforge.event.RegisterCommandsEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
public final class AHServerEventHandler {
private static final Marker MARKER = LogUtil.getMarker("ServerHooks");
@SubscribeEvent
public static void registerCommands(final RegisterCommandsEvent event) {
AHServerCommands.register(event.getDispatcher());
}
private static final Marker SERVER_LIST_PING_MARKER = LogUtil.getMarker("ServerListPing").addParents(MARKER);
@SubscribeEvent
public static void onServerLogin(final ServerLoginEvent event) {
if (event.getPacket().getIntention() == ConnectionProtocol.STATUS) {
LOGGER.info(
SERVER_LIST_PING_MARKER,
String.format("[%s] <-> InitialHandler has pinged", event.getNetworkManager().getRemoteAddress())
);
}
}
}