HomeJavaModsJEJ
JEJ
ModsJava

JEJ

by duckerahiruquack · on Modrinth

This is a config mod created by a Japanese developer (including an AI assistant), dedicated to all Japanese players!

⬇ Download on Modrinth

JEJ - Just Enough Japanese Config

This mod is a configuration modification mod created by a Japanese developer (including an Artificial Intelligence assistant)! It works just like any traditional config mod, but hey, please look forward to what's coming next!

Current Features


Technical Mechanics (For those who want to modify the code)

Below is the core implementation code showing how this mod operates behind the scenes.

View Java Source Code (Click to expand)

This mod utilizes the NightConfig library to dynamically load and process Minecraft Forge configuration nodes. Below is the core implementation showing how the mod processes configuration categories in order and safely extracts value specifications.

import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.common.ForgeConfigSpec;
import java.util.ArrayList;
import java.util.List;

/**
 * Returns a list of entries directly under the specified category.
 * (Does not recurse into subcategories; 1 layer only).
 */
public static List<Entry> listDirectChildren(ModConfig modConfig, List<String> categoryPath) {
    List<Entry> out = new ArrayList<>();

    // 1. Retrieve the config spec object and verify its type safely
    Object specObj = modConfig.getSpec();
    if (!(specObj instanceof com.electronwill.nightconfig.core.UnmodifiableConfig)) {
        return out;
    }
    com.electronwill.nightconfig.core.UnmodifiableConfig specRoot = 
        (com.electronwill.nightconfig.core.UnmodifiableConfig) specObj;

    // 2. Fetch the specific category node based on the path
    com.electronwill.nightconfig.core.UnmodifiableConfig node = categoryPath.isEmpty()
            ? specRoot
            : specRoot.get(String.join(".", categoryPath));
    if (node == null) return out;
    
    // 3. Iterate through entries using 'var' for safe type inference with wildcards
    for (var e : node.entrySet()) {
        List<String> childPath = new ArrayList<>(categoryPath);
        childPath.add(e.getKey());

        Object raw = e.getValue();
        // Safely cast to ForgeConfigSpec.ValueSpec or handle subcategories
        if (raw instanceof net.minecraftforge.common.ForgeConfigSpec.ValueSpec valueSpec) {
            out.add(new Entry(childPath, false, valueSpec));
        } else if (raw instanceof com.electronwill.nightconfig.core.UnmodifiableConfig) {
            out.add(new Entry(childPath, true, null));
        }
    }
    return out;
}
-- Since I made this mod on a total whim, the quality might be a bit low. Please forgive me! (lol)
Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more