Skip to content

Comments

feat: new xp field resolvement method#32

Open
CuukyOfficial wants to merge 1 commit intomasterfrom
fix/xp-field
Open

feat: new xp field resolvement method#32
CuukyOfficial wants to merge 1 commit intomasterfrom
fix/xp-field

Conversation

@CuukyOfficial
Copy link
Owner

@CuukyOfficial CuukyOfficial commented Nov 5, 2024

Problem: When initially adding the feature of setting the xp cooldown of any player, the method of resolving the desired field to achieve this functionality has been rather poor because of the complexity of finding this exact integer field via reflections.

This pull request aims to fix this issue by using the experience orb class to call the players class to change the xp cooldown integer. This change can the be detected and therefore the xp cooldown field be identified.

This code has been tested on Spigot 1.8.8

@Almighty-Satan
Copy link
Collaborator

I really don't like setting some random fields to 0 for actual players. That might cause some weird issues that are impossible to debug, especially on modded servers. Shouldn't it be possible to create a new instance of EntityHuman and use that to find the field?

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