akdukaan / GPFlags

GriefPreventionFlags is a Minecraft plugin to allow players to customize their GriefPrevention claims with claimflags.
GNU General Public License v3.0
17 stars 20 forks source link

Riding a pet (from SimplePets or other plugins) allows you to bypass the NoEnter flag #44

Closed iLemon closed 1 year ago

iLemon commented 1 year ago

Describe the bug Riding a pet (from SimplePets or other plugins) allows you to bypass the NoEnter flag

To Reproduce Steps to reproduce the behavior:

  1. Install SimplePets (https://ci.pluginwiki.us/job/SimplePets_v5/)
  2. Set a claim with NoEnter
  3. Summon a pet on an alt account, and ride the pet into the claim

Expected behavior Ideally it should kick the player off the pet, similar to how it works with boats

Versions:

akdukaan commented 1 year ago

Looks like I had already written something to fix this for Purpur ridables, but didn't consider ridable pet plugins like SimplePets. I'm pushing a commit to broaden my Purpur ridables fix to work on any entity that has a rider, and this should fix issues with most ridable pet plugins. SimplePets does not mark ridable pets as having a rider, so my fix won't work on it until they add that. I've mentioned it to the SimplePets dev brainsynder, and he said he'll add it in. Be on the lookout for that. Note that my fix also only works on Paper servers and its forks so if you're using Spigot, this won't work on your server.

Additionally, brainsynder already has a plugin that could solve your issue. I think you can at least use it as a temporary solution until SimplePets start to mark pets as having riders.

brainsynder-Dev commented 1 year ago

to be more specific (now that I'm home) here is a link to the resource page

akdukaan commented 1 year ago

I have a few corrections to make to my previous comment. It looks like getRider is a Purpur-specific method for getting the rider of a Purpur ridable. I needed to look at hasPassengers, and I've fixed this for the next GPFlags version. Since SimplePets already adds passengers, just updating to GPFlags 5.12.7 will fix this issue.