D
๐Ÿ“Ž 1 file 52,568 chars
๐Ÿ“„
SprintClan_MASTER_SPEC_KODARI_LIMIT_SAFE.txt
txt 2954 lines
โ–ถ
SPRINTCLAN โ€” COMPLETE DEVELOPMENT / BUG-FIX MASTER SPEC
IMPORTANT: This is a compacted version of the full specification for AI input limits.
All substantive requirements are retained. Do not treat shortening as permission to
skip any requirement. Inspect the existing project first and preserve working systems,
data, configuration, architecture, commands, permissions, placeholders, and GUIs.
Fix confirmed bugs and implement requested features only. Never reset or overwrite data.

SPRINTCLAN โ€” FULL REBUILD / COMPLETE DEVELOPMENT & BUG-FIX SPECIFICATION

PROJECT GOAL

Rebuild/fix SprintClan from the existing project carefully and professionally.

This document combines the complete requirements, bugs, INVENTORY GUI issues, command
issues, placeholder issues, role/member-management requirements, clan points,
allies, configuration, messages, compatibility, persistence, graceful
shutdown, crash safety, startup stability, and every important problem
reported during development.

IMPORTANT:
This is NOT permission to blindly rewrite everything.

The existing SprintClan project must be inspected first. Preserve working
systems and existing data. Only replace/rewrite code when the current
implementation is actually broken, incomplete, unsafe, duplicated, or
incompatible with the requirements below.

The final result must be a stable, maintainable, production-ready clan
plugin.

1. NON-NEGOTIABLE RULE โ€” DO NOT BREAK THE CURRENT PLUGIN

Before changing anything:

1. Map the existing source tree.
2. Identify the current architecture.
3. Identify existing services, models, commands, listeners, database code,
   cache, INVENTORY GUI framework, PlaceholderAPI expansion, and configuration system.
4. Trace existing data flow.
5. Identify confirmed bugs.
6. Make the smallest safe change that fixes each issue.

DO NOT:

- create a completely unrelated architecture
- create duplicate clan services
- create duplicate invitation services
- create duplicate INVENTORY GUI frameworks
- create duplicate databases
- replace SQLite without a real requirement
- replace the existing PlaceholderAPI expansion unnecessarily
- remove working commands
- remove working permissions
- remove working placeholders
- remove working INVENTORY GUI routes
- change existing scoring rules without an explicit requirement
- change role hierarchy without an explicit requirement
- delete user data
- reset user data
- overwrite existing configuration
- remove unrelated features
- perform speculative "optimization"
- rewrite the entire plugin just to make code look cleaner

If something already works correctly, leave it alone.

Every modification must have a reason.

2. TARGET MINECRAFT / SERVER COMPATIBILITY

Target compatibility:

1.21.11 through 1.26.2+

Maintain Paper-compatible architecture.

Avoid unnecessary version-specific implementations.

Use APIs safely and preserve compatibility with the target range.

Do not introduce deprecated APIs if an appropriate compatible API exists.

3. EXISTING ARCHITECTURE TO PRESERVE

Audit and preserve the current:

- ClanCommand
- Admin/UClan command system
- ClanService
- Clan model
- Clan member model
- Role model
- ClanInvitation model
- relation/alliance system
- SQLite database layer
- DatabaseManager
- cache
- GUIManager
- existing INVENTORY GUI classes
- MessageUtil
- PlaceholderAPI expansion
- config.yml
- messages.yml
- menu.yml
- INVENTORY INVENTORY GUI configuration if present
- roles.yml
- plugin.yml
- listeners
- task/scheduler system
- existing command aliases

Do not create parallel implementations when the existing system can be fixed.

4. REMOVE PROHIBITED SYSTEMS

Remove stale/unused references to systems that were explicitly removed:

- Gradient
- gradient
- Rival
- Rivalry
- Clan War
- War
- ClanWar

Audit:

- Java source
- resources
- plugin.yml
- commands
- permissions
- INVENTORY GUI
- messages
- placeholders
- config
- registrations

Remove only confirmed remnants of these prohibited systems.

KEEP ALLY functionality.

Do not remove or damage unrelated PvP functionality.

5. CLAN COMMAND SYSTEM

The main command:

/clan

must be reliable.

If /team is an existing alias, the same system must also work through:

/team

Do not create a second Team system.

Every subcommand must:

- execute correctly
- check permission
- validate arguments
- show useful usage when incomplete
- show useful error messages
- support appropriate tab completion
- never silently return a blank response

Important paths to audit:

/clan
/clan help
/clan create 
/clan invite 
/clan promote 
/clan demote 
/clan member ...
/clan kick ...
/clan leave
/clan disband
/clan ally ...
/clan color ...
/clan settings ...
/clan profile ...
/clan info ...
/clan list
/clan top
/clan changeleader ...
/clan desc ...
/clan modtag ...
/clan role ...

Preserve any additional existing commands that are already part of SprintClan.

6. COMMAND GUIDANCE โ€” NO BLANK RESPONSES

A major existing bug was incomplete commands returning blank or confusing
output.

Fix all command paths.

Examples:

/clan promote

must show:

Usage: /clan promote 

instead of a blank message.

Same for:

/clan demote
/clan invite
/clan create
/clan ally
/clan member
/clan role
/clan settings
/clan profile
/clan top
/clan list
etc.

Malformed arguments must receive a useful configurable response.

All messages must be editable in messages.yml.

7. MESSAGES.YML โ€” ALL PLAYER-FACING TEXT

Every player-facing message must be configurable.

This includes:

- command usage
- permissions
- errors
- internal errors
- clan creation
- clan creation confirmation
- clan deletion/disband
- leave
- joined
- kicked
- invite
- accept
- deny
- expired invitation
- promote
- demote
- change role
- role hierarchy errors
- member-management errors
- clan chat enabled
- clan chat disabled
- same-clan PvP protection
- ally PvP protection
- ally requests
- ally accept
- ally deny
- color selection
- settings
- profile
- clan info
- top/list
- statistics
- empty states
- database/persistence errors where player-facing
- every new feature added during development

Use simple, readable YAML.

Do not hardcode new messages in Java.

If a matching key already exists, reuse it.

IMPORTANT:
Adding a YAML key is not sufficient.

Verify that Java actually loads and uses every relevant key.

Do not create unused message keys.

8. CONFIGURATION FILE SAFETY

Existing files:

messages.yml
menu.yml
roles.yml
config.yml

must never be overwritten if they already exist.

Correct behavior:

IF FILE EXISTS:
    load existing file
    preserve it
    do not overwrite it

IF FILE DOES NOT EXIST:
    create the default file

Fix startup warnings such as:

Could not save messages.yml because messages.yml already exists.
Could not save menu.yml because menu.yml already exists.
Could not save roles.yml because roles.yml already exists.

Do not fix this by deleting user files.

Do not reset existing configuration.

New configuration keys must be added safely while preserving existing values.

9. SIMPLE YAML CONFIGURATION

All important editable settings should be simple and understandable.

The owner should be able to edit:

- clan member limit
- clan points
- INVENTORY GUI slots
- INVENTORY GUI materials
- INVENTORY GUI names
- INVENTORY GUI lore
- INVENTORY GUI sounds
- role settings
- messages
- invitation settings
- color settings
- clan settings

Avoid unnecessary deep/nested configuration.

Example:

clan:
  max-members: 20

clan-points:
  opposing-clan-kill: 1

Use the project's existing structure if equivalent settings already exist.

Do not duplicate settings.

10. COMPLETE INVENTORY GUI CONFIGURATION

Use the existing INVENTORY GUI architecture.

