Fixed command spam issue: Modified MMOBuffsCommand by adding the
@Default annotation to optional parameters so that default values (SET, 1, etc.) are automatically entered when omitted.
Performance Optimization (No. 2): Changed EffectHolder's ConcurrentHashMap to a standard HashMap. Significantly reduced the load on the main thread by caching (introducing the displayDirty flag) so that sorting only occurs when effects are added or removed, instead of sorting every tick during boss bar updates.
Bug and Memory Leak Prevention (No. 3): Added logic (hideBossBar) to hide and clear the boss bar object when a player exits. Introduced the reloadConfig() method so that the EffectHolder settings of players already connected are updated when /mmobuffs reload is called.
명령어 스팸 문제 수정: MMOBuffsCommand의 선택적 파라미터에
@Default 어노테이션을 추가하여 생략 시 기본값(SET, 1 등)이 자동으로 들어가도록 수정했습니다.
성능 최적화 (2번): EffectHolder의 ConcurrentHashMap을 일반 HashMap으로 변경하고, 보스바 업데이트 시 매 틱 정렬하던 것을 효과가 추가/제거될 때만 정렬되도록 캐싱(displayDirty 플래그 도입)하여 메인 스레드 부하를 대폭 줄였습니다.
버그 및 메모리 누수 방지 (3번): 플레이어 퇴장 시 보스바 객체를 숨기고 지우는 로직(hideBossBar)을 추가했으며, /mmobuffs reload 시 이미 접속 중인 플레이어들의 EffectHolder 설정도 갱신되도록 reloadConfig() 메서드를 도입했습니다.