Skip to content

Performances / Refractor update - #270

Merged
Maxlego08 merged 22 commits into
Maxlego08:developfrom
1robie:develop
Oct 22, 2026
Merged

Maxlego08 merged 22 commits into
Maxlego08:developfrom
1robie:develop

Conversation

@1robie

@1robie 1robie commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and refactorings across the codebase, focusing on performance, code clarity, and extensibility. Key changes include enhanced placeholder caching, improved color code handling, refactored inventory timer logic, and new extensibility for rule registration. Below are the most important changes grouped by theme:

Performance and Caching Improvements

  • Replaced the custom placeholder cache in PapiUtils with a Guava Cache, supporting automatic expiration and size limits. This improves efficiency and reliability of placeholder resolution and cache management. The cache now respects dynamic configuration and removes the previous CacheEntry logic. [1] [2] [3] [4]
  • Removed the unnecessary itemStackSerialized cache from ItemStackUtils, simplifying item stack serialization/deserialization and reducing memory usage. [1] [2] [3] [4]

Inventory and Timer Refactoring

  • Refactored timer management in InventoryDefault to use the plugin's scheduler (WrappedTask) instead of raw TimerTask, ensuring tasks are properly cancelled on inventory close and when replaced. This prevents memory leaks and redundant tasks. [1] [2] [3] [4]
  • Removed deprecated timer scheduling methods from ZUtils, further centralizing task management and reducing legacy code.

Extensibility and API Enhancements

  • Added a new registerRuleLoader method to ButtonManager, allowing external plugins to register custom rule types for item rules, increasing the flexibility and extensibility of the API. [1] [2]

Utility and Compatibility Improvements

  • Improved CompatibilityUtil.getTopInventory by caching method lookups with ClassValue, reducing reflection overhead and improving performance for frequent inventory operations. [1] [2]
  • Optimized OfflinePlayerCache.get to check for online players before using the cache, ensuring up-to-date player information.

Color Code Handling

  • Enhanced color code parsing in ZUtils by using precompiled regex patterns and StringBuilder, making color transformations more efficient and robust, especially for hex color codes. [1] [2]

1robie and others added 22 commits October 13, 2026 16:59
ANVIL inventories only have a packet engine on 1.21+. On older versions
they fall back to the chest engine and rename-requirements never run.
Log an error at load time and document the minimum version in the README.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…nitial-value' and standardize 'after-action' syntax
…an up log upload success message (remove old check for spigot)
@Maxlego08
Maxlego08 merged commit 89b57a6 into Maxlego08:develop Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants