Skip to content

feat: add Rarity enum for item and entity rarity representation#248

Merged
ammodev merged 1 commit into
version/1.21.11from
feat/rarity
Mar 14, 2026
Merged

feat: add Rarity enum for item and entity rarity representation#248
ammodev merged 1 commit into
version/1.21.11from
feat/rarity

Conversation

@ammodev

@ammodev ammodev commented Mar 14, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new Rarity enum to both the core and Bukkit APIs, providing a unified way to represent item or entity rarity with associated display names and colors. The changes also increment the project version to reflect this addition.

New Rarity enum integration:

  • Added Rarity enum to surf-api-core and surf-api-bukkit APIs, including rarity levels (COMMON, UNCOMMON, RARE, EPIC, LEGENDARY, MYTHIC), display names, and color associations for use in item/entity representation. [1] [2] [3]

Version update:

  • Updated project version in gradle.properties from 1.21.11-2.63.1 to 1.21.11-2.64.0 to reflect the new feature addition.

@ammodev ammodev self-assigned this Mar 14, 2026
Copilot AI review requested due to automatic review settings March 14, 2026 22:52
@ammodev ammodev merged commit 8486c0d into version/1.21.11 Mar 14, 2026
6 checks passed
@ammodev ammodev deleted the feat/rarity branch March 14, 2026 22:52
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

This PR contains changes that modified the public API. To update the reference ABI dumps:

./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git push

After updating, the CI will pass. Make sure the changes are backward compatible.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Rarity enum to represent item/entity rarity levels (COMMON through MYTHIC) with display names and colors, and bumps the project version to 1.21.11-2.64.0.

Changes:

  • New Rarity enum in surf-api-core with six levels, each having a German display name and an associated TextColor.
  • Updated API surface dumps for both core and Bukkit modules.
  • Version bump from 1.21.11-2.63.1 to 1.21.11-2.64.0.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
surf-api-core/.../rarity/Rarity.kt New Rarity enum with display names and colors
surf-api-core/.../surf-api-core-api.api API surface updated to include new Rarity class
surf-api-bukkit/.../surf-api-bukkit-api.api API surface updated with a Bukkit Rarity class (no matching source file found)
gradle.properties Version bump to 1.21.11-2.64.0

Comment on lines +21 to +44
COMMON(
displayName = { spacer("Gewöhnlich") },
color = TextColor.color(0xAAAAAA)
),
UNCOMMON(
displayName = { spacer("Ungewöhnlich") },
color = TextColor.color(0x55FF55)
),
RARE(
displayName = { success("Selten") },
color = TextColor.color(0x55FFFF)
),
EPIC(
displayName = { info("Episch") },
color = TextColor.color(0xFF55FF)
),
LEGENDARY(
displayName = { warning("Legendär") },
color = TextColor.color(0xFFAA00)
),
MYTHIC(
displayName = { error("Mythisch") },
color = TextColor.color(0xAA00AA)
);
Comment on lines +2180 to +2195
public final class dev/slne/surf/surfapi/bukkit/api/rarity/Rarity : java/lang/Enum, net/kyori/adventure/text/ComponentLike {
public static final field COMMON Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static final field EPIC Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static final field LEGENDARY Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static final field MYTHIC Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static final field RARE Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static final field UNCOMMON Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public synthetic fun asComponent ()Lnet/kyori/adventure/text/Component;
public fun asComponent ()Lnet/kyori/adventure/text/TextComponent;
public final fun getColor ()Lnet/kyori/adventure/text/format/TextColor;
public final fun getDisplayName ()Lnet/kyori/adventure/text/TextComponent;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
public static fun values ()[Ldev/slne/surf/surfapi/bukkit/api/rarity/Rarity;
}

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