mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-16 07:35:23 +01:00
Check mob-damage for potion splashes from e.g. witches.
Note that bypass bypasses this if the player with bypass is the target of the potion, but only for the player with bypass. Fixes #2134.
This commit is contained in:
parent
2ea50689b9
commit
b73a0a7179
@ -1015,7 +1015,6 @@ public void onPotionSplash(PotionSplashEvent event) {
|
||||
|
||||
// Fire item interaction event
|
||||
Events.fireToCancel(event, new UseItemEvent(event, cause, world, potion.getItem()));
|
||||
|
||||
// Fire entity interaction event
|
||||
if (!event.isCancelled()) {
|
||||
int blocked = 0;
|
||||
@ -1027,8 +1026,11 @@ public void onPotionSplash(PotionSplashEvent event) {
|
||||
? new DamageEntityEvent(event, cause, affected) :
|
||||
new UseEntityEvent(event, cause, affected);
|
||||
|
||||
// Consider the potion splash flag
|
||||
// Consider extra relevant flags
|
||||
delegate.getRelevantFlags().add(Flags.POTION_SPLASH);
|
||||
if (potion.getShooter() instanceof LivingEntity shooter && !(shooter instanceof Player) && affected instanceof Player) {
|
||||
delegate.getRelevantFlags().add(Flags.MOB_DAMAGE);
|
||||
}
|
||||
|
||||
if (Events.fireAndTestCancel(delegate)) {
|
||||
event.setIntensity(affected, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user