EssentialsX

EssentialsX

2M Downloads

Blocking powertools?

FrankHeijden opened this issue · 7 comments

commented

EssentialsX version (/essentials):
b530
Server software (/version):
git-Spigot-93e20b3-e8b6e4f (MC: 1.12.2)

Heya,
Whenever i try to block powertools using WorldGuard or GriefPrevention claims, essentials still let them bypass the block.

I used the command /rg flag {region} blocked-cmds /home,/spawn for example to block some commands in a worldguard region, but when a user has a powertool of /home on a block, they are still allowed to process the command.

Is there a way this could be fixed/done?

Thanks 👍

commented

@Drkmaster83 If it is the case that dispatchCommand doesn't fire a PlayerCommandPreprocessEvent, then I can see why the two approaches above could make sense. This would allow power tools to respect EssentialsX features like mutes, command cooldowns and social spy, while also letting other plugins block powertools.

However, I prefer the idea of using Player.chat over firing our own PlayerCommandPreprocessEvent, as I've encountered a few issues where custom events that extend the API are fired without fully implementing the event, causing errors when EssentialsX tries to handle them which are incorrectly traced back to EssentialsX.

@EssentialsX/contributors Thoughts?

commented

@md678685 Yeah, I just didn't know if using dispatchCommand was purposeful or not, as Player.chat was used for the command starting with c:. Just wanted to bring light onto the problem, I did some research and I could probably test with dispatchCommand and the event.

One thing's for sure, it exists as an issue.

commented

https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java#L633
The problem is when getServer().dispatchCommand(user.getBase(), command) is called, this can be fixed by calling .chat(), as that causes a PlayerCommandPreprocessEvent that WorldGuard catches.
Opinions? @md678685
I guess you could either call a PlayerCommandPreprocessEvent or just leave it how it is.

commented

Any updates on this? I ran into the same issue. I am really looking forward for this to be fixed.

commented

Add /powertool to the blocked-cmds

commented

That wouldn’t work, as people could then set a powerfool somewhere else and still execute the powertool

commented

This has now been fixed - you can download the latest version from the build server.