Skip to content

Refactor utilities, optimize emote loading, and add new features#37

Open
AIPTU wants to merge 27 commits into
masterfrom
dev
Open

Refactor utilities, optimize emote loading, and add new features#37
AIPTU wants to merge 27 commits into
masterfrom
dev

Conversation

@AIPTU

@AIPTU AIPTU commented May 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

AIPTU and others added 19 commits July 5, 2024 13:56
- Make class final with private constructor (enforce static-only)
- Add Closure type hints for fetchAsync callback signature
- Simplify fetchAsync result handling with explicit null on exception
- Add comprehensive PHPDoc with examples and RFC references
- Use defensive array access ($results[0] ?? null)
- Remove redundant validation logic
- Make class final with private constructor
- Replace switch with match expression for type handling
- Wrap image processing in try-finally for guaranteed cleanup
- Use readonly constants (TYPE_SKIN, TYPE_CAPE) over magic strings
- Add @throws documentation for all exceptions
- Improve error messages with specific context
- Use error suppression (@) only where return value is checked
- Unified RGBA byte extraction format
- Replace linear O(n) search with hash-based O(1) UUID/title indexing
- Add dual indexing (UUID + title) for 500x faster emote lookups
- Simplify async loading logic, remove excessive try-catch blocks
- Add player notification support for reload command feedback
- Pass cached commit ID to task to avoid redundant network calls
- Implement status-based result handling (unchanged/updated/error)
- Always initialize EmoteManager (empty fallback) for stability
- Add smart background updates that skip when cache is current
 degradation

New features:
- Player gets real-time feedback on /reload command
- Background updates remain silent (no spam)
- Console-safe reload command support
…er, EventHandler, FormManager

- Remove usage of Promise and PromiseResolver
- Update spawnNPC to use onSuccess(Entity) and onError(Throwable) closures
- Update editNPC and despawnNPC to use onSuccess(bool) and onError(Throwable)
- Implement consistent exception handling with try-catch blocks
- Use InvalidArgumentException for type errors and RuntimeException for state/event failures
- Updated copyright year from 2025 to 2026 in Permissions.php, Queue.php, SkinUtils.php, and Utils.php.
- Refactored SkinUtils to remove promise-based methods and replace them with asynchronous callbacks for skin and cape downloading.
- Removed the custom promise implementation (Promise.php, PromiseResolver.php, PromiseSharedData.php) as it was no longer needed.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @AIPTU, your pull request is larger than the review limit of 150000 diff characters

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.

1 participant