I want my mod to be compatible with vanilla servers. As such, my mod will need to behave differently on vanilla servers. How can I check what type of server the client is connected to?
If you subscribe to ClientConnectedToServerEvent, ClientConnectedToServerEvent#getConnectionType will return the connection type.
This will be the name of an NetworkDispatcher.ConnectionType enum value, i.e. "MODDED", "BUKKIT" or "VANILLA".
Note that all sub-events of FMLNetworkEvent are fired on the Netty thread rather than the main client/server thread, so you need to use IThreadListener#addScheduledTask to schedule a task on the main thread before interacting with normal Minecraft classes.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I want my mod to be compatible with vanilla servers. As such, my mod will need to behave differently on vanilla servers. How can I check what type of server the client is connected to?
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้
If you subscribe to ClientConnectedToServerEvent, ClientConnectedToServerEvent#getConnectionType will return the connection type.
This will be the name of an NetworkDispatcher.ConnectionType enum value, i.e. "MODDED", "BUKKIT" or "VANILLA".
Note that all sub-events of FMLNetworkEvent are fired on the Netty thread rather than the main client/server thread, so you need to use IThreadListener#addScheduledTask to schedule a task on the main thread before interacting with normal Minecraft classes.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks : )
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้