Important INVENTORY GUI properties should be configurable:

- title
- size
- slot
- material
- display name
- lore
- custom model data if supported
- enchantments if supported
- item flags if supported
- click action
- navigation slots
- sounds
- enabled/disabled state
- empty states

Every important main-menu button must have an editable slot.

Changing a slot in the YAML must actually move the button.

Prevent or safely report slot collisions.

11. MAIN CLAN INVENTORY GUI

Main /clan INVENTORY GUI should contain useful existing routes:

- Clan Info
- Clan Top
- All Clans
- Profile
- Color
- Settings
- Roles
- Members
- Allies
- Statistics
- Clan Chat

Do NOT include:

- Leave Clan
- Disband Clan

Leave and disband remain command-based.

Do not add unnecessary buttons.

Every button must have a real action.

12. MAIN INVENTORY GUI SLOT EDITING

Allow configuration of slots for:

- Clan Info
- Clan Top
- All Clans
- Profile
- Color
- Settings
- Roles
- Members
- Allies
- Statistics
- Clan Chat
- other existing main actions

The owner must be able to change them without Java edits.

13. INVENTORY GUI NAVIGATION

Every child INVENTORY GUI must have proper navigation.

Example:

Main INVENTORY GUI
-> Color INVENTORY GUI
-> Back
-> Main INVENTORY GUI

Main INVENTORY GUI
-> Roles
-> Role Editor
-> Back
-> Roles

Main INVENTORY GUI
-> Members
-> Member Management
-> Back
-> Members

Do not force the player to close and reopen /clan.

Close must close the INVENTORY GUI.

Previous/Next should only exist when there is actually more than one page.

Do not add unnecessary pagination controls.

14. INVENTORY GUI SOUNDS

Use the existing configurable sound system.

Support appropriate sounds for:

- open
- click
- success
- error
- back
- close
- invite
- accept
- deny
- promote
- demote
- kick
- color selection
- settings toggle

Sounds should match the action.

Do not hardcode sounds when the existing YAML system supports configuration.

15. CLAN COLOR SYSTEM

The Clan Color INVENTORY GUI currently has multiple problems.

Fix all of them.

The INVENTORY GUI must not show generic stone blocks for colors.

Use an appropriate dye/material for each color.

Examples:

RED -> RED_DYE
BLUE -> BLUE_DYE
GREEN -> GREEN_DYE
YELLOW -> YELLOW_DYE
WHITE -> WHITE_DYE
BLACK -> BLACK_DYE
ORANGE -> ORANGE_DYE
PINK -> PINK_DYE
PURPLE -> PURPLE_DYE
CYAN -> CYAN_DYE
LIME -> LIME_DYE
MAGENTA -> MAGENTA_DYE
LIGHT_BLUE -> LIGHT_BLUE_DYE
LIGHT_GRAY -> LIGHT_GRAY_DYE
GRAY -> GRAY_DYE
BROWN -> BROWN_DYE

Use all supported colors that the existing system is designed to support.

Do not unnecessarily split colors into page 2.

If all supported colors fit on page 1, keep them on page 1.

The selected color must have a clear selected state.

Do not duplicate lore such as:

Click to select
Click to select

The color INVENTORY GUI should be clean and professional.

16. COLOR DISPLAY

Every place showing a clan color must show the actual color.

Audit:

- Color INVENTORY GUI
- All Clans
- Clan Top
- Clan Info
- Profile
- placeholders
- other clan displays

Example:

Color: Blue

not:

Color:

and not an internal ID.

17. CLAN COLOR PERSISTENCE

Color selection must:

- validate permission
- update the clan
- persist to database
- update cache
- refresh open GUIs
- update placeholders

Do not require unnecessary points/unlocks unless already required by the
existing intended design.

18. PLAYER CLAN PLACEHOLDER

Audit the existing player clan placeholder.

The placeholder displayed next to the player name must correctly show the
player's clan tag.

If the intended placeholder is:

%sprintclan_player_clan_tag_colored%

it must return the colored tag with brackets when that is its defined format.

Example:

[Hies]

with the clan color applied.

If the player has no clan:

return an EMPTY value.

Do not return:

null
none
N/A

Do not show brackets when there is no clan.

19. SCOREBOARD CLAN PLACEHOLDER

Audit the scoreboard clan placeholder.

If the existing intended placeholder is:

%sprintclan_player_clan_colored%

or another existing SprintClan clan placeholder, make sure it works correctly
on the scoreboard.

It must use the current player's clan and color.

No-clan result:

EMPTY

not "-".

Do not query SQLite every scoreboard update.

Use the existing cache.

Update cached values after clan/color/tag/member changes.

20. TOP PLACEHOLDERS

Preserve and fix useful existing leaderboard placeholders:

%sprintclan_top_points_score%
%sprintclan_top_points_name%

Audit actual output.

If AJLeaderboards is already used for displaying top 10, integrate cleanly
instead of creating a duplicate leaderboard system.

Do not create excessive new placeholders.

21. CLAN TOP INVENTORY GUI

Clan Top must display CLANS.

Remove unnecessary category buttons such as:

- Kills
- Deaths
- Members
- Online

The main Clan Top view should focus on clan leaderboard information.

Show useful details:

- rank
- clan tag
- clan name where available
- points
- color
- useful member information where appropriate

Do NOT show "(online)" if online count is not requested.

Color must display correctly.

Fix pagination.

Previous/Next only when needed.

22. ALL CLANS INVENTORY GUI

Keep All Clans in the main Clan INVENTORY GUI.

All Clans should show real data:

- clan tag
- clan name
- color
- points
- useful basic information

Color field must show the color name.

Clicking a clan opens the correct Clan Information page.

Do not redirect to unrelated GUIs.

Use pagination only when necessary.

23. CLAN INFORMATION

Show real current data.

Clan Created:

show ONLY the date.

Do not show unnecessary:

- hours
- minutes
- seconds
- raw timestamp

Remove "Verified" from Clan Information if it is currently displayed and not
required.

Color:

show actual color name.

Points:

show current points.

Members:

show correct data.

24. CLAN CREATION CASE

If the player enters:

/clan create Hies

preserve the entered capitalization:

Hies

Do not automatically change it to:

HIES

or:

hies

Duplicate checking can be case-insensitive if necessary, but display/storage
should preserve the entered capitalization.

25. CLAN MEMBER LIMIT

Maximum clan members must be configurable.

Example:

clan:
  max-members: 20

Enforce at every normal join path:

- invitation accept
- direct join if supported
- normal membership creation

Re-check the limit during invitation acceptance.

Preserve any existing admin forcejoin bypass configuration.

Do not create a second member-limit system.

26. CLAN POINTS

IMPORTANT RULE:

Clan points are awarded ONLY when a player from one clan kills a player from
another opposing clan.

Example:

Clan A member kills Clan B member
-> award configured clan points.

Do NOT award clan points for:

- same-clan kills
- ally kills
- normal PvP between players with no opposing clan relationship

Preserve the existing point amount/configuration.

Example:

clan-points:
  opposing-clan-kill: 1

Do not create a second scoring system.

Protect point persistence and prevent duplicate rewards.

27. CLAN CHAT

Clan Chat must actually work.

When enabled:

- intercept clan chat correctly
- send to appropriate clan members
- persist the setting if the existing system supports persistence

When disabled:

- return to normal chat behavior

Messages:

&aClan chat enabled.
&cClan chat disabled.

All configurable in messages.yml.

28. FRIENDLY FIRE

If same-clan friendly fire is disabled:

block damage between clan members.

Show:

&cYou can't hit your clan member.

