-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird error with origins attribute #22
Comments
Hi there, The reason (I suspect) it is not working for PlayerEx attributes is because they are registered when the PlayerEx datapack loads (on world join or on /refresh) and this must be happening after the Origins datapack loads, not before. I'm hesitant to label this a bug as it's really not - everything from both mods are working as they should, it's just an incompatibility. I'll look into this further to see if I can fix it from my end first, if not then I will attempt to fix it on Origin's side and make a pull request. Edit: I'm going to transfer this issue to Data Attributes, as it is technically the incompatible mod, not PlayerEx. |
Hi there, 1. IssueWhen using datapack-loaded attributes provided by Data Attributes (such as from the PlayerEx mod) in Origins' attribute power datapack (i.e. giving an origin bonus attributes - for example Specifically, when Origins searches for, say, 2. Initial Solution TheoryAt first I thought the solution would be to forcefully hardcode Data Attribute's datapack to always be the first one loaded after vanilla packs. The idea was that Data Attribute's would do its thing and register the json attributes to the game, and then Origins would do its thing and by the time it searched for the attributes in the registry, they would be there. This did not work, and I still do not understand why. 3. Further Solution and NotesIt is important to state that this is not a bug - not with Data Attributes, nor with Origins; both mods are functioning as intended. This is a situational incompatibility between two features of two mods. Because the solution discussed in (1.) was not fruitful, this leads me to believe that this incompatibility cannot be solved on the end of Data Attributes. Therefore, I endeavoured to fix this issue on the side of Origins and make a merge request once complete. It should be noted at this point that the actual incompatibility seems to be not with Origins itself but with one of its libraries: Apoli. When I cloned Apoli, I noticed that the repository contains errors in the code. Now, I could just be missing something, perhaps something simple even, but as far as I can tell there are errors in the code, namely here. The static method
We see that for the last parameter, the argument passed is I know that despite not satisfying simple Java it still works, because decompiling Origins and viewing the Apoli library shows the same code, meaning that it does work in a compiled state, but I am unable to compile it myself nor do I have the time to spend troubleshooting and figuring out what I am missing. ConclusionsDespite the prospect of a fix looking fairly dire at this point, there is still a relatively simple way to solve this incompatibility that I'm almost certain would be successful - and this was the solution I was aiming to implement myself and then request a merge.
Alternatively, Origins (Apoli) could interop with Data Attributes as a dependency and use its attribute system, but this is unlikely in my experience as a developer. No one wants to use someone else's library/API, especially when it exceeds 100kB and the only purpose to doing so would be to fix an incompatibility that only occurs occasionally. Therefore, I will leave this issue open as a reminder to myself as well as a place to reference for if and when others encounter the incompatibility - but I myself will put this on hold and I will likely not be providing a fix anytime soon. Origins still works with Data Attributes, it just can't use any of the json attributes (namely from PlayerEx) in its power system. |
Hey,
I don't know if i need to report this problem to Origins too, because the script work when i use minecraft's attribute.
But when i try to use PlayerEx attribute, it doesn't.
Got this in log :
[12:31:14] [main/ERROR]: There was a problem reading sub-power "role:berserker/nordicborn_freezedmgresist" in power file "role:berserker/nordicborn": Error reading data field at modifier.attribute: Identifier "playerex:freeze_resistance" was not registered in registry "minecraft:attribute". [12:31:14] [main/ERROR]: There was a problem reading power file role:big_boy (skipping): Error reading data field at modifier.attribute: Identifier "playerex:constitution" was not registered in registry "minecraft:attribute".
I made the exact same script as him
{ "type": "origins:attribute", "modifier": { "attribute": "playerex:constitution", "operation": "addition", "value": 12.0 }, }
Minecraft : 1.19
Fabric : 0.14.8
PlayerEx : 3.3.2
Origins : 1.6.2
PS : I just see a new version of PlayerEx, and th problem is still here.
The text was updated successfully, but these errors were encountered: