BentoBoxWorld / Warps

BentoBox add-on for Welcome Warp Signs
Eclipse Public License 2.0
10 stars 12 forks source link

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

Closed TreemanKing closed 4 months ago

TreemanKing commented 4 months ago

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.

tastybento commented 4 months ago

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

TreemanKing commented 4 months ago

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 commented 4 months ago

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

TreemanKing commented 4 months ago

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.