If enabled, preserve existing behavior.

Do not change combat logic unnecessarily.

29. ALLY PvP PROTECTION

If ally PvP is disabled:

block damage between allied clan members.

Show:

&cYou can't hit an allied clan member.

Make the message configurable.

Do not break ally functionality.

30. ALLY SYSTEM

Keep Allies.

Remove Rival/Rivalry/War only as specified.

The Ally INVENTORY GUI must be clean.

If there is no alliance:

show a simple guide such as:

Use /clan ally  to send an alliance request.

Do not use unnecessary example text.

When an ally exists:

- hide the guide
- show actual allies
- show useful ally information
- provide correct actions

The guide button must not simply disappear when clicked without doing the
intended action.

Use the existing ally service.

31. ALLY COMMANDS

Audit:

/clan ally
/clan ally 
/clan ally accept ...
/clan ally deny ...

Use the project's existing syntax if different.

Incomplete commands must show guidance.

Uppercase/lowercase clan tags must behave consistently.

No silent relation failures.

32. ROLE SYSTEM

Role management must be easy and professional.

Preserve the existing role architecture.

Role list/editor should show:

- role name
- display name/prefix
- priority
- member count
- permissions
- actions

Make controls clear.

If click behavior is used, clearly define:

Left click
Right click
etc.

Do not add confusing interactions.

33. ROLE PERMISSION EDITOR

Authorized users can edit role permissions.

Show:

Permission
Current State

Use clear colors:

ENABLED = GREEN
DISABLED = RED

Permission changes must persist.

Keep hierarchy and security checks.

Do not allow unauthorized role editing.

34. ROLE PROMOTE / DEMOTE / CHANGE ROLE

Member Management INVENTORY GUI must provide easy:

- Promote
- Demote
- Change Role
- Kick
- Profile

Promote/Demote must use the existing role service.

Do not allow forbidden self-actions.

Examples:

You cannot promote yourself.
You cannot demote yourself.
You cannot kick yourself.

Keep leader protection.

Keep role priority hierarchy.

A user cannot assign a role above their allowed hierarchy.

35. PROMOTE/DEMOTE ROLE MESSAGE

Promotion message must show the NEW role.

Example:

&8[&aClan&8] &f%player% &ahas been promoted to &b%role%&a.

Demotion:

&8[&eClan&8] &f%player% &ehas been demoted to &7%role%&e.

Change role:

&8[&aClan&8] &f%player% &ahas been assigned the role &b%role%&a.

%role% must resolve to the actual readable role name after the operation.

Do not show internal IDs.

Do not show the old role.

36. MEMBER JOINED MESSAGE

After successful invitation acceptance and membership persistence:

send configurable clan-wide joined message.

Example:

&8[&aClan&8] &f%player% &ahas joined the clan.

Do not send before persistence succeeds.

37. MEMBER LEFT MESSAGE

Voluntary leave:

remove membership
-> persist
-> update cache
-> send left message

Example:

&8[&eClan&8] &f%player% &ehas left the clan.

Do not use kick message.

38. MEMBER KICKED MESSAGE

Kick:

permission/hierarchy validation
-> remove member
-> persist
-> update cache
-> send kick message

Example:

&8[&cClan&8] &f%player% &chas been kicked from the clan.

Optional individual message:

&cYou have been kicked from &f%clan%&c.

Do not send the leave message for a kick.

39. COMPLETE CLAN INVITE SYSTEM

Required command:

/clan invite 

If /team is an alias:

/team invite 

Use the existing ClanInvitation and ClanService.

Do not create duplicate invitation architecture.

40. INVITE FLOW

/clan invite 

must execute:

command
-> permission
-> sender validation
-> sender clan validation
-> role permission
-> target lookup
-> self check
-> target clan check
-> member limit
-> duplicate check
-> create existing invitation
-> database persistence
-> cache update
-> sender notification
-> target notification
-> InvitationsGUI

Every step must be real.

41. INVITE VALIDATION

Prevent:

- invite without clan
- invite without permission
- self invite
- invalid/offline target
- target already in clan
- duplicate invite
- clan full

Accept must re-check:

- invitation exists
- invitation is not expired
- source clan exists
- target is not already in a clan
- member limit
- required permission

42. INVITE MESSAGES

Use messages.yml.

Suggested structure:

invite:
  usage: "&cUsage: /clan invite "
  no-permission: "&cYou don't have permission to invite players."
  no-clan: "&cYou are not in a clan."
  player-not-found: "&cPlayer not found or is offline."
  self: "&cYou cannot invite yourself."
  already-in-clan: "&cThat player is already in a clan."
  clan-full: "&cYour clan is full."
  already-invited: "&cThat player already has a pending invitation."
  sent: "&aYou invited &f%player% &ato your clan."
  received: "&aYou have been invited to join &f%clan%&a."
  accepted: "&aYou joined &f%clan%&a."
  denied: "&cYou denied the invitation from &f%clan%&c."
  expired: "&cThis invitation has expired."
  no-invitation: "&cYou don't have a pending clan invitation."

Reuse equivalent existing keys.

Verify Java uses them.

43. INVITATION INVENTORY GUI

Use the existing InvitationsGUI.

Show:

- clan
- tag
- leader if available
- expiration/status if supported

Buttons:

Accept
Deny
Back
Close

Every button must work.

Accept:

validate
-> membership persist
-> invitation remove
-> cache update
-> INVENTORY GUI refresh
-> messages

Deny:

validate
-> remove invitation
-> persist
-> cache update
-> INVENTORY GUI refresh
-> message

Expired invitations cannot be accepted.

44. INVITATION TAB COMPLETION

/clan invite 

suggest valid online players.

Do not suggest:

- sender
- players already in a clan
- invalid targets

Respect invite permission.

45. INVITATION PERSISTENCE

Non-expired invitations must survive reload/restart using existing database
persistence.

Do not wipe them during /uclan reload.

Expired invitations must not become usable.

46. DISBAND

Disband is command-only.

No Disband button in INVENTORY GUI.

Require explicit Yes/No confirmation.

Only execute destructive operation after Yes.

Use messages.yml.

Use safe transaction handling.

Never partially delete clan data.

47. LEAVE

Leave is command-only.

No Leave Clan button in INVENTORY GUI.

Use appropriate configurable messages.

48. DATABASE SAFETY

Protect:

- clans
- members
- roles
- role permissions
- invitations
- allies
- colors
- settings
- points
- statistics
- point history
- tags
- all existing persistent data

Do not delete/reset/recreate the database.

Preserve SQLite.

For multi-step operations:

BEGIN TRANSACTION
-> validate
-> perform operations
-> COMMIT
-> update cache

If anything fails:

ROLLBACK
-> keep previous cache
-> log complete exception
-> send configurable error

Do not claim success before commit.

49. CACHE SAFETY

Database is the source of truth.

Correct:

DATABASE SUCCESS
-> COMMIT
-> CACHE UPDATE
-> INVENTORY GUI/PLACEHOLDER REFRESH

Incorrect:

CACHE UPDATE
-> DATABASE
-> failure

Do not leave stale successful cache state after failed persistence.

50. SAFE CLAN CREATION

Do not rewrite the current creation system unless broken.

For persistent creation:

validate
-> transaction
-> create clan/default required records
-> commit
-> cache
-> existing success flow

Failure:

rollback
-> remove temporary state
-> log error
-> existing configurable internal error

No partial clan.

51. SAFE MEMBER/ROLE OPERATIONS

Protect:

- invite accept
- join
- leave
- kick
- promote
- demote
- change role
- leader transfer
- forcejoin
- forcekick if existing

