mirror of
https://github.com/kaboomserver/weapons.git
synced 2024-05-19 19:41:21 +00:00
Don't process cancelled projectile spawns
This fixes a bug caused by an edge-case in which an explosive arrow's particles lingered forever when an explosive crossbow was fired from a chunk that is at/exceeds the entity limit. Extras cancels the EntitySpawnEvent to enforce its entity limit; which does not call EntityRemoveFromWorldEvent on cancellation, thus causing this issue.
This commit is contained in:
parent
55eb4d62ad
commit
07b830470d
|
@ -34,8 +34,12 @@ public final class WeaponExplosiveCrossbow implements Listener {
|
|||
private final List<Projectile> explosiveProjectiles = new ArrayList<>();
|
||||
private final SecureRandom secureRandom = new SecureRandom();
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onShootArrow(ProjectileLaunchEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Projectile projectile = event.getEntity();
|
||||
final ProjectileSource source = projectile.getShooter();
|
||||
|
||||
|
|
Loading…
Reference in a new issue