feat: pet ability handler system remake - #836
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Author
|
I think I should remove the DSL and switch to inheritance instead |
Collaborator
|
seems like a good addition |
perLevelStatistics was a raw Map keyed by Rarity, so getPerLevelStatistics returned null for any rarity the pet did not define. Rarity has ten values and these pets define five or six, so building the lore threw a NullPointerException and took the creative menu down with it whenever a pet matched the search. The same call sits in PlayerStatistics, so an equipped pet would have thrown too. It now uses RarityValue like georgePrice and katUpgrades already do on this component, which falls back to rest instead of returning null. SafeConfig.getMap yields an empty map for an absent key, so undefined rarities parse to zero statistics and pets.yml needs no new keys.
Rarity.getColor and ItemStatistic.getDisplayColor both return a TextColor, so concatenating them into a string printed the colour's name. Pet display names came out as "light_purpleBee" and the Hive lore rendered "aqua" and "red" in front of the numbers. Rarity already had getLegacyColor for this, and ItemStatistic now has a matching getLegacyDisplayColor. Hive also gained the space that was missing between the value and the statistic name.
items.properties only had items.BEE_PET, so Chicken and Grandma Wolf fell back to displaying their raw translation key as the item name.
setEnabled only cleared pets matching the type being enabled, so selecting a second pet left both flagged as active. getEnabledPet takes the first enabled entry, so it kept returning the old pet and selecting a new one appeared to do nothing. This was unreachable until now because there was only ever one pet.
These concatenate ItemStatistic.getDisplayColor() into strings, which prints the colour's name rather than a formatting code, so the bestiary and gathering stats menus rendered "aqua" and "red" in front of their numbers. Same defect the pet lore had, in the code the pet lore copied the pattern from. The three places that use the TextColor properly are left alone: HypixelTranslator passes it to Component.color, StatisticArrow keys a texture map with it, and the potion effect colour in SkyBlockGenericLoader is already a String.
The command kept its own Set of rarity name strings and repeated the same list in the error message, so both had to be updated by hand whenever Rarity changed. It now derives the valid rarities from the enum, capped at MYTHIC because that is where getAsLevel and RarityValue stop, parses with the existing Rarity.getRarity helper and builds the error message from the same list. Tab completion comes for free from it as well. The confirmation message also concatenated getColor, which printed the colour name rather than a formatting code.
The field comments already say what each one holds.
Swofty-Developments
merged commit Aug 8, 2026
a0e2506
into
Swofty-Developments:master
2 checks passed
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.
What
Reworks the pet ability system and ships the first three pets built on it: Bee, Grandma Wolf and Chicken.
Pet ability model
Notes
Adds
/setpetraritydev command for testing.