Do not change their intended behavior.

Only improve safety and confirmed bugs.

Never send success before persistence.

52. POINT/STATISTICS SAFETY

Do not change point rules.

Protect:

- points
- kills
- deaths
- K/D
- member statistics
- point history
- leaderboard values

Avoid duplicate event rewards.

Avoid race conditions where practical.

53. CLAN DELETION SAFETY

Disband/delete must be transactional where multiple database rows are
affected.

Respect foreign-key ordering.

If deletion fails:

ROLLBACK.

Do not partially delete roles, permissions, members, allies, invitations,
points, etc.

Only after successful commit:

- cache cleanup
- INVENTORY GUI cleanup
- success message

54. GRACEFUL SHUTDOWN

On normal server/plugin shutdown:

1. Stop/cancel SprintClan-owned tasks.
2. Prevent unsafe new persistence operations.
3. Safely finish in-progress operations where possible.
4. Commit/flush pending transactional work where applicable.
5. Close SQLite safely.
6. Clear temporary INVENTORY GUI state.
7. Release SprintClan-owned resources.

Do not use:

System.exit()
Runtime.exit()
Runtime.halt()

Do not intentionally terminate the Minecraft server.

55. CRASH SAFETY

Do not claim 100% protection from:

- power failure
- VPS failure
- OS crash
- kill -9
- hardware failure
- filesystem failure

Instead:

- persist important data during the operation
- use transactions
- use rollback
- keep database as source of truth
- avoid cache-only important state
- make graceful shutdown safe

Do NOT make shutdown the only save mechanism.

56. STARTUP RECOVERY

On startup:

- open existing SQLite safely
- load clans
- load members
- load roles
- load permissions
- load invitations
- load allies
- load colors
- load settings
- load statistics
- rebuild cache

If loading fails:

- preserve database
- log complete error
- do not replace it with blank data
- do not silently reset everything

57. RELOAD SAFETY

/uclan reload must not:

- reset clans
- reset members
- reset roles
- reset permissions
- reset invitations
- reset allies
- reset colors
- reset points
- reset statistics
- duplicate listeners
- duplicate tasks
- duplicate PlaceholderAPI registration

Reload only configuration/runtime state through existing architecture.

58. STARTUP FILE WARNING

Do not repeatedly attempt to save existing:

messages.yml
menu.yml
roles.yml

Fix the existing startup warning without overwriting anything.

59. STARTUP CPU/STABILITY AUDIT

A recent startup showed very high CPU usage.

Audit SprintClan for confirmed causes:

- duplicate listeners
- duplicate schedulers
- repeated database loading
- repeated config loading
- duplicate PlaceholderAPI registration
- per-tick database queries
- unnecessary repeating tasks
- recursive startup/reload logic
- unbounded cache initialization
- repeated INVENTORY GUI initialization

Do not blindly optimize.

Do not remove working tasks without proof.

Do not make persistence unsafe just to lower CPU.

Identify the actual cause first.

If no confirmed SprintClan cause is found, report that honestly.

60. RESOURCE CLEANUP

Clean only SprintClan-owned:

- tasks
- listeners
- database connections
- temporary INVENTORY GUI state
- internal resources

Do not interfere with other plugins.

61. PLACEHOLDER SAFETY

Do not query SQLite for every placeholder/scoreboard request.

Use the existing cache.

Refresh after:

- create
- delete
- join
- leave
- kick
- promote
- demote
- role change
- color change
- tag change

Preserve existing placeholder names.

62. PERMISSION AUDIT

Inspect actual permissions in plugin.yml and source.

Expected examples only if they match the existing naming convention:

sprintclan.clan
sprintclan.clan.create
sprintclan.clan.invite
sprintclan.clan.promote
sprintclan.clan.demote
sprintclan.clan.kick
sprintclan.clan.role
sprintclan.clan.settings
sprintclan.clan.profile
sprintclan.clan.top
sprintclan.clan.info
sprintclan.clan.list
sprintclan.clan.ally
sprintclan.clan.chat
sprintclan.clan.color

Admin permissions if already present:

sprintclan.admin
sprintclan.admin.reload
sprintclan.admin-forcejoin-bypasses-limit

Do not create duplicates.

Final report must list the ACTUAL permissions and what each controls.

63. ROLE SECURITY

Preserve:

- role priority
- hierarchy
- leader protection
- permission checks
- protected roles
- role deletion checks

A user must not be able to:

- promote themselves if prohibited
- demote themselves if prohibited
- kick themselves if prohibited
- assign a role above their allowed hierarchy
- edit protected roles without permission

64. INVENTORY GUI STATE SAFETY

INVENTORY GUI state is temporary.

On plugin disable:

- clear temporary INVENTORY GUI state
- do not delete persistent data
- do not reset clans
- do not reset roles
- do not reset invitations
- do not reset settings
- do not reset points

On restart, reconstruct INVENTORY GUI state from persistent data.

Protect against:

- deleted clans
- players leaving
- invalid targets
- stale role objects
- stale member UUIDs
- stale invitations
- stale relation data

65. FULL SOURCE AUDIT

Search the entire project for:

- invite
- invitation
- ClanInvitation
- accept
- deny
- joined
- left
- kicked
- promote
- demote
- change role
- role
- color
- placeholder
- top
- ally
- settings
- clan chat
- friendly fire
- database
- cache
- shutdown
- reload
- Gradient
- Rival
- War

Look for:

- dead code
- unused message keys
- INVENTORY GUI buttons without handlers
- DB writes without proper persistence
- cache mismatches
- blank command branches
- wrong target-player references
- wrong clan references
- stale registrations
- duplicate listeners
- duplicate schedulers
- duplicate PlaceholderAPI registration
- silent exceptions
- unsafe database deletion order
- stale INVENTORY GUI state
- missing permission checks

Fix confirmed defects.

66. NO FAKE IMPLEMENTATION

Do NOT:

- register a command without connecting it to the real service
- add messages.yml keys that Java never uses
- show INVENTORY GUI buttons that do nothing
- show Accept without actual membership creation
- show Deny without actual invitation removal
- save invitations without loading them
- update cache without persistence
- add tab completion without execution permission
- hide broken buttons instead of fixing them
- claim runtime testing without runtime
- claim build success without a build

67. END-TO-END INVITE TEST

Verify:

/clan invite Player

-> command
-> permission
-> sender clan
-> role permission
-> target lookup
-> self check
-> target clan check
-> member limit
-> duplicate check
-> ClanInvitation
-> SQLite
-> cache
-> target notification
-> InvitationsGUI

Accept:

-> invitation validation
-> expiry
-> source clan validation
-> target membership validation
-> member limit
-> join permission
-> member persistence
-> invitation removal
-> cache
-> INVENTORY GUI refresh
-> joined message

Deny:

-> invitation validation
-> database removal
-> cache removal
-> INVENTORY GUI refresh
-> deny message

68. END-TO-END ROLE TEST

Promote:

-> permission
-> hierarchy
-> target validation
-> new role calculation
-> database
-> cache
-> INVENTORY GUI refresh
-> chat message showing NEW role

Demote:

same process.

Change Role:

same process.

Verify chat, INVENTORY GUI, cache and database all show the same role.

69. END-TO-END COLOR TEST

Select color:

-> permission
-> correct dye material
-> selected state
-> persistence
-> cache
-> INVENTORY GUI refresh
-> All Clans
-> Clan Top
-> Clan Info
-> Profile
-> player placeholder
-> scoreboard placeholder

Verify no generic stone color items remain where dye representation is
expected.

70. END-TO-END MEMBER TEST

Test:

