void OnEntityDeath(BaseCombatEntity entity, HitInfo hitInfo) { try { if (entity == null || !entity.IsValid() || !IsValidType(entity) || entity is BasePlayer) { return; } if (hitInfo?.Initiator is BasePlayer) { var boxId = entity.net.ID; if (!boxCache.ContainsKey(boxId)) { return; } boxCache[boxId].OnDestroyed(hitInfo.InitiatorPlayer); } } catch { } }