Fix block explosions damaging claimed entities #1122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does not stop block explosions damaging vehicles. Unfortunately, the EntityDamageEvent only fires for living entities. The VehicleDamageEvent is lacking information required to differentiate between damage sources. If we block all entity-free damage, we'll break the age-old "run the minecart into a cactus" automatic minecart system. Maybe needs a Spigot issue opened? Not really sure. Technically may be possible with a bunch of hacky workaround tagging.
This also does not block players using block explosions to bypass PVP restrictions - it's possible, but I'm reluctant to do so until I get around to an "owner" tagging system because I would like to preserve the self-damage aspect.
This does fully address #1115, but I think either it should be left open or a new issue should be created so we can track the remaining shortcomings.