r/mcdev

Intelium — a Sodium addon that actually tunes for Intel GPUs
▲ 9 r/mcdev+1 crossposts

Intelium — a Sodium addon that actually tunes for Intel GPUs

**Intelium — made a Sodium addon for Intel GPUs, would love some feedback**

So I've been playing on an Intel iGPU laptop for years and got tired of Sodium treating my GPU like an afterthought. Ended up writing my own mod for it.

Basically it detects which Intel generation you have (works from HD 520 all the way up to Arc Battlemage) and tunes Sodium accordingly — mainly the chunk builder thread count, which Sodium picks pretty conservatively on iGPUs. There's also a fast chunk loading option that overrides Sodium's defer mode, which for some reason ships at the slowest setting by default. Chunks pop in way faster with it.

There's also a bunch of optional "GPU saver" toggles: clouds off/fast, force fast graphics, smooth lighting off, vsync off, render distance cap. They're all off by default because they change how the game looks — I hate mods that mess with your settings without asking. Everything is reversible too, if you turn a toggle (or the whole mod) off it puts your original settings back, even after a restart.

My favorite part honestly is the built-in A/B benchmark: it measures your FPS with the mod on, then off, and shows you the actual difference. No fake numbers, if it doesn't help on your setup it'll tell you.

If you're on NVIDIA or AMD it just disables itself, so don't bother lol.

Needs: Fabric API, Sodium, and an Intel HD 520 or newer (supports 1.21.11 and the 26.x line)

Modrinth: https://modrinth.com/mod/intelium-mod

Source (GPL-3.0): https://github.com/ATOMGAMERAGA/intelium

Bug reports welcome, especially from Arc users since I've mostly tested on iGPUs.

u/ENDERMAN-AGA — 3 days ago
▲ 1 r/mcdev

How do I disable commands based on a config file?

I have a plugin, and I want its commands to be modular via a config.yml.

This is how I register commands:

    public class PluginUtils {
    
        public static void registerCommand(String command, CommandExecutor executor, InventoryCommands plugin) {
            if (plugin.getConfig().getBoolean("commands." + command, true)) {
                var cmd = plugin.getCommand(command);
                if (cmd != null) {
                    cmd.setExecutor(executor);
                    if (executor instanceof TabCompleter tc) {
                        cmd.setTabCompleter(tc);
                    }
                } else {
                    plugin.getLogger().warning("Command '" + command + "' specified on config.yml does not exist!");
                }
    
            } else {
                var commandMap = plugin.getServer().getCommandMap();
                var cmd = commandMap.getCommand(command);
                if (cmd != null) {
                    cmd.unregister(commandMap);
                    plugin.getLogger().info("Unregistered command '" + command + "'");
                }
            }
        }
        
    }

This is the default config.yml:

    commands: # Here you can disable commands that you don't want to use
      craftingtable: true
      enderchest: true
      invsee: true
      trash: true
      anvil: true

When I disable a command by doing command: false, it doesn't do anything when executed, but it's still shown as a valid command. I mean, it shows up on TAB completions and it, instead of being red, it's the default white.

What can I do?

reddit.com
u/Annual_Grapefruit429 — 11 days ago