mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 11:55:38 +01:00
Revert projectile hit on splash (#3162)
* Revert projectile hit on splash * Notes about potions splashing after hit cancelled
This commit is contained in:
parent
fe65a0c548
commit
2e64ac6d25
@ -62,6 +62,13 @@ public class ProjectileEventListener implements Listener {
|
||||
this.plotAreaManager = plotAreaManager;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onLingeringPotionSplash(LingeringPotionSplashEvent event) {
|
||||
// Cancelling projectile hit events still results in area effect clouds.
|
||||
// We need to cancel the splash events to get rid of those.
|
||||
onProjectileHit(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPotionSplash(PotionSplashEvent event) {
|
||||
ThrownPotion damager = event.getPotion();
|
||||
@ -78,6 +85,11 @@ public class ProjectileEventListener implements Listener {
|
||||
}
|
||||
if (count > 0 && count == event.getAffectedEntities().size()) {
|
||||
event.setCancelled(true);
|
||||
} else {
|
||||
// Cancelling projectile hit events still results in potions
|
||||
// splashing in the world. We need to cancel the splash events to
|
||||
// avoid that.
|
||||
onProjectileHit(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user