Configuration

Configuration

2M Downloads

The `Config` button isent working for my mod

zaze06 opened this issue ยท 5 comments

commented

So I have updated my mod to 1.17.1 and have implemented your Configuration library but the `config file is not enabled
I may have implemented stuff wrong but it's the same as 1.16. Hears the file

package me.alien.speedomiter;

import dev.toma.configuration.api.IConfigPlugin;
import dev.toma.configuration.api.IConfigWriter;
import dev.toma.configuration.api.type.BooleanType;
import dev.toma.configuration.api.type.ColorType;
import dev.toma.configuration.api.type.IntType;
import dev.toma.configuration.api.type.StringType;

@dev.toma.configuration.api.Config
public class Config implements IConfigPlugin {
    public static ColorType speedColor;
    public static IntType speedType;
    public static BooleanType useKnotInBoat;
    public static StringType xPos;
    public static StringType yPos;

    @Override
    public void buildConfig(IConfigWriter writer) {
        writer.writeString("Thx to user aqswde40 on curseforge for suggesting the idea of having this config", "");
        speedColor = writer.writeColorRGB("Color of your speed", "#10929e", "This is the color of the text that shows you your speed");
        speedType = writer.writeBoundedInt("Speed displacement type", 1, 1, 4, "1: Meter/s", "2: Blocks/s", "3: km/h", "4: mph");
        useKnotInBoat = writer.writeBoolean("Use knot when your in a boat", true, "If this is true when you ar in a boat the speed is displayed in knot");
        xPos = writer.writeString("X position of the speedometer", "W-70", "W = the width of the screen", "w = half the width of the screen");
        yPos = writer.writeString("Y position of the speedometer", "H-15", "H = the height of the screen", "h = half the height of the screen");
    }

    @Override
    public String getConfigFileName() {
        return "SpeedometerConfig";
    }

    @Override
    public String getModID() {
        return Main.MODID;
    }
}
commented

Note configuration mod is not in mod list when I run the client

commented

now its the new code so that should help

commented

I looked at your Speedometer github repository and it appears that you're missing dependency in your mods.toml file. You can take a look here https://github.com/Toma1O6/Guns-RPG/blob/1.16.5/src/main/resources/META-INF/mods.toml#L29 if you want an example implementation

commented

the github isent updated so the code is for 1.16 and its older then version 3.0 whits is the version I added the config

commented

You have set incorrect version range for the configuration it shouldn't even launch. Also setting it as CLIENT only is bad idea too. This is not an issue on the API end, so I'm going to close this issue.