mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-24 01:19:24 +00:00
fix(bukkit): 确保不会内存泄漏
This commit is contained in:
@@ -64,6 +64,11 @@ public class BukkitProjectileManager implements Listener, ProjectileManager {
|
||||
handleProjectileLoad(event.getEntity());
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||
public void onEntityPortal(EntityPortalEvent event) {
|
||||
this.projectiles.remove(event.getEntity().getEntityId());
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
|
||||
public void onEntityAdd(EntityAddToWorldEvent event) {
|
||||
if (event.getEntity() instanceof Projectile projectile) {
|
||||
|
||||
Reference in New Issue
Block a user