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

add Lands support #105

Merged
merged 3 commits into from
Oct 14, 2023
Merged

add Lands support #105

merged 3 commits into from
Oct 14, 2023

Conversation

XXY233
Copy link
Contributor

@XXY233 XXY233 commented Sep 25, 2023

No description provided.

@josemmo
Copy link
Owner

josemmo commented Oct 10, 2023

Hi, @XXY233!

Thanks for the PR. Overall looks pretty good, I'll try to find time next month to test and merge it.

XXY233 and others added 2 commits October 13, 2023 13:04
@josemmo josemmo merged commit 8a97f07 into josemmo:develop Oct 14, 2023
@XXY233
Copy link
Contributor Author

XXY233 commented Oct 14, 2023

@josemmo Thank you for taking the time to review the code 🙂. But there's a problem, without passing in a LandPlayer, the OP and people with skip permissions can't destroy images in other people's lands.

@josemmo
Copy link
Owner

josemmo commented Oct 14, 2023

Hi, @XXY233!

Thanks for letting me know, there's no mention of that in the documentation nor I can test it as Lands is a paid plugin. By the way, how did you find that?

The problem with using the other method is this:

material - The blocks material. Useful for flags like Flags.BLOCK_BREAK etc. This parameter is used if the land is engaged in a war and the server configured that in wars specific blocks are allowed to break etc. For flags that don't include any blocks you can provide null here.

The material should not matter for Yamipa as, although we're checking against the block where the image is placed, we're not actually breaking that block. If, according to this, during a war there are some blocks that can be broken, an attacker may exploit this to remove images.

@XXY233
Copy link
Contributor Author

XXY233 commented Oct 14, 2023

This is because my server had this problem a long time ago. Then I communicated with the author and he submitted these codes: https://github.com/baked-libs/dough/pull/223/files

If someone starts a land war, then I guess it's the land owner's responsibility to protect the images, there's not much we can do 🤔.

@josemmo
Copy link
Owner

josemmo commented Oct 14, 2023

If someone starts a land war, then I guess it's the land owner's responsibility to protect the images, there's not much we can do 🤔.

I don't agree with that. As developers, we also are responsible for making secure software.

Can't we just pass null to the material argument? If so, what happens during a land war?

@XXY233
Copy link
Contributor Author

XXY233 commented Oct 14, 2023

I agree with you 🙂, I just tested it. If null is passed in, hasRoleFlag() will return false and the attacker will not be able to destroy the image.

@josemmo
Copy link
Owner

josemmo commented Oct 14, 2023

Great! Thanks for testing it. Will push a commit to develop.

josemmo added a commit that referenced this pull request Oct 14, 2023
- Updated Permissions class

 > Related to #105
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