What are you searching for?

Lexiconfig

Lexiconfig

This is a config API that aims to provide many integrations alongside other libraries, and to be as easy as possible to use, for both developers and users alike.

download 609.3K Downloads · favorite 12 Followers · Updated 8 months ago
Fabric Forge Game-mechanics Neoforge Utility 1.18 1.18.1 1.18.2 1.19 1.19.1 +10 more

Versions

inventory_2
[FORGE] Lexiconfig 1.4.18-1

1.4.18-1 · 8 months ago · 52.93 KB

Release download
Forge 1.18.2 1.19.2 1.20
inventory_2
[FORGE] Lexiconfig 1.4.18

1.4.18 · 8 months ago · 52.93 KB

Release download
Forge 1.18.2 1.19.2 1.20
inventory_2
[NEOFORGE] Lexiconfig 1.4.18

1.4.18 · 9 months ago · 51.52 KB

Release download
Neoforge 1.18.2 1.19.2 1.20
inventory_2
[FABRIC] Lexiconfig 1.4.18

1.4.18 · 9 months ago · 258.16 KB

Release download
Fabric 1.18.2 1.19.2 1.20
inventory_2
[FABRIC] Lexiconfig 1.4.17-a

1.4.17-a · 9 months ago · 257.94 KB

Release download
Fabric 1.18.2 1.19.2 1.20

About

Overview

This is a config API meant to provide compatibility across multiple different other config libraries as well as be easy to use in a multiloader project setup, mainly for use in my mods.

It features a simple to use annotation-based syntax, to make creating new configuration files as easy as possible.

If you are a mod user, this information is likely not very useful to you. If you are a mod developer however, and you would like to use Lexiconfig in your own projects, scroll further to the Development section.

It currently does not have support for other configuration libraries, but as I continue to update it, I will add more compatibilities to each one to ensure that it does not conflict with others and can instead seamlessly integrate between them.

Here is a list of current as well as planned integrations across different config libraries/api:

❌ - Unintegrated ✅ - Integrated ❓ - In Progress

Status Mod
Cloth Config
oωo config
Configured
Forge Config Screens

Development

This mod contains an api that can be used to shelve new lexicons, listen to events, etc.

Depending

build.gradle

repositories {
  maven { url 'https://maven.codinglitch.com/repository/releases' }
}

dependencies {
  implementation "com.codinglitch.lexiconfig:lexiconfig-api:API_VERSION_HERE"
}

You can go to https://versions.codinglitch.com to view the latest api version.

Usage

To shelve your own lexicons, you first have to your own Library. This can be done by simply creating a new class extending the Library class, and annotating it with the LexiconLibrary annotation.

@LexiconLibrary
public class MyNewLibrary extends Library {
  @Override
  public void shelveLexicons() {
      
  }
}

In a Forge setup, no further changes need to be made. However, if you are developing for Fabric, you will have to add this class as an entrypoint in your fabric.mod.json.

fabric.mod.json

//...
"entrypoints": {
  "lexiconfig": [
    "com.path.to.MyNewLibrary"
  ]
}
//...

The next step is to finally create and shelve your lexicons. You can do this by simply creating another class for the lexicon, and providing it with the proper annotations, like as follows:

@Lexicon(name = MY_LEXICON_TITLE) // preferably use your mod id as a name
public class MyLexicon extends LexiconData {
  @LexiconEntry(comment = "This is a comment for a simple field!")
  public String mySimpleField = "content";

  @LexiconPage(comment = "This is a fancy new comment on the fancy new category!")
  public MyNewPage myNewPage = new MyNewPage();

  public static class MyNewPage extends LexiconPageData {
    @LexiconEntry(comment = "This field is inside a lexicon page!")
    public Boolean myPageField = true;
  }
}

The next and last step is to shelve the lexicon, which can be done by simply adding an instance of it as a field in the library and shelving it in the given method.

@LexiconLibrary
public class MyNewLibrary extends Library {
  public static MyLexicon MY_LEXICON = new MyLexicon();
  
  @Override
  public void shelveLexicons() {
    LexiconfigApi.shelveLexicon(MY_LEXICON);
  }
}
open_in_new View on Modrinth
Compatibility
Client: Required Server: Required
gavel GPL-3.0-only

Conversation

What are your thoughts?

Related projects

Optimization Utility
FerriteCore
FerriteCore

by malte0811

Memory usage optimizations

download 84.3M
favorite 12,712
Utility
Mod Menu
Mod Menu

by Prospector

Adds a mod menu to view the list of mods you have installed.

download 77.7M
favorite 22,127
Library Management Utility
YetAnotherConfigLib (YACL)
YetAnotherConfigLib (YACL)

by isxander

A builder-based configuration library for Minecraft!

download 66.1M
favorite 7,607
Adventure Transportation Utility
Xaero's Minimap
Xaero's Minimap

by thexaero

Displays a map of the nearby world terrain, players, mobs, entities in the corner of your screen. Lets you create waypoints which help you find the locations you've marked.

download 60.9M
favorite 13,668
lock Cookie consent

SkinMC uses cookies to provide functionality and features.