BG-Software-LLC / SuperiorSkyblock2

Optimized, feature packed Skyblock core.
https://bg-software.com/superiorskyblock/
GNU General Public License v3.0
159 stars 134 forks source link

EnderPearl privilege is broken since release #1895

Closed ArDiDEx closed 9 months ago

ArDiDEx commented 9 months ago

Minecraft's Version

pufferfish 1.19.4

Plugin's Version

SuperiorSkyblock 2023.3

Describe the bug

EnderPearl privilege is never checked due to an impossible null check and thus returns SUCCESS even if the player doesn't have the privilege on the island where he launched the enderpearl

code below shows the null check, but its impossible due to handleInteractionInternal never returning null, line 348-358 should be replaced with a return handleInteractionInternal(superiorPlayer, destination, island, IslandPrivileges.ENDER_PEARL, 0, true, false); like most of the methods in that class

https://github.com/BG-Software-LLC/SuperiorSkyblock2/blob/3fda1dd374bd941340f286ca739c9c4fc1c25ec8/src/main/java/com/bgsoftware/superiorskyblock/service/region/RegionManagerServiceImpl.java#L340-L359

Side note: the message shown when the regionmanagerservice returns anything but success is also wrong

https://github.com/BG-Software-LLC/SuperiorSkyblock2/blob/f6bebe95ddf13e73f66f83e8a2a2ff39e012757a/src/main/java/com/bgsoftware/superiorskyblock/listener/ProtectionListener.java#L371-L389

the code above should also use the ProtectionHelper to send the message as right now it always sends a message as if the player is trying to teleport outside of his island

To Reproduce

Additional Information

No response

OmerBenGera commented 9 months ago

Fixed in latest dev build, thanks for reporting