Skip to content
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

Closed
EtienneDx opened this issue May 14, 2020 · 7 comments · Fixed by #2011
Closed

DataStore.getClaim(long id) doesn't return subclaims #814

EtienneDx opened this issue May 14, 2020 · 7 comments · Fixed by #2011

Comments

@EtienneDx
Copy link

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...)

@RoboMWM
Copy link

RoboMWM commented May 16, 2020

is this method for getClaim ever called anywhere else in GP?

@EtienneDx
Copy link
Author

@RoboMWM
Copy link

RoboMWM commented May 17, 2020

hmm ok, so that call only expects to get parent claims.

@EtienneDx
Copy link
Author

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)

@RoboMWM
Copy link

RoboMWM commented May 17, 2020

I mean the call in FlatFileDataStore

@EtienneDx
Copy link
Author

me too

@EtienneDx
Copy link
Author

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

akdukaan added a commit to akdukaan/GriefPrevention that referenced this issue Feb 21, 2023
Code copied from GriefPrevention#811 which I think was closed because it tried to take on way more than just this fix
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 a pull request may close this issue.

2 participants