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
DataStore.getClaim(long id) doesn't return subclaims #814
Comments
is this method for getClaim ever called anywhere else in GP? |
Only once in the FlatDataStore, to set the parents from the childrens: |
hmm ok, so that call only expects to get parent claims. |
Well, yes and no, it expects to get patent claims but it never tries to get a subclaim, so letting it return subclaims shouldn’t cause any problems (and it doesn’t on my test server) |
I mean the call in FlatFileDataStore |
me too |
It tries and get the parent by id, but its parent id is unique so there won't be any clashes between parent claims and subclaims |
Code copied from GriefPrevention#811 which I think was closed because it tried to take on way more than just this fix
What happened:
I can't get a subclaim by it's id.
What was expected:
Get the subclaim with it's id
Steps to reproduce:
Another plugin using getClaim with a subdivision claim id
Server and GriefPrevention version:
Spigot 1.15.2, latest master (093cbb0)
Suggestion of fix
Iterating over each subclaim while iterating over the claims to find the corresponding one.
Current code:
https://github.com/TechFortress/GriefPrevention/blob/093cbb0e93b3ce33c2071efcc0e2bc438a0c7d46/src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java#L747-L755
I'll fix it into my fork, it's gonna get added into #811 (I can make it another PR too, I just had the bad idea of staying on my master branch over there so yeah...)
The text was updated successfully, but these errors were encountered: