WorldGuard

WorldGuard

8M Downloads

Can't block Ender Crystal block damage

LadyCailinBot opened this issue · 42 comments

commented

WORLDGUARD-2620 - Reported by Kodek

There is no configuration for Ender Crystal explosion in config file. There should be 'block-endercrystal-explosions' option.

commented

Comment by Janmm14

Currently an error is shown in console (exploding endercrystal in a other-explosions: deny region):

17:21:54 [severe] Could not pass event EntityDamageByEntityEvent to WorldGuard v5.7.2
17:21:54 [javastacktrace] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
17:21:54 [javastacktrace] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
17:21:54 [javastacktrace] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
17:21:54 [javastacktrace] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.Explosion.a(Explosion.java:167)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.World.createExplosion(World.java:1632)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.WorldServer.createExplosion(WorldServer.java:814)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.World.explode(World.java:1624)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.EntityEnderCrystal.damageEntity(EntityEnderCrystal.java:67)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.EntityHuman.attack(EntityHuman.java:854)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.PlayerConnection.a(PlayerConnection.java:1103)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.Packet7UseEntity.handle(SourceFile:36)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.NetworkManager.b(NetworkManager.java:292)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.PlayerConnection.d(PlayerConnection.java:113)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.ServerConnection.b(SourceFile:35)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:30)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.MinecraftServer.r(MinecraftServer.java:580)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.DedicatedServer.r(DedicatedServer.java:225)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.MinecraftServer.q(MinecraftServer.java:476)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.MinecraftServer.run(MinecraftServer.java:409)
17:21:54 [javastacktrace] at net.minecraft.server.v1_5_R2.ThreadServerApplication.run(SourceFile:573)
17:21:54 [javastacktrace] Caused by: java.lang.NoClassDefFoundError: org/bukkit/entity/MinecartTNT
17:21:54 [javastacktrace] at com.sk89q.worldguard.bukkit.WorldGuardEntityListener.onEntityDamageByEntity(WorldGuardEntityListener.java:277)
17:21:54 [javastacktrace] at com.sk89q.worldguard.bukkit.WorldGuardEntityListener.onEntityDamage(WorldGuardEntityListener.java:432)
17:21:54 [javastacktrace] at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
17:21:54 [javastacktrace] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
17:21:54 [javastacktrace] at java.lang.reflect.Method.invoke(Unknown Source)
17:21:54 [javastacktrace] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)

commented

Comment by wizjany

unrelated, update wg

commented

Comment by sk89q

Closing this issue due to age. If someone is still interested in this issue, please make a new one or ask this one to be re-opened.

commented

Comment by Telbaru

Is it possible to reopen this issue? we have interessting in this option.

commented

Comment by Telbaru

We want to use the Ender Crystal as decoration so we need some Options to protect them and disable the Blockdamage.

commented

Comment by Darunia18

Are we able to open this back up? Now that Ender Crystals are obtainable in survival, I think it's important to be able to disable it from destroying blocks.

commented

Comment by rtcabooservb

Also think it is important to be able to limit block damage. Would love a fix. :)

commented

Comment by wizjany

it's not closed, and there's nothing to fix. it's a feature request.

commented

Comment by PseudoKnight

It works as expected. Non-members cannot damage end crystals and cause them to explode. Explosions do no damage if other-explosion flag is set to deny. So the only thing left here is a configuration option. But it should be known to those that have this issue that the other-explosion flag is the way to disable the block damage from this.

commented

Comment by andrewkm

@PseudoKnight Those not part of region can not only place them but also left click them to blow them up.
spigot 758 wg 1653 we 3459�

commented

Comment by PseudoKnight

Cannot confirm. Regular region blocked both direct damage and projectile fire for non-members. I didn't test placing them, though. That might still be an issue.

commented

Comment by PseudoKnight

Actually, no, players can't place them either. I know that because I had a region covering the end portal and someone wanted to respawn the enderdragon and couldn't.

commented

Comment by PseudoKnight

Right now lightning can destroy these and it seems the only way to block this is with ExplosionPrimeEvent. None of the other expected events seem to be firing. There's no block or entity damage from the explosion, but it does get destroyed.

commented

Comment by andrewkm

So I'm assuming this is a request for a new configuration option?

commented

Comment by mibby

Any update to this? Still can't block end crystal block damage. :(

commented

Comment by wizjany

i was under the impression from previous comments that it could be protected (such as via regions?), but not specifically (such as via a single config or flag?)
is this incorrect?

commented

Comment by wizjany

either way if this is to be fixed in WG we will likely have to pretend the interact is an explode or something to fix it, might be a big hack

commented

Comment by andrewkm

Would love a fix on this as well :) I've simply had them blocked from placement for ages to avoid the issue.

commented

Comment by PseudoKnight

The best solution I can think of (besides adding an "unnecessary and redundant" flag) is possibly adding EnderCrystal to the isConsideredBuildingIfUsed() method. This would protect it under the build flag on damage before an explosion would occur. There'd also need to be a SpawnEntityEvent created for it too under handleBlockRightClick().

commented

Comment by wizjany

the following behaviors have been changed/added:

  1. if a user can interact in a region, (eg due to interact flag = allow) they will additionally need build permissions to explode an endercrystal
    2a) if an endercrystal does go off (because it was in an unprotected area, or because a user had build permissions), damage is filtered by the other-explosion flag, so if that flag is deny, blocks will be protected (but the crystal will still explode)
    2b) if an endercrystal does go off, damage is still normally filtered by cause, so if a player exploded the crystal, that player would need build permissions in any regions affected by the explosion. (eg - red is protected region, https://gfycat.com/InsignificantYawningBaboon)

currently the way lightning works, it is considered a member by the region (because it is in the region), and thus can explode the endercrystals. setting other-explosion to deny will still prevent the damage, but the crystal will still disappear. currently unsure how worldguard should otherwise handle this, if at all. pseudoknight mentioned that an explosionprimeevent gets thrown, so i can look into adding that if this behavior is needed. (feedback needed)

i am going to opt to not add more config flags, since i believe the existing protection mechanisms should be enough.

commented

Comment by mibby

I still think a global config setting to disallow block damage from the endercrystal would be nice. So you can still allow explosions globally but prevent damage to the world.

In any case, thanks wizjany. :)

commented

Comment by Enatras

Verified, block other-explosions now prevents destroying blocks with an endercrystal, BUT:

It is possible to damage nearby playsers in a pvp: deny area by destroying endercrystals. This is a problem because of some kiddies using this to kill people in a trap...

commented

Comment by wizjany

that should be handled by the "explosion-flags-block-entity-damage" config setting just like all the other explosions.

commented

Comment by Enatras

Negative, "explosion-flags-block-entity-damage: true" but players getting damage when a endercrystal is destroyed.

commented

Comment by wizjany

I see, endercrystal explosions aren't linked to the player that hit them, so there was no player in the cause chain. I've added another check, so the setting should work correctly now even without a player cause.

commented

Comment by Enatras

Thanks a lot! This was annoying for months! Using the flag 'other-explosions: DENY' everything works now fine!

commented

Comment by mibby

@wizjany But no 'block-endercrystal-block-damage' or 'block-other-explosions-block-damage' global setting? I'd rather avoid having to flag many regions individually if block-damage can be blocked specifically like tnt, creeper, wither, wither-skull, enderdragon, and fireball can in the config.yml.

A 'block-other-explosions' setting does exist, so I think a 'block-other-explosions-block-damage' would be nice as a complimentary setting to go along with it.

commented

Comment by mibby

@wizjany Bump. Any possibility on a global config setting to disable end crystal block damage? :(

commented

Comment by PseudoKnight

@mibby you don't have to set the flag to tons of regions if you want to protect the entire world from other explosions. Just simply set the flag on global for each world you want it to apply.

commented

Comment by mibby

But I don't want to protect the entire world from 'other explosions'. Just block endercrystal block damage specifically. :( For consistency with the other global block-damage toggles, it would be nice to have another block-damage config setting in the main config.

commented

Comment by mibby

Not that I am currently aware of. Players are able to hit the end crystal and it explodes, doing block damage. Even in protected regions as evident by complaints I have received from it being hit at spawn. =/ Which is why I'd love to have a setting to disable the block damage for it globally, forcefully.

commented

Comment by PseudoKnight

As mentioned above, I was able to protect against placement/damage (via membership) and block destruction (via flag). The only exception is lightning strikes, which I can't protect them from.

commented

Comment by PseudoKnight

I tested again to confirm my statements on new builds. I will note that if you set "interact allow", it lets nonmembers destroy the end crystals. It's possible people are setting that or other flags without realizing what they do.

commented

Comment by mibby

That would be part of my problem in my spawn region - where players are able to explode the crystal. I allow interact so players can interact with buttons and doors. Though I haven't been successful in limiting all block damage caused by the crystal globally elsewhere, since I only want to limit block damage, not disable explosions in general.

Hopefully a global setting toggle can be added to limit block damage of the crystal everywhere regardless of flag settings. :)

commented

Comment by PseudoKnight

The interact flag is very broad, even allowing chest access. I'd suggest setting the use flag instead.

commented

Comment by mibby

Problem though is with interact flag removed, players can't sit in chairs using the craftbook mechanic. :P So kind of forced to keep it enabled. I have both use and interact flagged allow.

commented

Comment by PseudoKnight

Then I'd suggest maybe creating regions around things you do not wish to be interacted with, or vice versa by adding regions around things you do wish players to interact with. Also keep in mind that you can add things like doors and levers to the interaction whitelist in the world's config so that regions never block them. (which is what I do.)

commented

Comment by PseudoKnight

Though, I don't know why WG would interfere with Chairs in Craftbook, as it just requires clicking a stair block, which if I'm not mistaken is not blocked by regions.

commented

Comment by mibby

That can lead to a large amount of unnecessary and redundant regions though. I think a simple block damage setting to globally disable it for the crystal would be preferred.

RE: Chairs. Might be something to ask wizjany or Me4502. I find it odd too that it interferes with interacting with a craftbook chair. Maybe because the region blocks the interact event thrown when right clicking, which craftbook listens for to sit?

commented

Comment by wizjany

pretty sure craftbook actually checks WG api. it might just be a matter of having craftbook check a different flag.

commented

Comment by PseudoKnight

I don't see any mention of WorldGuard in the CraftBook code. I can't think what it would be.

If it's not giving the WG deny message, I would suggest using the debug commands.