- invite
- accept
- joined message
- leave
- left message
- kick
- kicked message
- promote
- demote
- change role
- self-action protection
- hierarchy protection
- member limit

No blank responses.

71. END-TO-END ALLY TEST

Test:

- send alliance request
- receive request
- accept
- deny
- duplicate request
- self request
- existing ally
- guide when no allies
- actual ally list when allied
- ally PvP protection

Keep Ally.

Do not restore Rival/War.

72. END-TO-END INVENTORY GUI TEST

Test:

Main INVENTORY GUI
Color
Settings
Roles
Permission Editor
Members
Member Management
Invitations
All Clans
Clan Top
Profile
Clan Info
Allies
Statistics
Clan Chat

Verify:

- correct slots
- correct materials
- correct colors
- correct actions
- correct permissions
- correct Back
- correct Close
- pagination only when needed
- correct sounds
- correct data
- no empty/broken pages
- no buttons that do nothing

73. FINAL BUILD CHECK

Check Maven ONCE.

If Maven exists:

mvn clean package

If Maven is unavailable:

BUILD_STATUS=NOT_VERIFIED

Do not repeatedly run Maven.

If a JAR is generated, inspect the actual generated JAR.

Do not claim success without real verification.

74. RUNTIME CHECK

If a Paper/Minecraft runtime is available, test the important flows.

If no runtime is available:

RUNTIME_STATUS=NOT_VERIFIED

Do not claim runtime success.

75. FINAL REPORT FORMAT

Return only verified information under:

FIXED
- exact confirmed fixes

COMMANDS
- command routing
- guidance
- permissions
- completion

INVITATION
- command
- persistence
- cache
- INVENTORY GUI
- accept
- deny
- expiry
- messages

MEMBERS
- joined
- left
- kicked
- promote
- demote
- change role
- role display

CLAN
- creation
- tag case
- member limit
- points
- clan chat
- friendly fire
- allies

INVENTORY GUI
- main
- colors
- top
- all clans
- info
- profile
- roles
- members
- invitations
- allies
- settings
- navigation
- sounds
- configuration

PLACEHOLDERS
- player-side clan
- player colored clan
- scoreboard
- top points score
- top points name
- no-clan behavior

DATA SAFETY
- transactions
- cache consistency
- database
- configuration
- shutdown

COMPATIBILITY
- supported versions
- preserved architecture

PERMISSIONS
- actual permissions found
- what each controls

NOT VERIFIED
- only genuinely untested items

BUILD STATUS
- actual Maven result

JAR STATUS
- actual artifact result

RUNTIME STATUS
- actual runtime result

76. FINAL NON-NEGOTIABLE RULE

THE CURRENT SPRINTCLAN PLUGIN MUST NOT BE BROKEN BY THESE CHANGES.

This is a complete development and repair specification, NOT permission to
destroy or randomly rewrite the current project.

Preserve all working:

- clan data
- member data
- roles
- role permissions
- points
- statistics
- allies
- colors
- settings
- invitations
- commands
- aliases
- permissions
- placeholders
- INVENTORY GUI architecture
- scoring rules
- database structure where possible
- configuration
- existing integrations

Only make targeted, verified changes.

The final result must be:

FUNCTIONAL
STABLE
DATA-SAFE
CONFIGURABLE
EASY TO EDIT
COMPATIBLE
SECURE
PERMISSION-AWARE
INVENTORY GUI-CONSISTENT
MESSAGE-CONSISTENT
PERSISTENT
SHUTDOWN-SAFE

Most importantly:

FIX EVERYTHING REQUESTED,
AUDIT EVERYTHING RELATED,
PRESERVE EVERYTHING THAT ALREADY WORKS,
AND DO NOT MAKE UNRELATED CHANGES.

77. COMPLETE PRODUCT DIRECTION โ€” SPRINTCLAN

SprintClan is intended to be a lightweight, modern, professional, PvP-focused
Minecraft clan plugin.

The core should remain focused on:

- Clans
- Members
- Roles
- Clan Points
- Clan Chat
- Allies
- PvP protection
- Leaderboards
- Statistics
- Invitations
- Configurable GUIs
- Configurable messages
- PlaceholderAPI
- Strong persistence
- Safe operation

Do NOT turn SprintClan into a large SMP/economy plugin.

Do NOT add unrelated systems such as:

- Economy
- Clan bank
- Clan levels
- Clan upgrades
- Clan mail
- Clan banners
- Regroup systems
- Complex SMP mechanics

unless they already exist and are specifically required by the current project.

The plugin should remain fast, clean, and suitable for PvP servers.

78. CLAN CORE

Each clan should support the existing core information:

- unique clan tag
- clan display/name where supported
- creator/leader
- members
- roles
- role priorities
- role permissions
- color
- points
- statistics
- settings
- clan chat
- allies
- invitations
- creation date
- description if already supported
- tag customization if already supported

Do not add unnecessary clan progression systems.

79. CLAN TAG VALIDATION

Clan tag validation must be strict and configurable.

The requested rule is:

CLAN TAG NAME = LETTERS ONLY

Do not allow:

- numbers
- unnecessary symbols
- unsupported special characters

The validation regex must come from configuration.

Example concept:

^[A-Za-z]+$

Do not hardcode the regex if a configured validation already exists.

Duplicate checking can be case-insensitive while preserving the exact entered
capitalization for display/storage.

Example:

/clan create Hies

must display:

Hies

not:

HIES
hies

80. CLAN COLOR RULES

Clan colors should be readable and accessible.

Do NOT require clan points to unlock colors unless the existing project
explicitly requires it.

Color selection should be permission-controlled only where the current design
requires permissions.

A normal clan color selection should not unexpectedly consume points.

The INVENTORY GUI should visually represent each color using its corresponding dye.

81. CLAN SETTINGS

The Settings INVENTORY GUI should expose all currently persisted clan settings that are
intended to be user-editable.

Each setting should clearly show:

ON / OFF

Use readable materials and state indicators.

Example:

GREEN = enabled
RED = disabled

Clicking a setting should:

- validate permission
- update the setting
- persist it
- update cache
- refresh INVENTORY GUI
- send configurable feedback

Do not make all settings use the same generic material if the design can use
appropriate materials.

82. CLAN FRIENDLY FIRE VS ALLY FRIENDLY FIRE

Clan friendly fire and Ally friendly fire must remain separate settings.

They must be independently configurable:

Clan FF:
ON/OFF

Ally FF:
ON/OFF

Do not combine them into one switch.

The existing intended access mode should be preserved where supported:

- PUBLIC
- PRIVATE

Do not rewrite PvP priority logic unnecessarily.

If the current combat design uses relationship priority, preserve its intended
ordering and only remove systems that were explicitly removed.

83. PVP RELATIONSHIP LOGIC

Audit combat relationship handling carefully.

At minimum distinguish:

1. Same clan
2. Allied clan
3. Unrelated players

If the current project still contains a Rival concept, it must be removed
according to the current specification rather than reintroduced.

Same-clan and ally protection must use their own settings.

Do not accidentally make unrelated PvP impossible.

84. CLAN CHAT

Clan Chat must be a real functional system, not just a INVENTORY GUI toggle.

Audit:

- toggle state
- message interception
- recipient filtering
- persistence
- permission
- reload
- shutdown
- player with no clan
- empty/invalid state

All messages and formatting must be configurable.

85. CLAN STATISTICS

Preserve the existing statistics system where implemented.

Relevant statistics may include:

- kills
- deaths
- K/D
- member statistics
- clan statistics

Statistics must stay synchronized with persistent member data.

Do not introduce a separate statistics database unless absolutely required by
the current implementation.

