Files
purpur-inventory-helper/README.md
dmg de045fb458
CI / build (push) Successful in 1m59s
CI / build (pull_request) Successful in 2m27s
feat(anvil): combine items beyond enchantment limits
2026-10-11 23:51:17 -04:00

7.8 KiB
Raw Permalink Blame History

Purpur Inventory Helper

A Purpur 26.2 plugin with Sorting Sticks, automatic broken-tool replacement, alternative Dispenser/Cobweb recipes, and risky over-level enchantment combining in ordinary anvils.

The approved behavior is specified in the SoMC OKF wiki.

The repository, checkout and new JARs use purpur-inventory-helper. Runtime SpigotInventoryHelper, Java entrypoint/packages, data namespace and sorting-stick/recipe keys remain unchanged. Replace the old JAR instead of loading both distributions. Old tags and spigot-inventory-helper-* assets are retained; the previous v1.2.0 download was checked for identical bytes after the rename.

Requirements

  • Purpur 26.2 build 2618
  • Java 25 or newer
  • ProtocolLib 5.4.0 (required runtime library; missing ProtocolLib prevents plugin loading)

Build

./gradlew clean check jar

The plugin JAR is written to build/libs/.

check includes nativeInventoryTest. It downloads the exact Purpur 26.2 build 2618 launcher, verifies SHA-256 4a32d046a118804d89ca74ba89b798c98f6d8d1f310c18077ac573597049de31, and runs Paperclip in patch-only mode under build/inventory-runtime/; it does not start a server, open a port, create a world, or accept the EULA. The native suite executes real ServerPlaceRecipe, ServerRecipeBook known/highlight codec persistence, and ResultSlot ingredient consumption for both Sorting Stick variants and the alternative Dispenser recipe, including repeated batch completion. The narrowly scoped anvil-generation adapter also uses this checksum-pinned native runtime as a compile-only dependency. Server/API and ProtocolLib classes are not bundled. CraftServer, CraftPlayer, and client boundaries are doubled, so this is not evidence of live client rendering, search interaction, packet transport, or a full server lifecycle. Those remain non-blocking live checks.

Sorting Stick recipe

Place these ingredients vertically in the crafting grid's center column:

Chest or Barrel
Redstone Dust
Stick

Either storage-block variant produces one Sorting Stick. Both variants are universally discovered in the recipe book's Equipment category for online and joining players. Discovery is persistent and idempotent; reloading the plugin retains player recipe-book knowledge and ordinary vanilla state. If the two recipes cannot register as one complete group, recipe-book discovery is disabled while existing manual crafting and inventory behavior remain available.

Alternative Dispenser recipe

One ordinary Dropper + Tripwire Hook produces one ordinary Dispenser through a shapeless recipe in the recipe book's Redstone category. The alternative is universally discovered for online and joining players, supports native autofill and batch completion, and leaves Minecraft's Bow-based Dispenser recipe unchanged. If the alternative cannot register safely, existing Inventory Helper behavior remains available and discovery retries after a later successful registration.

Sorting inventories

Hold an authentic Sorting Stick and right-click:

  • A chest or either half of a double chest to sort its complete inventory.
  • A barrel to sort its inventory.
  • Air or another block to sort player inventory slots 9–35.

Player hotbar, armor, and off-hand slots remain unchanged during player sorting. Compatible stacks are consolidated first, then items are ordered alphabetically by Minecraft material. Dissimilar metadata variants of the same material retain their relative order. Locked containers and interactions cancelled by protection plugins are not sorted.

Automatic tool replacement

When a main-hand tool breaks, an item with the exact same material is moved into the broken tool's selected hotbar slot on the next server tick. Main-storage candidates are preferred before tools in other hotbar slots. The complete replacement item is moved unchanged, preserving durability, enchantments, custom names, and other metadata. Off-hand breaks are ignored, and no unrelated item is moved when a match is unavailable.

Advanced anvil combining

All players can combine two same-material, non-book items in an ordinary anvil. Equal enchantment levels become one higher, even above the normal maximum; unequal levels keep the higher. Compatible applicable enchantments carry over. Conflicts, inapplicable enchantments and results the server cannot serialize exactly are refused rather than silently discarded.

The result preserves the first/left item's exact name, lore and unrelated metadata, with combined enchantments and normal durability repair. Rename text is ignored for enhanced merges. Book operations, rename-only, repair-only and unrelated operations remain vanilla.

Enhanced merges charge no XP and have no "Too Expensive" restriction. The private action bar displays the result and exact success/failure chances; private chat explains that taking the result commits the attempt. Each accepted attempt consumes one item from each input. Success delivers one result; failure destroys both consumed items and causes an explosion that can hurt players and damage blocks. Native protections remain authoritative, but a protected/refused explosion does not refund the inputs.

Default risk uses the largest resulting enchantment excess above its normal maximum:

Excess Failure chance
0 0%
1 20%
2 25%
3 35%
4 50%
5 70%
6 95%
7 or more 99%

ProtocolLib binds taking to the displayed menu generation before payment. Input or acknowledged risk changes invalidate old clicks even when the result item is identical; the ordinary anvil stays open without another confirmation. The adapter is pinned to Purpur 26.2 build 2618 and fails closed when enhanced generation admission is unavailable. This is a library dependency, not a Fantasy Stick/gameplay-plugin bridge.

Use left/right pickup, shift-click or a native-eligible empty hotbar/offhand destination. Full destinations, cancelled/stale takes and unsupported cloning/drop/collection actions do not roll or spend items. Ordinary anvil wear remains in effect. Dedicated gameplay-plugin compatibility is unsupported; declared native cancellations and unrelated inventory state are preserved.

Administrators with spigotinventoryhelper.admin (default OP) and authorized console can read/set durable balance values:

/inventoryhelperadmin config <key>
/inventoryhelperadmin config <key> <value>
Key in plugins/SpigotInventoryHelper/config.yml Default
advanced-anvil-base-failure-percent 20
advanced-anvil-risk-step-percent 5
advanced-anvil-max-failure-percent 99

Values are integers 0–100. For excess E > 0, failure is min(cap, base + step × E × (E − 1) / 2); E0 always has zero risk. The default cap leaves 1% success, but an explicit cap100 can permit guaranteed destruction. Saves occur off-thread and acknowledge only after durable replacement; failed saves keep effective values unchanged. Acknowledged changes invalidate existing previews, and restart loads saved values. Autocomplete is permission-aware and side-effect free. A missing file uses packaged defaults without a startup write; malformed settings withhold enhanced gameplay, leaving existing features available.

Native automated tests cover menus, registered events/commands and ProtocolLib listeners, item serialization, packet/result-taking, stale client generations, and protected explosion boundaries. Actual client visuals and live destructive testing remain separate follow-ups, not deployment evidence.

Releases

Gitea Actions checks pushes and pull requests and stores a development JAR. Pull requests validate conventional commits. Main-branch conventional commits drive semantic releases when the repository defines a RELEASE_TOKEN with contents-write permission.