Piggy Lib

Piggy Lib

Just a library for Piggy's Mods, nothing fancy.

by
176 Downloads
fabriclibrary
Rent Server with this Mod

About this Mod

build
release

Piggy Lib

A shared library providing the core infrastructure and high-performance utilities for all Piggy mods. It centralizes common systems to ensure consistency, stability, and anti-cheat compliance.


⚡ Central Piggy Action Queue

The most critical component of the Piggy suite. All player interactions (clicking slots, placing blocks, using items) must be routed through this queue.

  • Stateful Actions: Interactions are wrapped in IAction objects (e.g., InteractBlockAction, MoveItemAction).
  • Verification over Assumption: Actions are not considered "done" when the packet is sent. They use an onExecute phase to trigger and a verify phase to poll for success (e.g., checking if an item actually moved to the destination slot).
  • Rate Limiting & CPS: A global Clicks-Per-Second (CPS) limiter follows configurable server rules. Routine actions (sorting) are throttled, while life-saving actions (MLG) use ActionPriority.HIGHEST to bypass the limiter.
  • Packet Bundling: Groups related interactions into single-tick executions when safe, minimizing network overhead.

📊 Performance & Telemetry

PerfMonitor

A robust utility for tracking server-side health and network conditions.

  • Dynamic TPS Tracking: Calculates real-time Server Ticks Per Second.
  • Latency Calculation: Provides stable, smoothed ping data used by piggy-build for preemptive action triggering.

Meta-Action Sessions

A sophisticated telemetry engine for diagnosing complex failures.

  • Contextual Logging: Captures inventory states, player positions, and world metadata before and after actions.
  • Forensic Reports: Generates detailed JSON/Markdown reports for failed operations (like a failed inventory sort or a missed MLG).
  • Rich Formatting: Uses PiggyTelemetryFormatter to provide interactive, clickable chat components for administrative review.

🎒 Inventory API

InventorySearcher

A modular, high-performance engine for finding items across multiple containers.

  • Condition-Based Search: Filter items by Type, Tag, NBT, or custom predicates.
  • Multi-Slot Resolution: Handles complex searches involving split stacks or "mega-stacks" (>64 items).

🎨 UI & Configuration

  • Unified Radial Menus: Standardized GenericRadialMenuScreen for consistent selection interfaces.
  • YACL Config Wrappers: A simplified factory pattern for building beautiful, categorized configuration screens using Yet Another Config Lib.
  • Anti-Cheat Feedback: Hud overlays and floating notifications that inform players when features are restricted by the server.

Dependencies

License

CC0-1.0

Available Versions

Piggy Lib 2.0.1release
MC 1.21.1fabric
April 25, 2026
Piggy Lib 2.0.0release
MC 1.21.1fabric
March 28, 2026
Piggy Lib 1.0.5release
MC 1.21.1fabric
March 12, 2026
Piggy Lib 1.0.4release
MC 1.21.1fabric
March 8, 2026
Piggy Lib 1.0.3release
MC 1.21.1fabric
March 2, 2026

How to Install Piggy Lib on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).

3

Install Mod

Open the mod browser in the dashboard and search for "Piggy Lib". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.21.1

Server-side

~ Optional

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Piggy Lib server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.

Is Piggy Lib compatible with fabric?

Piggy Lib officially supports fabric for Minecraft 1.21.1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Piggy Lib – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Piggy Lib consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Piggy Lib with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
Creative Commons Zero v1.0 Universal
Server-side
Optional

Supported Versions

1.21.1