WorldGuard

WorldGuard

8M Downloads

Eggs can knockout item frams

LadyCailinBot opened this issue ยท 14 comments

commented

WORLDGUARD-3346 - Reported by TGS

Eggs spawned by other plugins (Could be fireworks too, not 100% sure) can knock out item frames with entity-item-frame-destroy set to deny

commented

Comment by sk89q

One could argue that entity-item-frame-destroy refers to destruction of the item frame and not the item inside. Then again, I would not be surprised if this behavior was inconsistent in WG.

commented

Comment by TGS

Hmm, I actually can't say for sure if the item frame itself got knocked out by the eggs, requires further testing. But definitely the item. It would make sense to protect the item too, since... it's kinda a big part of the frame.

commented

Comment by wizjany

This seems to be due to the fact that the plugins aren't setting the shooter on the projectile. If WG sees a projectile with a non-living or null shooter, it's treated under the "if it's in the region, it's a member" rule. There's no way for WG to know that it was shot from a player who doesn't have permissions.

commented

Comment by TGS

@wizjany I'm not 100% sure how WG handles it, but shouldn't WG just block everything that tries to destroy the frame?
Atleast that's how people expect it to work

commented

Comment by sk89q

Well, it's not {{item-frame-destroy}}... it's {{entity-item-frame-destroy}}.

commented

Comment by TGS

True that, but as default WG protects the frame, and I added this flag to be 100% sure any entities wouldn't destroy it (which eggs kinda does)

commented

Comment by TGS

Hi, this is beginning to be a problem, is it a easy fix or?
(I understand that you don't have much time, this is more a bump)

commented

Comment by TGS

This plugin: www.spigotmc.org/resources/lobbygun.3664/
Was able to destroy both the frame and the item.

commented

Comment by wizjany

This is an easy fix for other plugins to setShooter on the projectile. Without that, it's not intuitive for us to fix because it doesn't fall under a normal protection category. We could throw it in under an existing protection, but it could lead to unexpected behaviors.

commented

Comment by TGS

I understand that it's easy for other plugins to fix it, but sometimes you may not want to set the shooter for the projectile, if it's not actually the player who's shooting it.
This is also deprecated AFAIK: [https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Projectile.html#_INVALID_setShooter(org.bukkit.entity.LivingEntity) "This method exists for legacy reasons to provide backwards compatibility. It will not exist at runtime and should not be used under any circumstances."]

However I tested this plugin and it protected the frame if that helps: dev.bukkit.org/bukkit-plugins/frameprotect/

commented

Comment by wizjany

that's because they added a ProjectileSource interface. there's another method for it. in what situation is the projectile being fired by a non-player that should be protected?

commented

Comment by TGS

Well first of all, there's a lot of bad coded plugins (I know this is not your table, but that's the way it is) who are good at doing all kind of destructive things. Secondly you may not want to set the shooter if you're using ex protocollib to make fancy effects or shows where no player is involved

commented

Comment by wizjany

that case is still about other plugins though.

commented

Comment by TGS

I agree, it would still help a lot if WG protected it.