MailManager icon

MailManager -----

The Ultimate Mail Plugin



BIG UPDATE + CODE REWRITE
코드를 전체적으로 수정했습니다

I have completely modified the code.

먼저 첫번째로 치명적인 버그를 수정했습니다 권한적으로 권한이 없는 유저가 메일로 아이템을 수급할 수 있는 문제점이 있었습니다 또한 GUI 내에서 잘만하면 아이템 복사가 가능한 문제점이 있었습니다 그 문제점을 수정하였습니다

First, we have fixed critical bugs. There was an issue where users without proper authorization could obtain items via mail. Additionally, there was a problem where items could be duplicated within the GUI if done correctly. We have fixed these issues.

여기서부터는 전문적으로 써놨으니 시간 많은 분들만 보시길 바랍니다

From here on, the text is written in a professional style, so please only read it if you have plenty of time.

플레이어 검색 및 데이터 로드 최적화
가장 빈번하게 발생하던 "플레이어를 찾을 수 없습니다" 문제를 해결하기 위한 로직을 강화했습니다.

온라인 우선 검색: 검색 시 DB보다 온라인 플레이어 리스트(Bukkit.getPlayer)를 먼저 확인하여 응답 속도를 0ms 가깝게 줄였습니다.

대소문자 무시(Case-Insensitive): 유저가 대소문자를 섞어서 입력해도 DB의 LOWER() 함수나 소문자 맵핑을 통해 정확한 UUID를 찾아내도록 수정했습니다.

비동기 로드: 플레이어 접속 시 발생하는 데이터 로딩을 dbExecutor를 통해 비동기로 처리하여 메인 스레드의 렉(Tick Spike)을 방지했습니다.

데이터 유실 및 증발 방지 (Write-behind)
아이템이나 설정 데이터가 사라지는 문제를 원천 차단했습니다.

비동기 배치 플러시: 데이터 변경 시 즉시 DB에 쓰는 대신, 큐에 모았다가 일정 주기나 특정 시점에 한꺼번에 저장하여 DB 부하를 최소화했습니다.

안전한 종료(Unload) 강화: 플러그인이 비활성화될 때 flushNow()를 호출하여 큐에 남아있던 모든 메일, 블랙리스트, 언어 설정을 **동기식(Blocking)**으로 저장하고 연결을 끊도록 로직을 보강했습니다.

메모리 정리: clearAllCaches() 메서드를 통해 종료 시 모든 메모리 캐시를 비워 서버 재시작 시 발생할 수 있는 메모리 누수를 차단했습니다.

GUI 시스템 및 사용자 경험(UX) 개선
각 GUI의 독립성과 안정성을 높였습니다.

ChatListener 연동: 플레이어 검색 시 채팅 입력을 가로채는 ChatListener와 ChatSearchRegistry를 MailManager에 정식 등록하여 입력이 씹히는 문제를 해결했습니다.

부모 GUI 복귀 로직: 시간 설정이나 아이템 첨부 후, 원래 있던 전송창(MailSendGUI 등)으로 정확하게 돌아가도록 parentGuiMap과 세션 관리 로직을 정교화했습니다.

아이템 복사 방지: 첨부 GUI 등에서 saveAttachedItems 호출 시 상태 플래그를 사용하여 아이템이 중복 생성되거나 증발하는 것을 막았습니다.

코드 품질 및 성능 개선
ItemBuilder 최적화: ItemMeta를 매번 호출하지 않고 필드에 캐싱하여 아이템 생성 속도를 비약적으로 높였습니다.

가상 인벤토리 관리: 관리자용 /mail inv 기능을 위해 MailInventoryGUI 리스너를 통합 관리하도록 구조를 변경했습니다.

Base64 직렬화: MailSerializer를 도입하여 마인크래프트 버전이 바뀌어도 NBT 태그가 포함된 아이템 데이터가 깨지지 않게 보존합니다.

Optimization of Player Search and Data Loading

We have strengthened the logic to resolve the most frequently occurring "Player not found" issue.

Online-First Search: We have reduced response times to near 0ms by checking the online player list (Bukkit.getPlayer) before the database during searches.

Case-Insensitive: We have modified the system to find the correct UUID using the DB's LOWER() function or lowercase mapping, even if the user inputs a mix of uppercase and lowercase letters.

Asynchronous Loading: Data loading that occurs when a player connects is processed asynchronously via dbExecutor to prevent lag (Tick Spike) on the main thread.

Prevention of Data Loss and Evaporation (Write-behind)

We have completely eliminated the issue of item or setting data disappearing.

Asynchronous Batch Flush: Instead of writing to the DB immediately upon data changes, data is collected in a queue and saved all at once at regular intervals or specific times to minimize DB load.

Enhanced Safe Unload: We have reinforced the logic so that when a plugin is deactivated, `flushNow()` is called to save all mail, blacklists, and language settings remaining in the queue in a **synchronous (blocking)** manner and disconnect the connection.

Memory Cleanup: By using the `clearAllCaches()` method to clear all memory caches upon termination, we have prevented memory leaks that could occur during server restarts.

Improvements to GUI System and User Experience (UX)

We have enhanced the independence and stability of each GUI.

ChatListener Integration: We have officially registered the ChatListener and ChatSearchRegistry, which intercept chat input during player searches, with the MailManager to resolve the issue of input being ignored. Parent GUI Return Logic: Refined the parentGuiMap and session management logic to ensure a precise return to the original sending window (MailSendGUI, etc.) after setting the time or attaching items.

Item Duplication Prevention: Prevented duplicate item creation or item disappearance by using status flags when calling saveAttachedItems in the Attachment GUI and other areas.

Code Quality and Performance Improvements

ItemBuilder Optimization: Significantly increased item creation speed by caching in fields instead of calling ItemMeta every time.

Virtual Inventory Management: Modified the structure to integrate the management of MailInventoryGUI listeners for the /mail inv function for administrators.

Base64 Serialization: Introduced MailSerializer to preserve item data containing NBT tags, preventing corruption even when the Minecraft version changes.
----------, Mar 17, 2026
Resource Information
Author:
----------
Total Downloads: 450
First Release: May 2, 2025
Last Update: Mar 17, 2026
Category: ---------------
All-Time Rating:
6 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings