feat: add Rarity enum for item and entity rarity representation#248
Merged
Conversation
Contributor
|
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 pushAfter updating, the CI will pass. Make sure the changes are backward compatible. |
Contributor
There was a problem hiding this comment.
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
Rarityenum insurf-api-corewith six levels, each having a German display name and an associatedTextColor. - Updated API surface dumps for both core and Bukkit modules.
- Version bump from
1.21.11-2.63.1to1.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; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
Rarityenum 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:
Rarityenum tosurf-api-coreandsurf-api-bukkitAPIs, 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:
gradle.propertiesfrom1.21.11-2.63.1to1.21.11-2.64.0to reflect the new feature addition.