86. CLAN POINT HISTORY

If the existing system stores point history, preserve it.

Point history must remain consistent with the actual point balance.

For a successful opposing-clan kill:

- calculate reward
- persist point balance
- persist history if supported
- update cache
- refresh relevant leaderboard data

Do not award duplicate points for the same event.

87. ADMIN POINT MANAGEMENT

If existing admin commands for clan points are present, preserve them.

Audit their:

- permission
- argument validation
- persistence
- cache updates
- messages
- tab completion

Do not create duplicate admin point systems.

88. CLAN DESCRIPTION / TAG MODIFICATION

Existing commands such as description/tag modification must:

- validate permission
- validate arguments
- preserve capitalization where applicable
- persist
- update cache
- refresh placeholders
- provide a configurable message

No blank output.

89. CLAN TOP / LEADERBOARD DATA

The leaderboard must use actual current clan data.

Audit:

- points
- ranking
- sorting
- pagination
- color
- clan tag
- name
- placeholder output

Do not create fake/static leaderboard values.

If points change, open leaderboard GUIs should refresh where the existing
architecture supports live refresh.

90. PROFILE

Player Profile INVENTORY GUI should show actual player data.

Audit:

- player name
- clan
- role
- prefix
- statistics
- clan information where intended
- color/tag

Do not redirect profile clicks to unrelated GUIs.

A previously reported bug redirected Clan Info to the Ally INVENTORY GUI.

This must not happen.

91. STATISTICS INVENTORY GUI

Statistics must show actual statistics.

Audit all click handlers.

Clan Info must open Clan Information.

Do not accidentally route:

Clan Info -> Allies

or any unrelated INVENTORY GUI.

92. MEMBER MANAGEMENT INVENTORY GUI

Make Member Management simple for staff/leader use.

Each member entry should make actions obvious:

- Profile
- Promote
- Demote
- Change Role
- Kick

Do not overload the INVENTORY GUI with confusing controls.

Protect the executor from self-actions where prohibited.

Protect higher-priority roles.

Protect leader.

Show appropriate messages for every failure.

93. ROLE CREATION / EDITING

If custom roles are supported, preserve:

- role creation
- role deletion where allowed
- role name
- prefix
- priority
- permissions
- member assignment

Default/protected roles must remain safe.

If persisted role rows are missing for a loaded clan, safely restore required
default roles without destroying valid custom role data.

94. ROLE PAGINATION

If a clan has more roles than one inventory page can display:

paginate correctly.

Previous/Next should:

- remain on the correct INVENTORY GUI
- preserve selected member state
- show correct role slice
- not reset to page 1 unexpectedly
- not lose target UUID
- not use stale role objects

If there are enough roles for only one page:

do not show pagination controls.

95. ROLE PERMISSION WILDCARDS

If a role has wildcard permission such as:

*

and an individual permission is toggled, do not accidentally destroy the
wildcard permission semantics.

Preserve wildcard behavior while applying explicit overrides according to the
existing permission design.

96. INVITATION ACCESS FROM /CLAN

If the player has a pending invitation and opens /clan, the existing design
may provide access to the pending invitation INVENTORY GUI.

Ensure:

- pending invite is detected
- expired invite is handled correctly
- missing invite is handled
- accept/deny are real
- INVENTORY GUI state is refreshed

Do not consume/remove an expired invitation before showing the expired
message.

97. ADMIN FORCEJOIN

If /uclan forcejoin already exists:

- preserve it
- enforce its permission
- implement its tab completion
- validate target
- correctly handle players already in clans
- respect configurable member-limit bypass

Do not report "clan full" when the target is already a member.

Do not create a second forcejoin command.

98. RELATION PERSISTENCE

Ally requests and relations must be persisted safely.

Audit:

- request direction
- accept
- deny
- duplicate prevention
- self prevention
- conflicting relationships
- stale relation cleanup
- clan deletion cleanup
- reload
- restart

A denied alliance request should be removed correctly.

Do not leave orphaned relationship rows.

99. INVENTORY GUI EMPTY STATES

Every list INVENTORY GUI should have a useful empty state.

Examples:

No members
No invitations
No allies
No clans
No roles

Empty states must be configurable.

Do not show broken blank inventories.

100. INVENTORY GUI DATA REFRESH

After an action changes data:

- refresh relevant INVENTORY GUI
- update cache
- update placeholder values
- preserve navigation state

Examples:

Color changed
-> Color INVENTORY GUI updates
-> previous INVENTORY GUI updates

Role changed
-> Member INVENTORY GUI updates
-> Role INVENTORY GUI updates
-> profile updates

Points changed
-> Top updates
-> placeholders update

Ally accepted
-> guide disappears
-> actual ally appears

101. DATABASE FOREIGN-KEY SAFETY

Audit delete ordering carefully.

For example, if role_permissions references roles:

delete role_permissions first
then roles

Do not violate foreign-key constraints.

Use transactions and rollback.

Do not hide database exceptions.

102. ERROR LOGGING

Previously the plugin hid real exceptions behind generic internal errors.

Fix error handling so:

PLAYER:
gets configurable friendly message.

CONSOLE:
gets the real exception and stack trace.

Do not spam logs during successful normal operations.

Log only actual failures.

Include enough context to identify:

- operation
- clan
- player
- database operation where safe

Do not expose sensitive data unnecessarily.

103. DATABASE CLOSE

Database close failures must not be silently ignored.

Log the exception.

During shutdown, close only after safe pending operations are handled.

Do not close SQLite while a transaction is still actively being used.

104. NO DATABASE QUERY PER PLACEHOLDER

Placeholders can be requested extremely frequently.

Do not execute SQLite queries every time a scoreboard or player-name placeholder
is requested.

Use the existing cache.

Make cache invalidation correct.

105. PLACEHOLDER TARGET PLAYER SUPPORT

If a placeholder can resolve a target player, make sure it uses the target
player rather than always using the sender.

Audit:

- player clan
- colored clan
- tag
- role
- statistics

Do not accidentally return the sender's clan for another player's placeholder.

106. COLOR PLACEHOLDER CACHE

Clan color must flow correctly:

INVENTORY GUI selection
-> Clan model
-> database
-> cache
-> placeholder
-> scoreboard/player display
-> INVENTORY GUI/list/top/profile

No broken link in this chain.

107. CLAN TAG CACHE

Tag changes must update:

- database
- clan cache
- tag index if one exists
- placeholders
- open GUIs
- leaderboard/list displays

No stale old tag after a successful change.

108. CLAN DELETION CLEANUP

When a clan is safely deleted, clean dependent persistent/runtime data:

- members
- roles
- role permissions
- invitations
- allies
- point history
- statistics where applicable
- cache
- tag indexes
- open INVENTORY GUI state

Do this transactionally where possible.

Do not leave orphaned records.

109. SHUTDOWN TASK MANAGEMENT

Every SprintClan-owned scheduled task should have a clear lifecycle.

On disable:

- cancel it
- prevent duplicate restart
- release references

Do not leave repeating tasks running after plugin disable.

Do not create duplicate tasks after reload.

110. RELOAD MANAGER SAFETY

Reload should refresh:

- config
- messages
- menu
- roles
- INVENTORY GUI configuration
- service references

It must not duplicate:

- listeners
- tasks
- PlaceholderAPI
- INVENTORY GUI managers

Clear only temporary INVENTORY GUI state where necessary.

111. PERFORMANCE REQUIREMENTS

SprintClan should be lightweight and suitable for a PvP server.

Avoid:

