← Назад к ресурсам

InventoryAdvancementAccelerator

invadvopt is a dedicated-server NeoForge mod for Minecraft 1.21.1. It accelerates the hot inventory_changed advancement trigger without replacing Minecraft's predicate or award logic. Clients do not install it.

Modrinth optimization

Описание

# 🚀 Inventory Advancement Accelerator When a server has a large number of advancements, data packs, or online players, vanilla Minecraft frequently iterates through the relevant advancement conditions. This mod creates a per-player item index and filters only the conditions that may match the current inventory change, while continuing to use Minecraft’s vanilla predicates and reward logic for the final evaluation. Simply put: fewer unnecessary checks, while preserving vanilla behavior. ⚡ ## 🚀 Significantly Fewer Candidate Checks Relevant advancement conditions are located based on the items that actually changed in the player’s inventory, avoiding a full scan of every listener each time. ## 🎯 Precise Vanilla Evaluation Final matching is still performed by Minecraft’s vanilla `TriggerInstance`, `ItemPredicate`, and context predicates. The vanilla reward logic is not replaced. ## 🧩 Support for Complex Item Conditions Correctly handles item counts, tags, data components, empty-slot changes, item removal, and combinations of multiple conditions. ## 🖥️ Server-Side Installation Only Clients do not need to install this mod. Vanilla clients can connect to the server directly. ## 🛡️ Safe Fallback Mechanism When unknown conditions, asynchronous calls, resource reloads, Mixin injection failures, or internal exceptions are encountered, the mod preserves or falls back to the vanilla processing flow. ## 🔍 Shadow Verification and Circuit-Breaker Protection By default, the mod samples and compares optimized results against full evaluation results. If a mismatch is detected, the full result is used, and the mod can automatically disable the affected index or switch back to vanilla mode. ## 📊 Built-In Runtime Metrics View trigger counts, candidate reduction ratios, full-scan counts, fallback reasons, latency distributions, and the most active players and items. ## 💾 No World Data Modifications The mod does not add player attachments, capabilities, save-format changes, or network channels. Removing the mod does not require save migration. The project includes a deterministic candidate-layer microbenchmark with: * 5,000 item-condition listeners * 1,000 unique item IDs * 50 simulated players * One item type changed per player per operation Test results: * Approximately 5.014 candidate conditions generated per operation on average * Approximately 99.9% reduction in candidate count * Approximately 4.04× speedup in candidate-layer testing ⚠️ These results are from a microbenchmark of the candidate-filtering layer and do not mean that every server will receive the same MSPT improvement. Actual performance depends on data packs, advancement count, online player count, and the modpack environment. After the first startup, NeoForge generates: `config/invadvopt-common.toml` The safe `EXACT` mode is enabled by default: ```toml mode = "EXACT" enabled = true shadowVerifyRate = 0.01 periodicFullScanTicks = 200 fallbackOnUnknownPredicate = true fallbackOnOffThreadCall = true disableOnMismatch = true metricsEnabled = true debugLogging = false ``` To disable the optimization immediately, switch the mode to `VANILLA`. You do not need to uninstall the mod or restart the server. The following commands require server administrator permission level 4: ```text /invadvopt status /invadvopt stats /invadvopt verify /invadvopt mode vanilla /invadvopt mode exact /invadvopt reset-stats ``` 🎮 Minecraft 1.21.1 🔧 NeoForge 21.1.x ☕ Java 21 🖥️ Dedicated Server 👤 No Client Installation Required Place the mod JAR in the server’s `mods` folder and start the server. The mod is specifically designed with hybrid NeoForge/Bukkit/Paper server environments in mind, including servers such as Youer: * Does not use `@Overwrite` * Does not depend on Bukkit internals * Does not use `Unsafe` or ClassLoader hacks * Automatically preserves vanilla logic when Mixin targets change * Provides sampled verification and circuit-breaker protection for possible runtime differences The following similar advancement-optimization mods are incompatible with this mod: * `achiopt` * `cerulean` * `icterine` When a conflict is detected, this mod logs an error and preserves the vanilla trigger-processing flow. This mod is especially suitable for: 📚 Servers with large data packs 🏆 Modpacks with a large number of custom advancements 👥 Multiplayer survival servers 🧱 Modded servers that frequently modify player inventories 📉 Servers seeking to reduce advancement-evaluation overhead You can revert at any time by: * Using `/invadvopt mode vanilla` to switch back to vanilla mode * Setting `mode = "VANILLA"` in the configuration file * Stopping the server and removing the mod JAR directly ## Real-World Test Results on a Server with 380 Mods: ![in-game test](https://cdn.modrinth.com/data/cached_images/97d98e389632870bd1bb439080eff8d551032ec7_0.webp) ![spark](https://cdn.modrinth.com/data/cached_images/7f376a923c2383b5ce42f9921896302ce056632a.png)