介绍
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
IActionobjects (e.g.,InteractBlockAction,MoveItemAction). - Verification over Assumption: Actions are not considered “done” when the packet is sent. They use an
onExecutephase to trigger and averifyphase 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.HIGHESTto 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-buildfor 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
PiggyTelemetryFormatterto 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
GenericRadialMenuScreenfor 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
- Fabric API
- YACL (Required for config UI)
License
CC0-1.0
常见问题
Piggy Lib 支持哪些 Minecraft 版本?
Piggy Lib 支持 Minecraft Java 版 1.21.1,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
Piggy Lib 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
porkyoot 的其他作品
查看全部 →
Piggy Build
A simple yet powerful building mod for flexible block placement and shape selector.
Piggy Admin
A server-side administration mod designed to help manage anti-cheat settings and moderate servers
Piggy Inventory
A simple yet powerful mod designed to enhance your inventory management experience in Minecraft. Piggy Inventory aims to streamline your interactions with items, tools, and containers.
评论
登录后评论和评分