Skip to content

Conversation

@Kazzyyyyyyyy
Copy link
Contributor

@Kazzyyyyyyyy Kazzyyyyyyyy commented Dec 24, 2025

Closes #1924

Added magical power calculation and display to profile viewer UI.

Changes:

  • added 'getMagicalPower(JsonObject playerProfile)' function to calculate MP from accessories
  • display MP in '/pv' ('SkillsPage') UI
  • profile viewer UI increased height by 8 pixels

Testing:
Tested it with random Skyblock profiles from early game to maxed. For comparison I used the Skycrypt MP calculation / data.

Problems:
The algorithm can be off for a few points at certain profiles because 'ItemStack.getSkyblockRarity()' returns 'SPECIAL' for 'VERY_SPECIAL' Hatcessories. So it can happen, that the player has 1817 but Skyblocker shows 1815 MP because it sees 'VERY_SPECIAL' as 'SPECIAL'. Max difference because of this is 4 MP, because you can only have 2 active 'VERY_SPECIAL' Hatcessories.

Screenshot 2025-12-24 111144

If you need any changes, lemme know.

Merry Christmas, Cheers.

Closes SkyblockerMod#1924

Added magical power calculation and display to profile viewer UI.

**Changes:**
- added 'getMagicalPower(JsonObject playerProfile)' function to calculate MP from accessories
- display MP in '/pv' ('SkillsPage') UI
- profile viewer UI increased height by 8 pixels

**Testing:**
Tested it with random Skyblock profiles from early game to maxed.
For comparison I used the Skycrypt MP calculation / data.

**Problems:**
The algorithm can be off for a few points at certain profiles because 'ItemStack.getSkyblockRarity()' returns 'SPECIAL' for 'VERY_SPECIAL' Hatcessories.
So it can happen, that the player has 1817 but Skyblocker shows 1815 MP because it sees 'VERY_SPECIAL' as 'SPECIAL'.
Max difference because of this is 4 MP, because you can only have 2 active 'VERY_SPECIAL' Hatcessories.
@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Dec 24, 2025
Fixed 'ProfileViewerTextWidget.java:214: trailing whitespace [RegexpSingleline]'
@AzureAaron AzureAaron added the new feature This issue or PR is a new feature label Dec 30, 2025
@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed reviews needed This PR needs reviews labels Jan 3, 2026
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed changes requested This PR need changes labels Jan 3, 2026
@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed reviews needed This PR needs reviews labels Jan 3, 2026
@LifeIsAParadox LifeIsAParadox added reviews needed This PR needs reviews and removed changes requested This PR need changes labels Jan 4, 2026
@Kazzyyyyyyyy
Copy link
Contributor Author

fair point, fixed it

@Alex33856 Alex33856 added this to the 6.0.0 milestone Jan 5, 2026
@Alex33856 Alex33856 requested a review from viciscat January 5, 2026 17:34
Copy link
Collaborator

@viciscat viciscat left a comment

Choose a reason for hiding this comment

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

looks good but i will let ya all duke it out for the hatcessories shenanigans

@BigloBot
Copy link
Contributor

BigloBot commented Jan 6, 2026

The the MP stat is causing the information to burst out of its box based on ur example
image

Might be best to embed this into the accessory page for now?

@Kazzyyyyyyyy
Copy link
Contributor Author

Ill make it so that only one Hatccessorie counts. Im pretty confident its a bug that the two I mentioned dont cancel eachother out - because the same Hatccessories just in different colors do.
For the UI: I like the current position because its always visible. Will now try to fix the profile name going over the border. If I cant figure it out I will come back and ask for help or ideas.

@Kazzyyyyyyyy
Copy link
Contributor Author

image

@BigloBot
Copy link
Contributor

BigloBot commented Jan 6, 2026

image

If this is an edited extended texture this will break any custom textures people have made for this

@Kazzyyyyyyyy
Copy link
Contributor Author

