lilgallon / Bettercolors

⚔️ Minecraft assistance mod built with Forge AND Fabric. For MC 1.8.9, 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.x, 1.17.X, 1.18.X, 1.19.X
Apache License 2.0
39 stars 2 forks source link

Feature: Prevent sending ModID to server #28

Closed nezuky closed 4 years ago

nezuky commented 4 years ago

When a Forge client connects to a server, the client sends a ModList packet containing all it's ModID's.

This means a server could be setup to insta-ban players when it receives data that a client has the Bettercolors mod.

Solutions are modifying Forge to not send this packet, setting the ModID and Version to that of a different allowed mod (WorldEdit/Optifine), or possibly setting the ModID as null to prevent this packet.

Could you do anything mod wise to fix this?

 public ModList(List<ModContainer> modList)
        {
            for (ModContainer mod : modList)
            {
                modTags.put(mod.getModId(), mod.getVersion());
            }
        }

ModList Packet: https://wiki.vg/Minecraft_Forge_Handshake#ModList

ModList FML code: https://github.com/MinecraftForge/MinecraftForge/blob/ebe9b6d4cbc4a5281c386994f1fbda04df5d2e1f/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeMessage.java#L96-L152

lilgallon commented 4 years ago

I did not know about that. Thank you for sharing! I will try to fix it as soon as possible, it is on my top priority now.

It sounds like you know a lot of things about MC mods. If you want to contribute, make sure to tell me so that I don't work on the same thing! :) Even a small contribution is really appreciated!

lilgallon commented 4 years ago

I found a way to fix it. Since Minecraft 1.13.2, forge renamed MCP's modid from mcp to minecraft. I think that we can trick the servers by using the modid mcp. We will use the same logic for Bettercolors MC1.8.9, but with the modid minecraft.