-
Notifications
You must be signed in to change notification settings - Fork 0
26.2 Architecture and Mixins
Rifa edited this page Aug 21, 2026
·
1 revision
| Parameter | Specification |
|---|---|
| Mixin Configuration | src/main/resources/collapsible-game-rules.mixins.json |
| Refmap Identifier | collapsible-game-rules-refmap.json |
| Compatibility Level | JAVA_25 |
| Default Require | 1 |
| Root Package | net.instantgratification.collapsiblegamerules |
| Mixin Package | net.instantgratification.collapsiblegamerules.mixin |
| Total Mixins |
4 Client Mixins (3 Class Injectors + 1 Interface Accessor) |
net.instantgratification.collapsiblegamerules
โโโ CollapsibleGameRulesFabric.java โโ> Main ModInitializer (Guard & Hard Dependency check)
โโโ CollapsibleGameRulesFabricClient.java โโ> ClientModInitializer (Loads GameRuleStateConfig)
โโโ GameRuleStateConfig.java โโ> Config & JSON state persistence (Set<String>)
โโโ mixin
โ โโโ AbstractGameRulesScreenRuleListMixin.java โโ> Core engine (List interception, CollapsibleCategoryRuleEntry)
โ โโโ CategoryRuleEntryAccessor.java โโ> Interface Accessor for category Component label
โ โโโ IntegerRuleEntryMixin.java โโ> Abstract wrapper for integer rule entries
โ โโโ ScreenMixin.java โโ> Intercepts Screen.removed() to flush pending state
โโโ preset
โ โโโ GameRulePresetEngine.java โโ> Built-in preset definitions (Builder, Fast Play, Hardcore)
โโโ ui
โ โโโ BooleanToggleWidget.java โโ> Interactive emerald green / ruby red toggle switch
โ โโโ GlobalActionsRuleEntry.java โโ> Pinned index 0 bulk toggle header ([ Expand ] / [ Collapse ])
โ โโโ IntegerSliderWidget.java โโ> Draggable numeric slider with math normalization
โโโ util
โโโ CategoryPrettifier.java โโ> Regex & string parser for unlocalized category keys
โโโ DasikMetadataHelper.java โโ> Lazy-loaded isolation layer querying DasikLibrary
โโโ GameRuleSliderHelper.java โโ> Vanilla integer rule bounds and default values
โโโ ModVersionGuard.java โโ> Zero-dependency runtime Knot ClassLoader integrity check
-
Target Class:
net.minecraft.client.gui.screens.worldselection.AbstractGameRulesScreen.RuleList.class -
Hierarchy: Extends
ContainerObjectSelectionList<AbstractGameRulesScreen.RuleEntry> - Role: Primary UI controller. Intercepts list population, calculates child count per category, filters visible entries based on expansion states, and renders custom interactive category headers.
@Mixin(AbstractGameRulesScreen.RuleList.class)
public abstract class AbstractGameRulesScreenRuleListMixin
extends ContainerObjectSelectionList<AbstractGameRulesScreen.RuleEntry> {
@Unique
private List<AbstractGameRulesScreen.RuleEntry> collapsible_game_rules$allEntries = new ArrayList<>();
@Unique
private String collapsible_game_rules$currentFilter = "";
@Inject(method = "populateChildren(Ljava/lang/String;)V", at = @At("TAIL"))
private void collapsible_game_rules$onPopulateChildren(String filter, CallbackInfo ci) {
this.collapsible_game_rules$currentFilter = (filter != null) ? filter.toLowerCase(java.util.Locale.ROOT) : "";
this.collapsible_game_rules$allEntries = new ArrayList<>(this.children());
this.collapsible_game_rules$updateVisibleEntries();
}
}-
Target Class:
net.minecraft.client.gui.screens.worldselection.AbstractGameRulesScreen.CategoryRuleEntry.class -
Role: Provides direct bytecode accessor to the private
Component labelfield of vanilla category entries.
@Mixin(AbstractGameRulesScreen.CategoryRuleEntry.class)
public interface CategoryRuleEntryAccessor {
@Accessor("label")
Component collapsible_game_rules$getLabel();
}-
Target Class:
net.minecraft.client.gui.screens.Screen.class -
Role: Listens for screen removal. Whenever
AbstractGameRulesScreenis closed, flushes pending state modifications to disk viaGameRuleStateConfig.saveIfDirty().
@Mixin(Screen.class)
public abstract class ScreenMixin {
@Inject(method = "removed", at = @At("HEAD"))
private void collapsible_game_rules$onRemoved(CallbackInfo ci) {
if ((Object) this instanceof AbstractGameRulesScreen) {
GameRuleStateConfig.saveIfDirty();
}
}
}-
Target Class:
net.minecraft.client.gui.screens.worldselection.AbstractGameRulesScreen.IntegerRuleEntry.class - Role: Provides an abstract bridge into vanilla integer rule entries for specialized widget integration.
@Mixin(AbstractGameRulesScreen.IntegerRuleEntry.class)
public abstract class IntegerRuleEntryMixin extends AbstractGameRulesScreen.RuleEntry {
public IntegerRuleEntryMixin() {
super(null);
}
}{
"required": true,
"package": "net.instantgratification.collapsiblegamerules.mixin",
"refmap": "collapsible-game-rules-refmap.json",
"compatibilityLevel": "JAVA_25",
"client": [
"ScreenMixin",
"AbstractGameRulesScreenRuleListMixin",
"CategoryRuleEntryAccessor",
"IntegerRuleEntryMixin"
],
"injectors": {
"defaultRequire": 1
}
}
Collapsible Game Rules โข Built & Maintained by Dasik (Rifaditya)
Released under the GNU General Public License v3.0 (GPL-3.0-or-later)
GitHub Repository โข Modrinth โข CurseForge โข Issue Tracker
๐ 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.
- ๐๏ธ Collapsible Categories
- ๐ Global Actions & Bulk Toggles
- ๐ Smart Search Integration
- โจ๏ธ Keyboard Navigation & Accessibility
- ๐ง State Persistence & JSON Config
- โจ Category Prettification & Naming
- ๐๏ธ Game Rule Presets & Widgets
- ๐ GameRules Reference Table
- ๐ฌ Brigadier Commands & Absence Scope
- ๐ Advancements & Absence Scope
- ๐ฅ๏ธ HUD, Diagnostics & Rendering
- ๐ ๏ธ Developer Setup & Gradle Builds
- ๐งฉ Architecture & Mixin Subsystem
- ๐ DasikLibrary API Integration
Dasik (Rifaditya) | GPLv3