-
Notifications
You must be signed in to change notification settings - Fork 0
26.2 Architecture and Mixins
Dasik (Rifaditya) edited this page Aug 21, 2026
·
1 revision
| Architectural Property | Value |
|---|---|
| Root Package | net.instantgratification.durabilitymultiplier |
| Compatibility Level | JAVA_25 |
| Mixins Config | durability-multiplier.mixins.json |
| Default Injector Require | 1 |
| Re-entry Guard | ThreadLocal<Boolean> dm$processing |
net.instantgratification.durabilitymultiplier/
├── DurabilityHelper.java # Stateless damage reduction & classification engine
├── DurabilityMultiplier.java # Common mod initializer & logger
├── DurabilityMultiplierFabric.java # Fabric main entrypoint
├── DurabilityMultiplierFabricClient.java # Client entrypoint & network receiver
├── config/
│ ├── ClothConfigScreenHelper.java # Optional Cloth Config GUI builder
│ ├── DurabilityConfig.java # JSON configuration loader & save handler
│ └── ModMenuIntegration.java # ModMenu entrypoint hook
├── mixin/
│ ├── GameRulesMixin.java # Intercepts GameRules.set() for network sync
│ ├── ItemStackDurabilityMixin.java # Intercepts hurtAndBreak() for damage reduction
│ ├── ItemStackTooltipMixin.java # Intercepts addDetailsToTooltip() for status lines
│ └── MappedRegistryMixin.java # Intercepts freeze() for dynamic modded item scan
├── network/
│ ├── DurabilityClientState.java # Client-side cache of 25 GameRules
│ ├── DurabilityNetworking.java # S2C packet registration & player sync logic
│ └── DurabilityPayload.java # CustomPacketPayload record definition
└── registry/
└── DurabilityRules.java # GameRuleCategory & 25 GameRules definitions
-
Target Class:
net.minecraft.world.item.ItemStack -
Target Method:
hurtAndBreak(ILnet/minecraft/server/level/ServerLevel;Lnet/minecraft/server/level/ServerPlayer;Ljava/util/function/Consumer;)V -
Injection Point:
@At("HEAD"),cancellable = true -
Handler Method:
dm$hurtAndBreak(int amount, ServerLevel level, @Nullable ServerPlayer player, Consumer<Item> onBreak, CallbackInfo ci) -
Design Rationale: Single funnel point for all item damage in Minecraft. Re-entry guarded with
ThreadLocal<Boolean> dm$processingto prevent infinite loops when re-invokinghurtAndBreakwith reduced damage.
-
Target Class:
net.minecraft.world.item.ItemStack -
Target Method:
addDetailsToTooltip(Item.TooltipContext, TooltipDisplay, Player, TooltipFlag, Consumer<Component>)V -
Injection Point:
@At("TAIL") -
Handler Method:
dm$addDurabilityTooltip(...) -
Design Rationale: Appends gold bold
✦ UNBREAKABLEor gray⟨Nx Category Durability⟩to item hover tooltips.
-
Target Class:
net.minecraft.world.level.gamerules.GameRules -
Target Method:
set(GameRule<T>, T, MinecraftServer)V -
Injection Point:
@At("TAIL") -
Handler Method:
onSet(GameRule<T> key, T value, @Nullable MinecraftServer server, CallbackInfo ci) -
Design Rationale: When a rule in
DURABILITY_MULTIPLIERcategory changes, triggersDurabilityNetworking.syncToAll(server)to push updated values to all clients in real time.
-
Target Class:
net.minecraft.core.MappedRegistry -
Target Method:
freeze()Lnet/minecraft/core/Registry; -
Injection Point:
@At("TAIL") -
Handler Method:
onFreeze(CallbackInfoReturnable<Registry<T>> cir) -
Design Rationale: When
Registries.ITEMfreezes, scans for uncategorized damageable modded items and registers dynamic GameRules.
Durability Multiplier is engineered with ❤️ by Dasik (Rifaditya) | Licensed under GNU General Public License v3.0 (GPL-3.0-or-later).
📌 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.
- 26.2 Hub
- 26.2 Multipliers
- 26.2 God Mode
- 26.2 Damage & Math
- 26.2 Item Classification
- 26.2 Dynamic Registry
- 26.2 Tooltips & HUD
- 26.2 Network Protocol
- 26.2 GameRules Table
- 26.2 Commands & Admin
- 26.2 Advancements
- 26.2 Configuration
- 26.2 ModVersionGuard
- 26.2 Architecture & Mixins
- 26.2 Developer Setup
- 26.2 API & Addons
- 26.2 FAQ & Diagnostics
- 26.1.2 Hub
- 26.1.2 Multipliers
- 26.1.2 God Mode
- 26.1.2 Damage & Math
- 26.1.2 Item Classification
- 26.1.2 Dynamic Registry
- 26.1.2 Tooltips & HUD
- 26.1.2 Network Protocol
- 26.1.2 GameRules Table
- 26.1.2 Commands & Admin
- 26.1.2 Advancements
- 26.1.2 Configuration
- 26.1.2 Architecture & Mixins
- 26.1.2 Developer Setup
- 26.1.2 API & Addons
- 26.1.2 FAQ & Diagnostics