MrNerdy42 / keywizard-legacy

A simple Minecraft mod that makes finding and fixing key conflicts easier.
https://www.curseforge.com/minecraft/mc-mods/keyboard-wizard
Other
5 stars 3 forks source link

Please mark mod as client side only. #1

Closed Claycorp closed 7 years ago

Claycorp commented 7 years ago

Mark the mod as client side only please, Thanks.

MrNerdy42 commented 7 years ago

Do you mean in the description or the code itself? I can certainly put it in the readme, but there's no way that I know of to do it in code.

Claycorp commented 7 years ago

in your @mod you need to put @Side.CLIENT or something of the sorts, I don't have anything on hand to know exactly what it is. Then it won't load on servers and cause crashes making it easier to use and gives less issues for you.

MrNerdy42 commented 7 years ago

Adding a @SideOnly(Side.CLIENT) annotation to the main mod class does not prevent the mod from being run on (and subsequently crashing) a server. I don't know of any other way prevent my code from running on a dedicated server.

dries007 commented 7 years ago

Depending on the Forge version you can specify it in the Main Mod annotation, with @Mod(clientSideOnly = true) or, if that's not available, use the manifest by adding this to your build.gradle:

jar {
    manifest {
        attributes 'ModSide': 'CLIENT'
    }
}
MrNerdy42 commented 7 years ago

Thanks, @Mod(clientSideOnly = true) works perfectly.