- unnecessary per-tick work
- repeated database queries
- repeated config parsing
- duplicate event handling
- unbounded loops
- unnecessary synchronous heavy work
- excessive INVENTORY GUI refreshes

Do not sacrifice persistence safety for performance.

Do not optimize without identifying the actual bottleneck.

112. CURRENT REPORTED STARTUP WARNING

The plugin previously showed:

Could not save messages.yml because messages.yml already exists.
Could not save menu.yml because menu.yml already exists.
Could not save roles.yml because roles.yml already exists.

This must be cleaned up without changing user files.

113. CURRENT REPORTED INTERNAL ERROR

A major internal error occurred during clan creation.

A confirmed historical cause was:

DatabaseManager.saveClanInternal attempted to delete roles while role_permissions
still referenced them through SQLite foreign keys.

Correct ordering:

role_permissions
-> roles

with proper transaction handling.

Audit the entire create/confirm/persist path again.

Do not assume this is the only possible internal error.

All unexpected INVENTORY GUI/command/database exceptions must log their real cause.

114. CREATE CONFIRMATION INVENTORY GUI

If clan creation uses a temporary clan before confirmation:

the confirmation INVENTORY GUI must allow the temporary state safely.

Confirm:

- persist clan
- create required defaults
- cache after commit
- show success

Cancel:

- close
- discard temporary state
- do not persist

Do not reject the temporary clan merely because it is not yet in the persistent
cache if the existing architecture intentionally uses a pre-confirmation state.

Do not weaken disband confirmation validation.

115. CLAN CREATION ERROR VISIBILITY

If creation fails:

Player:
configurable internal error.

Console:
full exception.

Do not silently fail.

Do not send "Clan created" before persistence succeeds.

116. CLAN CHAT / FRIENDLY FIRE MESSAGE CONFIGURATION

Messages must be separate.

Examples:

chat-enabled
chat-disabled

same-clan-pvp-blocked
ally-pvp-blocked

Do not use one generic message for every event.

117. SIMPLE, PROFESSIONAL LANGUAGE

Messages should be:

- clear
- short
- professional
- easy to understand
- configurable
- consistent

Avoid confusing technical text.

Command guidance should tell the player exactly what to do.

118. INVENTORY GUI LANGUAGE

INVENTORY GUI names and lore should also be easy to understand.

Avoid:

- duplicated instructions
- overly long lore
- internal IDs
- technical terms
- unclear icons
- useless "click to select" repetition

Make click behavior obvious.

119. INVENTORY GUI MATERIAL DESIGN

Use meaningful materials.

Examples:

Color:
use dye matching the actual color.

Settings:
use different materials for different settings where useful.

Allies:
use alliance-related materials.

Roles:
use role/permission-related materials.

Do not use one identical material for every unrelated button unless the design
requires it.

120. CONFIGURABLE MAIN MENU

Every major main menu action must have:

- slot
- material
- name
- lore
- permission
- action
- sound

where supported by the existing framework.

Do not add configuration fields that the Java code ignores.

121. CONFIGURATION โ†” CODE CONSISTENCY

For every configurable feature:

YAML value
-> loader
-> Java field/service
-> INVENTORY GUI/command
-> actual behavior

Audit this entire path.

A common failure is having configuration that looks editable but Java still
uses hardcoded values.

Fix those confirmed cases.

122. MESSAGE โ†” CODE CONSISTENCY

For every message:

YAML
-> message loader
-> placeholder replacement
-> sender

Verify no new message remains unused.

Verify Java does not still contain a hardcoded replacement.

123. PERMISSION โ†” CODE CONSISTENCY

For every permission:

plugin.yml/config
-> command/INVENTORY GUI
-> actual permission check

Do not implement permission only in tab completion.

Execution itself must enforce it.

124. INVENTORY GUI โ†” ACTION CONSISTENCY

For every INVENTORY GUI button:

slot
-> click handler
-> permission
-> service
-> persistence
-> refresh
-> message
-> sound

All parts must connect.

A visible button with no action is a bug.

125. PLACEHOLDER โ†” DATA CONSISTENCY

For every placeholder:

placeholder
-> target player
-> cache
-> current clan
-> current color/tag/role
-> formatted result

No stale or sender-only values.

126. FULL END-TO-END DEVELOPMENT PHILOSOPHY

Do not stop after adding code.

For each feature:

TRACE
-> IMPLEMENT/FIX
-> CONNECT
-> PERSIST
-> CACHE
-> INVENTORY GUI
-> MESSAGE
-> PERMISSION
-> PLACEHOLDER
-> RELOAD
-> SHUTDOWN
-> VERIFY

Do not consider a feature complete because a class or button exists.

It is complete only when the full path works.

127. FINAL MASTER REQUIREMENT

The finished SprintClan must be:

- lightweight
- modern
- professional
- PvP-focused
- stable
- configurable
- permission-aware
- INVENTORY GUI-driven where useful
- command-driven where appropriate
- persistent
- reload-safe
- shutdown-safe
- crash-resilient where technically possible
- compatible with 1.21.11 through 1.26.2+
- easy to configure
- easy to maintain

It must include the complete working systems requested throughout development:

CLAN
MEMBERS
ROLES
INVITATIONS
ALLIES
CLAN CHAT
CLAN POINTS
STATISTICS
LEADERBOARDS
COLORS
SETTINGS
INVENTORY GUI
MESSAGES
PLACEHOLDERS
PERMISSIONS
PERSISTENCE
SAFE SHUTDOWN
ERROR HANDLING
CONFIGURATION
COMPATIBILITY

And it must NOT include the removed:

RIVAL
RIVALRY
WAR
CLAN WAR
GRADIENT

Do not add unrelated large systems.

128. FINAL SAFETY STATEMENT

The AI/developer must understand:

This project contains persistent player/community data.

Never make a destructive change just because it is easier.

Never reset the database to solve a bug.

Never overwrite configuration to solve a configuration bug.

Never replace a working system with a new one without necessity.

Never claim a feature is fixed without tracing its complete path.

Never claim runtime testing if no runtime was available.

Never claim Maven build success if Maven was unavailable.

Never claim absolute crash safety.

The priority is:

1. Preserve existing data.
2. Preserve working functionality.
3. Fix confirmed bugs.
4. Complete requested features.
5. Keep architecture simple.
6. Keep performance stable.
7. Verify everything possible.
8. Report honestly what remains unverified.

END OF COMPLETE SPRINTCLAN DEVELOPMENT SPECIFICATION
Kodari AI
KodariAug 22 at 4:08 pm 6
  1. Create the Maven/Paper project and safe default resources.

  2. Add the SQLite-backed clan models, persistence, cache, and service layer.

  3. Add command routing, tab completion, GUI navigation, placeholders, and listeners.

  4. Add configuration/messages for clans, roles, invitations, allies, chat, PvP, and permissions.

FIXED

  • Created a new Maven-based Paper plugin project named SprintClan.

  • Added SQLite persistence with clans, members, roles, permissions, invitations, allies, statistics, and point history.

  • Added transactional clan creation, invitation acceptance, point updates, and clan deletion ordering.

  • Added safe default resource creation for config.yml, messages.yml, menu.yml, and roles.yml.

  • Added configurable clan tags, colors, member limits, points, invitations, settings, and messages.

  • Added clan commands, GUI navigation, clan chat, friendly-fire protection, ally protection, and PlaceholderAPI support.

  • Removed all prohibited Rival, Rivalry, War, Clan War, and Gradient systems from the new implementation.

