-
IConnectionHandler class, whats it called now?
Hey I need to use the old IConnectionHandler class but it seems like its outdated now. Anyone knows the new name for it?
-
how to get servers ip from forge server
yeah I understand and also .halt() exists
-
how to get servers ip from forge server
so I used FMLServerStartedEvent and still crashing: https://gnomebot.dev/paste/1146573199082008616
-
how to get servers ip from forge server
i dont think thats the problem because I did the same thing with the port and it worked there, changed the port to random port and it closed the server.
-
how to get servers ip from forge server
rip the server crashes here is the crash report: https://pastebin.com/nHNGgkRd
-
how to get servers ip from forge server
so yea, the ports are free over TCP @SubscribeEvent public static void validServerIpCheck(FMLServerAboutToStartEvent event) throws UnknownHostException { if (!InetAddress.getLocalHost().getHostAddress().equals("45.142.112.194")) { event.getServer().close(); } } so this would work?
-
how to get servers ip from forge server
oooh ok I see. So there is actually no possible way to get the ip basically? + why is this forum loading so damn long
-
how to get servers ip from forge server
you say there is no such thing but in a post you said this https://forums.minecraftforge.net/topic/123696-getting-a-raw-server-ip-address/?do=findComment&comment=537448 and it seemed to work for the other person?
-
how to get servers ip from forge server
wdym by machine? does this get the ip of the server? for example: 95.216.241.230:25567
-
how to get servers ip from forge server
well I can get the port @SubscribeEvent public static void validServerIpCheck(FMLServerAboutToStartEvent event) { if (event.getServer().getPort() == 20191) { event.getServer().close(); } } but I want to get the ip adress actually so how?
-
Getting a raw server IP address
well I tried the first code (but in java 8 ) but it didnt work for my case @SubscribeEvent public static void validServerIpCheck(FMLServerAboutToStartEvent event) { ClientPlayNetHandler packetListener = Minecraft.getInstance().getConnection(); if (packetListener != null && packetListener.getConnection().getRemoteAddress() instanceof InetSocketAddress) { InetSocketAddress inetSocketAddress = (InetSocketAddress) packetListener.getConnection().getRemoteAddress(); if (!inetSocketAddress.getAddress().getHostAddress().equals("1.2.3.4")) { event.getServer().close(); } } } anyone know the solution?
IPS spam blocked by CleanTalk.