Skip to content

Conversation

@Bram1903
Copy link
Collaborator

@Bram1903 Bram1903 commented Jan 20, 2026

  • Added: AvatarMeta
  • Changed: PlayerMeta to extend AvatarMeta

Changed: PlayerMeta extends AvatarMeta
@Bram1903 Bram1903 requested a review from Tofaa2 January 20, 2026 12:23
@Bram1903 Bram1903 self-assigned this Jan 20, 2026
@Bram1903 Bram1903 added the enhancement New feature or request label Jan 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

A new AvatarMeta class is introduced to manage avatar appearance metadata bits including cape, jacket, sleeves, legs, hat, and right-hand main. PlayerMeta now extends AvatarMeta instead of LivingEntityMeta, inheriting these features and removing duplicate method definitions. Metadata offset indices are adjusted accordingly.

Changes

Cohort / File(s) Summary
New Avatar Metadata Class
api/src/main/java/me/tofaa/entitylib/meta/types/AvatarMeta.java
Introduces AvatarMeta extending LivingEntityMeta with public constants OFFSET and MAX_OFFSET, bitmask constants for avatar features (cape, jacket, sleeves, legs, hat), and accessor/mutator pairs for each feature. Includes version-aware behavior with checks for ServerVersion.V_1_9 and bitwise operations for metadata manipulation.
Player Metadata Refactor
api/src/main/java/me/tofaa/entitylib/meta/types/PlayerMeta.java
Changes inheritance from LivingEntityMeta to AvatarMeta, delegating avatar feature methods upward. Removes duplicate cape, jacket, sleeve, leg, hat, and right-hand-main accessors/mutators. Updates shoulder data offsets from (OFFSET, 4)/(OFFSET, 5) to (OFFSET, 2)/(OFFSET, 3) and adds version checks for ServerVersion.V_1_11. Adjusts MAX_OFFSET from OFFSET + 1 to OFFSET + 4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hop and a bound, refactoring's done,
Avatar features now share the fun,
Up the hierarchy, methods ascend,
PlayerMeta and AvatarMeta now blend,
One class inherits, one code runs true! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title refers to version support (1.21.9+) but the actual changes involve refactoring entity metadata classes by extracting avatar-related features into a new AvatarMeta class and reorganizing PlayerMeta to extend it. Consider a more specific title that reflects the primary technical change, such as 'refactor: Extract avatar metadata into separate AvatarMeta class' or 'feat: Add AvatarMeta base class for shared avatar properties'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants