Skip to content

Add optional RelationNature to TeamRelation with override; add tests#39

Merged
ez-plugins merged 4 commits into
mainfrom
feature/relation-nature
May 24, 2026
Merged

Add optional RelationNature to TeamRelation with override; add tests#39
ez-plugins merged 4 commits into
mainfrom
feature/relation-nature

Conversation

@ez-plugins
Copy link
Copy Markdown
Owner

@ez-plugins ez-plugins commented May 24, 2026

Added

  • Optional RelationNature enum (FRIENDLY, NEUTRAL, HOSTILE) to the model
    package. Each TeamRelation constant carries a built-in default nature which may
    be queried with getDefaultNature().
  • Consumer override support: TeamRelation#setNatureOverride(RelationNature) and
    TeamRelation#getNature() — allows server or provider code to re-categorise a
    relation at runtime. Passing null to setNatureOverride clears the override
    and restores the builtin default. Overrides are visible JVM-wide because enum
    constants are singletons.
  • Unit tests: TeamRelationTest covering default natures and override behaviour.

Changed

  • TeamsAPI.API_VERSION bumped to 2.1.0.

Migration

No behavioural changes to existing TeamRelation helpers: isFriendly() and
isHostile() remain unchanged and existing consumers require no changes. Providers
that wish to reclassify relations (for example treating TRUCE as NEUTRAL) may
call setNatureOverride(...) during initialisation.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...com/skyblockexp/teamsapi/model/RelationNature.java 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ez-plugins ez-plugins merged commit 9fc7937 into main May 24, 2026
11 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