mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +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;
|
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)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onPotionSplash(PotionSplashEvent event) {
|
public void onPotionSplash(PotionSplashEvent event) {
|
||||||
ThrownPotion damager = event.getPotion();
|
ThrownPotion damager = event.getPotion();
|
||||||
@ -78,6 +85,11 @@ public class ProjectileEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (count > 0 && count == event.getAffectedEntities().size()) {
|
if (count > 0 && count == event.getAffectedEntities().size()) {
|
||||||
event.setCancelled(true);
|
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