HDR / Player_Glow_Sponge

This plugin is no longer supported, The repository has been archived, a full rewrite may happen in the future
MIT License
0 stars 3 forks source link

Player glow toggles to color even with no permission #9

Closed infamyreloaded closed 5 years ago

infamyreloaded commented 5 years ago

If you give a player the glow.toggle permission and he doesn't have permission for any of the colors. When he does the glow toggle command, it will toggle on/off a white glow.

Minecraft: 1.12.2 SpongeAPI: 7.1.0-70763aa8 Sponge: 1.12.2-7.1.4 SpongeForge: 1.12.2-2768-7.1.4 Minecraft Forge: 14.23.5.2807

HDR commented 5 years ago

This is because white is the default color for the glow effect, i don't really see a case where you would give a player the toggle permission without any color permissions.

infamyreloaded commented 5 years ago

I think there's a case where you would. We have player glow crates and the option to buy the glows in our in-game token shop. The default users get the perms glow.toggle & glow.menu. Once they get a crate from playing or buy the glow from the token shop we then give them that glow color permission. This saves us from having to give the glow.toggle & glow.menu permission each time they get a color from the crate/token shop menu. We just have to set that permission once they get it. If it's intentional and your not going to fix it then I gotta add the toggle permission to all those commands (wish I new that from the start :p). In my opinion it is a bug because they don't have permission. If they have no permission then it should toggle nothing. Anyway if you're not going to fix/change that please reply to this so I know I gotta go in and add the extra perms. Thanks for the quick response!

HDR commented 5 years ago

I think there's a case where you would. We have player glow crates and the option to buy the glows in our in-game token shop. The default users get the perms glow.toggle & glow.menu. Once they get a crate from playing or buy the glow from the token shop we then give them that glow color permission. This saves us from having to give the glow.toggle & glow.menu permission each time they get a color from the crate/token shop menu. We just have to set that permission once they get it. If it's intentional and your not going to fix it then I gotta add the toggle permission to all those commands (wish I new that from the start :p). In my opinion it is a bug because they don't have permission. If they have no permission then it should toggle nothing. Anyway if you're not going to fix/change that please reply to this so I know I gotta go in and add the extra perms. Thanks for the quick response!

It should be possible to implement a quick fix for people wanting to use the plugin this way, by checking if the user has a color permission before toggling, i can look into that.

HDR commented 5 years ago

Try this custom version i quickly threw together, you will need to remove "glow.color" as a permission and replace it with "glow.menu", since the plugin now checks for "glow.color" when a player tries to toggle the effect, meaning it should only allow toggles if a player has a color permission. hdr.glow-1.3.1.zip

infamyreloaded commented 5 years ago

Ok thank you, I will test this tonight!

infamyreloaded commented 5 years ago

It worked!