-
Notifications
You must be signed in to change notification settings - Fork 0
ModMenu and YACL Configuration
Stack Size Adjuster provides optional client GUI configuration via ModMenu and YetAnotherConfigLib (YACL v3) using strict reflection gating (GuiHelper.getOptionalYaclFactory). This prevents server-side classloader crashes when running on dedicated servers without YACL or ModMenu present.
-
Path:
config/stack-size-adjuster.json - Format: JSON with schema version tracking.
{
"configVersion": 1,
"items64Limit": 128,
"items16Limit": 32,
"items1Limit": 1,
"maxDropEntities": 8
}Client-side config screens are created reflectively in YaclScreenHelper:
public class YaclScreenHelper {
public static ConfigScreenFactory<?> createScreen() {
return YaclScreenHelper::buildScreen;
}
private static Screen buildScreen(Screen parent) {
StackSizeConfig config = StackSizeConfig.get();
return YetAnotherConfigLib.createBuilder()
.title(Component.translatable("config.stacksizeadjuster.title"))
.category(ConfigCategory.createBuilder()
.name(Component.translatable("config.stacksizeadjuster.category.general"))
.group(OptionGroup.createBuilder()
.name(Component.translatable("config.stacksizeadjuster.group.categories"))
.option(Option.<Integer>createBuilder()
.name(Component.translatable("config.stacksizeadjuster.option.limit_64"))
.description(val -> {
if (val > 39768215) {
return OptionDescription.of(Component.translatable("config.stacksizeadjuster.option.warning", val));
}
return OptionDescription.of(Component.translatable("config.stacksizeadjuster.option.limit_64.description"));
})
.binding(128, () -> config.items64Limit, val -> config.items64Limit = val)
.controller(opt -> IntegerFieldControllerBuilder.create(opt).min(1).max(Integer.MAX_VALUE))
.build()
)
...
)
.group(OptionGroup.createBuilder()
.name(Component.translatable("config.stacksizeadjuster.group.container_drops"))
.option(Option.<Integer>createBuilder()
.name(Component.translatable("config.stacksizeadjuster.option.max_drop_entities"))
.binding(8, () -> config.maxDropEntities, val -> config.maxDropEntities = val)
.customController(opt -> new IntegerSliderController(opt, 1, 64, 1))
.build()
)
)
.build()
)
.save(StackSizeConfig::save)
.build()
.generateScreen(parent);
}
}If a user inputs a stack limit greater than
๐ Repository Source Disclaimer: The documentation in this Wiki reflects the current source code state in the repository, which may include recent unreleased commits or developmental features ahead of public release builds on CurseForge and Modrinth.
Copyright ยฉ 2026 Dasik (Rifaditya). Licensed under the GNU General Public License v3.0 (GPLv3).
๐ Home
- Dynamic GameRules
- Category Stack Limits
- Container Drop Optim.
- Large Chest Overflow
- ModMenu & YACL Config
- Item Count Rendering
- Item Clumps Synergies
- Troubleshooting & FAQ
- Developer Setup
- Architecture Layout
- Mixin Reference
- Addon Override API
- Network Sync Protocol
- Give Command Handling
- Behavior Profiles
- Consumer Mods Guide
- Performance Impact
- Advancements Matrix
- Author: Dasik (Rifaditya)
- License: GPL-3.0-or-later