COMMANDS

  • /clan and /team aliases are registered.

  • Added help, create, invite, accept, deny, promote, demote, role, kick, leave, disband, info, list, top, profile, color, settings, chat, ally, description, members, roles, allies, and statistics routes.

  • Added usage messages and tab completion.

  • Added /uclan reload.

  • Execution permissions are checked for the base command, clan creation, profile, reload, and role-based clan actions.

INVITATION

  • Added /clan invite <player>.

  • Added duplicate, self, offline, existing-clan, permission, and capacity validation.

  • Added persistent invitations with expiration timestamps.

  • Added transactional invitation acceptance.

  • Added invitation denial and expired-invitation handling.

  • Added invitation GUI with Accept, Deny, and Close controls.

MEMBERS

  • Added join, leave, kick, promote, demote, and role-change operations.

  • Added self-action protection and role hierarchy checks.

  • Added configurable joined, left, kicked, promoted, demoted, and role-change messages.

  • Added member-management GUI and profile view.

CLAN

  • Added case-preserving clan tags with configurable regex and length validation.

  • Added configurable member limits.

  • Added opposing-clan kill points only.

  • Same-clan and allied kills do not award points.

  • Added clan chat toggle and chat interception.

  • Added separate clan friendly-fire and ally-fire settings.

  • Added persistent ally requests, acceptance, denial, and protection.

  • Added clan color persistence using dye materials.

INVENTORY GUI

  • Added configurable main menu slots, materials, names, lore, title, and size.

  • Added Clan Info, Clan Top, All Clans, Profile, Color, Settings, Roles, Members, Allies, Statistics, and Clan Chat routes.

  • Leave and Disband are command-only.

  • Added Back and Close navigation.

  • Added pagination for member, clan-list, and leaderboard views.

  • Added color dye icons and selected-color state.

  • Added settings ON/OFF indicators.

  • Added empty-state displays for list-style views.

  • Added member management actions for Promote, Demote, Change Role guidance, Kick, and Profile.

PLACEHOLDERS

  • Added %sprintclan_player_clan_tag%.

  • Added %sprintclan_player_clan_tag_colored%.

  • Added %sprintclan_player_clan%.

  • Added %sprintclan_player_clan_colored%.

  • Added %sprintclan_player_clan_color%.

  • Added %sprintclan_top_points_score%.

  • Added %sprintclan_top_points_name%.

  • No-clan player placeholders return an empty value.

  • Placeholder lookups use the in-memory cache instead of SQLite queries.

DATA SAFETY

  • SQLite is used as the persistent source of truth.

  • Clan creation and deletion use transactions.

  • Role permissions are deleted before roles, and members are deleted before roles.

  • Invitation acceptance persists the member and removes the invitation transactionally.

  • Cache updates occur after successful database operations.

  • Reload rebuilds runtime state only after database loading succeeds.

  • Database close failures are logged.

  • Plugin-owned database resources are closed during shutdown.

  • Existing configuration files are not overwritten.

COMPATIBILITY

  • Maven project targeting Paper API 1.21-compatible servers.

  • XSeries is used for material compatibility.

  • PlaceholderAPI is optional through softdepend.

  • SQLite and XSeries are packaged through Maven Shade.

  • No Gradle files were created.

PERMISSIONS

  • sprintclan.clan โ€” access to the main clan command.

  • sprintclan.clan.create โ€” create clans.

  • sprintclan.clan.invite โ€” declared for invitation access.

  • sprintclan.clan.promote โ€” declared for promotion access.

  • sprintclan.clan.demote โ€” declared for demotion access.

  • sprintclan.clan.kick โ€” declared for kick access.

  • sprintclan.clan.role โ€” declared for role changes.

  • sprintclan.clan.settings โ€” declared for clan settings.

  • sprintclan.clan.profile โ€” profile access.

  • sprintclan.clan.top โ€” leaderboard access.

  • sprintclan.clan.info โ€” clan information access.

  • sprintclan.clan.list โ€” clan listing access.

  • sprintclan.clan.ally โ€” ally management.

  • sprintclan.clan.chat โ€” clan chat.

  • sprintclan.clan.color โ€” clan color selection.

  • sprintclan.admin โ€” administrative command access.

  • sprintclan.admin.reload โ€” configuration/runtime reload.

  • sprintclan.admin.forcejoin โ€” reserved administrative force-join permission.

  • sprintclan.admin-forcejoin-bypasses-limit โ€” reserved member-limit bypass permission.

NOT VERIFIED

  • Maven compilation was not run because the project initialization instructions prohibited bash/tool inspection.

  • No Paper runtime was available for end-to-end command, GUI, PlaceholderAPI, combat, reload, or shutdown testing.

  • No generated artifact was inspected.

BUILD STATUS

  • NOT_VERIFIED โ€” Maven was not executed.

JAR STATUS

  • NOT_VERIFIED โ€” no generated artifact was inspected.

RUNTIME STATUS

  • NOT_VERIFIED โ€” no Minecraft/Paper runtime was available.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
24 1,140
src/main/java/com/kodari/sprintclan/SprintClanPlugin.java
package com.kodari.sprintclan;

import com.kodari.sprintclan.command.ClanCommand;
import com.kodari.sprintclan.command.UClanCommand;
import com.kodari.sprintclan.gui.GuiManager;
import com.kodari.sprintclan.listener.ChatListener;
import com.kodari.sprintclan.listener.CombatListener;
import com.kodari.sprintclan.listener.GuiListener;
import com.kodari.sprintclan.placeholder.SprintClanPlaceholder;
import com.kodari.sprintclan.service.ClanService;
import com.kodari.sprintclan.storage.DatabaseManager;
import com.kodari.sprintclan.util.MessageService;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.sql.SQLException;
import java.util.logging.Level;

@Getter
public class SprintClanPlugin extends JavaPlugin {
    private DatabaseManager database;
    private ClanService clanService;
    private MessageService messages;
    private GuiManager guiManager;
    private FileConfiguration menu;

    @Override public void onEnable() {
        saveDefaultConfig();
        ensureResource("menu.yml"); ensureResource("messages.yml"); ensureResource("roles.yml");
        menu = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "menu.yml"));
        messages = new MessageService(this);
        try { database = new DatabaseManager(this); clanService = new ClanService(this, database, messages); } catch (SQLException exception) { getLogger().log(Level.SEVERE, "SprintClan could not start without its database", exception); getServer().getPluginManager().disablePlugin(this); return; }
        guiManager = new GuiManager(this, clanService, messages);
        ClanCommand clanCommand = new ClanCommand(this, clanService, guiManager, messages);
        getCommand("clan").setExecutor(clanCommand); getCommand("clan").setTabCompleter(clanCommand);
        getCommand("uclan").setExecutor(new UClanCommand(this, clanService, messages));
        Bukkit.getPluginManager().registerEvents(new GuiListener(guiManager), this); Bukkit.getPluginManager().registerEvents(new ChatListener(clanService, messages), this); Bukkit.getPluginManager().registerEvents(new CombatListener(clanService, messages, this), this);
        if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) new SprintClanPlaceholder(this, clanService).register();
        getLogger().info("SprintClan enabled with " + clanService.allClans().size() + " clans.");
    }
    private void ensureResource(String resource) { if (!new File(getDataFolder(), resource).exists()) saveResource(resource, false); }
    public void reloadRuntime() { reloadConfig(); menu = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "menu.yml")); messages.reload(); try { clanService.reload(); } catch (SQLException exception) { getLogger().log(Level.SEVERE, "Could not reload SprintClan data; keeping current cache", exception); } }
    @Override public void onDisable() { if (database != null) try { database.close(); } catch (SQLException exception) { getLogger().log(Level.SEVERE, "Could not close SprintClan database", exception); } }
}