Posted March 23, 20169 yr I am coding client mod which should only work (about 90% of it) only if server has proper mod. Please remind me - how do I check that? Would be awesome if I could have this boolean before EVERYTHING else (joining world (client), etc.) 1.7.10 is no longer supported by forge, you are on your own.
March 23, 20169 yr @NetworkCheckHandler is probably what you want. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 28, 20169 yr Author Okay after a break... So - while @NetworkCheckHandler is a nice tool to check if server, I am connecting to, has my mod (so I can disable (make if bool) all client-sided events if the server is not using mod) ...it is still not enough. I still need to figure out how to detect when you try to join Integrated server. Part on my CLIENT-ONLY mod: /** * Set to true if mod should be operational. * False cases: * - Client connected to integrated server. * - Client connected to server which doesn't have this mod. */ private static boolean OPERATIONAL; So yeah - @NetworkCheckHandler covers second "false case", but idk how to get 1st one before ANYTHING happens. Is there something NICE that is called before PlayerLoggedInEvent that would allow me to get "real" return from Minecraft.getMinecraft().isIntegratedServerRunning()? (by "real" I mean that apparently Integrated server is not really flushing. Meaning: If you would call it inside @NetworkCheckHandler it might or might not be true. Same goes for #getIntegratedServer() - it might or not return null or some instance (old one?). Awaiting 1.7.10 is no longer supported by forge, you are on your own.
March 28, 20169 yr FMLNetworkEvent.ClientConnectedToServerEvent is fired (on the Netty thread) when the client connects to a server. The FMLNetworkEvent.ClientConnectedToServerEvent#isLocal field will be true when the connection is local, i.e. the server is an integrated server and this client is the host. Minecraft#getCurrentServerData will return the current ServerData . ServerData#func_181041_d ( isOnLAN in recent mappings) will return true when the connection is to a LAN server (i.e. an integrated server hosted by a different client). Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
March 28, 20169 yr Author Yay, that should do it. I was literally looking for ClientConnectedToServerEvent, just didn't think of actually using search (it's inner class so after i couldn't find it I was like "maybe they removed it?"). That LAN thing will be also useful CLOSED 1.7.10 is no longer supported by forge, you are on your own.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.