WorldGuard icon indicating copy to clipboard operation
WorldGuard copied to clipboard

WG issue -- blacklist.txt on-interact black list restriction stops anvil removal.

Open LadyCailinBot opened this issue 11 years ago • 10 comments

WORLDGUARD-3360 - Reported by Kainzo

[12:51:08 INFO]: WorldGuard version 6.0.0-SNAPSHOT.1575-

#Anvil2 [anvil] ignore-groups=founder,admin ignore-perms=wg.anvil2 message=Restricted completely! on-interact=deny,tell

#Anvil [145] ignore-groups=founder,admin ignore-perms=wg.anvil message=Restricted to ArtisanSmith on-place=deny,tell

LadyCailinBot avatar Feb 01 '15 17:02 LadyCailinBot

Comment by wizjany

Um, what exactly is the issue?

LadyCailinBot avatar Feb 01 '15 22:02 LadyCailinBot

Comment by Kainzo

Issue is: If we restrict "on-interact" this makes it so the player cannot remove the anvil. This could be an enhancement, but in previous versions of Worldguard, only the "on-break" prevented the removal of the block.

LadyCailinBot avatar Feb 18 '15 15:02 LadyCailinBot

Comment by wizjany

[14:14:36 INFO]: [WorldGuard] INTERACT ANVIL [CraftPlayer{name=wizjany}] @ :PlayerInteractEvent [DENY] [14:14:36 INFO]: [WorldGuard] USE DIAMOND_PICKAXE [CraftPlayer{name=wizjany}] @world :PlayerInteractEvent [14:14:37 INFO]: [WorldGuard] DIG ANVIL [CraftPlayer{name=wizjany}] @207,64,297 :BlockBreakEvent

So it seems the issue is that the server/someone is sending interact events on left click, we might need to workaround this somehow. edit: ok so blacklist events aren't aware of pre-allowed events...

LadyCailinBot avatar Feb 18 '15 19:02 LadyCailinBot

Comment by shroomdog27

Is this being looked at? I'm having the exact same issue, and it would be really nice if it was fixed.

LadyCailinBot avatar May 09 '15 19:05 LadyCailinBot

Comment by PseudoKnight

I'm not an expert on WorldGuard's internals, but should this line:

https://github.com/sk89q/WorldGuard/blob/master/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java#L332

if (Events.fireAndTestCancel(new UseBlockEvent(event, cause, clicked).setAllowed(!modifiesWorld))) {

instead be:

if (modifiesWorld && Events.fireAndTestCancel(new UseBlockEvent(event, cause, clicked))) {

Since I'm fairly certain we only really want to fire a UseBlockEvent if left-clicking modifies the block. So it should only fire for DRAGON_EGG, which is the only block in Materials that is modified on left click. (though the DRAGON_EGG might be better as a BreakBlockEvent, come to think of it)

LadyCailinBot avatar May 12 '15 00:05 LadyCailinBot

Comment by wizjany

that is indeed the line, but unfortunately that's not the solution.

LadyCailinBot avatar May 12 '15 17:05 LadyCailinBot

Comment by ZachBail

I'm here for this as well. The "on-break" event seems to be set to "on-break=deny" for everything on the blacklist. I have also not been able to add anything to the on-break event like tell or notify. I think this would be a significant fix for WorldGuard.

LadyCailinBot avatar Apr 29 '17 22:04 LadyCailinBot

Comment by lifehome

Hi, I think this issue needs a big push, as it has been 4 years and on 1.13.2, this problem still exists.

However, my problem would be when the following settings are in blacklist, neither the players can place or break the anvil. Even I have explicit setting other flags to allow the action, it still doesn't allow placing or breaking anvils.

My config in blacklist.txt:

[anvil,chipped_anvil,damaged_anvil]
ignore-perms=toughlife.player.level.advanced
on-interact=deny,tell
message=You do not have the Scroll of Advanced Magic to use anvil.

LadyCailinBot avatar Jan 06 '19 10:01 LadyCailinBot

Comment by lifehome

Give another push, I think this should be a small fix.

LadyCailinBot avatar Jan 14 '19 07:01 LadyCailinBot

We run into the same issue, we try to prevent players from opening enderchests with

[ender_chest]
on-break=allow
on-interact=deny

But the players are not allowed to destroy the blocks, becuase it is also an interaction

Wolf2323 avatar Dec 23 '20 00:12 Wolf2323