Kazzyyyyyyyy commented Jan 6, 2026

wdym exactly? I only changed alignment values.
Edit: but only for this part, nothing else is affected.

Copy link
Contributor

@Alex33856 Alex33856 left a comment

Choose a reason for hiding this comment

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

LGTM

@LifeIsAParadox LifeIsAParadox added merge me please Pull requests that are ready to merge and removed reviews needed This PR needs reviews labels Jan 7, 2026
@Alex33856 Alex33856 dismissed viciscat’s stale review January 7, 2026 22:44

resolved earlier

Copy link
Collaborator

@AzureAaron AzureAaron left a comment

Choose a reason for hiding this comment

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

I think this should be rewritten to use our own accessories data since it is consistent with the other accessory features in the mod.

@LifeIsAParadox LifeIsAParadox added changes requested This PR need changes and removed merge me please Pull requests that are ready to merge labels Jan 8, 2026
@Kazzyyyyyyyy
Copy link
Contributor Author

What is the big value you think this change would bring? I dont really see it rn. The code is clean and understandble, so I dont think there can be big misunderstandings. I get the point of "making everything use API x" but that is not the point here. The NW calculation for /pv also uses the data I use here. If there are good arguments for refactoring everything, I would ofc do it, but the thing was pretty much done for me (because, well it had the "merge me please" tag already).

@AzureAaron
Copy link
Collaborator

What is the big value you think this change would bring? I dont really see it rn. The code is clean and understandble, so I dont think there can be big misunderstandings. I get the point of "making everything use API x" but that is not the point here. The NW calculation for /pv also uses the data I use here. If there are good arguments for refactoring everything, I would ofc do it, but the thing was pretty much done for me (because, well it had the "merge me please" tag already).

It is not great maintenance wise to have two (soon three with vic's helper) things doing relatively similar things but in totally different ways (in this case the data source). It is much preferable in the long term to keep things consistent where possible (e.g. why have two ways to render the similar filled boxes for different features when you can just have one). I don't think it is too difficult to change the usage, it is the same information just in a different format.

@Kazzyyyyyyyy
Copy link
Contributor Author

Ok, make sense. Wouldve been nice if you had said it earlier but whatever. Ill get to it in a few days (like 1-2), because I got a minijob and no time atm. Is it the "https://azureaaron-api..."? And do we have a global-loader for that data too?

@AzureAaron
Copy link
Collaborator

Ok, make sense. Wouldve been nice if you had said it earlier but whatever. Ill get to it in a few days (like 1-2), because I got a minijob and no time atm. Is it the "https://azureaaron-api..."? And do we have a global-loader for that data too?

It's in the TooltipInfoType.ACCESSORIES constant, the data is similar pretty much just laid out differently. Note for hatcessories they are all part of the same family and have the same tier of 1.

@Kazzyyyyyyyy
Copy link
Contributor Author

Looked into it and I dont see the work to value tradeoff.

The way the constants give the data is perfect:
Having one var for upgrades and one for parents makes handling and managing it very easy.

When using your data I would need to check manually if item X is a parent or upgrade of the current item I check this data for.
I could do this through comparing the tiers of both items but this would result in another conversion from your tiers (1-6) to the MP values.

As I said already, the constants are used elsewhere too. So if the constants are off, broken or wrong in any other way they have to be fixed no matter if my algorithm uses them or not.

The refactoring would take me quite a while because im not very experienced with this type of data (and also I would need to test everything again...) and for me its just not really worth the time atm.
I also started a new project because the PR had the "merge me please" tag already after it went through multiple review rounds from multiple reviewers.

If im wrong and the solution is actually very easy, please tell me in the end, im also just here to learn.

If no one is bothered by it dont close the PR, maybe when I get some time I will refactor it.

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

Labels

changes requested This PR need changes new feature This issue or PR is a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show MP in PV

8 participants