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

fix (partial): other worlds can be used #136

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

TreemanKing
Copy link
Contributor

@TreemanKing TreemanKing commented Jun 21, 2024

After the creation of #117, the use of the setting allow-in-other-worlds: true has became redundant as it goes into hasCorrectIslandRank. This will always be false as there is no island at the sign where the block is placed in another world that isn't an Island.

This fixes this by adding a inWorld check, however it should be noted that this isn't a true fix.
If we wanted to implement a true fix, we would require the island where the user was last owner/had flag permissions to create a warp is used, without using "world" in the method. Getting the last primary island might be the way to go but new API would be required in order to access this as there is no way to get the world in this case in non-BSB worlds. I have added a TODO as well to make sure this isn't lost whilst reading/understanding the code whilst posing a possible solution if new API comes to light.

Currently, you can't create a warp in another world (even with permissions) as it goes into hasCorrectIslandRank. In this case, it is always false as there is no island at the block location meaning it will always go into this whilst creating a warp in other worlds.
Currently, `noLevelOrIsland and hasCorrectIslandRank` require the sign to be on an island. Currently this means the flag/level requirement are non-existent in the case of a sign being placed on a non-BSB island. This gives a possible solution if new API comes to light.
@tastybento
Copy link
Member

Thanks! Can you tell me more about what you think would be needed again? I didn't understand this part:

If we wanted to implement a true fix, the island where the user was last owner/had flag permissions to create a warp.

There seems to be some English missing there. If you had the last island something...?

@tastybento tastybento self-assigned this Jun 21, 2024
@tastybento tastybento added the in progress the issue is being worked on label Jun 21, 2024
@TreemanKing
Copy link
Contributor Author

TreemanKing commented Jun 21, 2024

Thanks! Can you tell me more about what you think would be needed again? I didn't understand this part:

If we wanted to implement a true fix, the island where the user was last owner/had flag permissions to create a warp.

There seems to be some English missing there. If you had the last island something...?

Lmao shit, I knew I stuffed up my explanation. Currently all the methods in getIslands all require a "world". We would require a method that doesn't require that but based off a UUID of a user only.

@tastybento
Copy link
Member

Okay, and what would you get and what would you do with it? I can add API.

@TreemanKing
Copy link
Contributor Author

TreemanKing commented Jun 21, 2024

Okay, and what would you get and what would you do with it? I can add API.

The methods hasIslandRank and noLevelorIsland would instead use the new API which will look for their islands directly instead of looking for the island via the sign location.

Copy link
Member

@tastybento tastybento left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check is fine as-is. The "setting warps in non-Island worlds" was a feature to make Warps available for admins who weren't even using BentoBox actually. So, the idea was that they would install BentoBox + Warps instead of the original Warps plugin. So, I don't think extra API is not needed really because in this use case there are no islands or ranks to check. Anyway, this is definitely mergable, so thanks!

@tastybento tastybento merged commit 7f9f352 into BentoBoxWorld:develop Jun 21, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress the issue is being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants