New:
- Import/Export Spellings
- Code Overhaul Restructure
Changed:
- Better Commands - All commands now go under /grammar instead of having each command for each logic.
- Better Messages - MiniMessage support, messages have been remapped with more customizability and consistency between all commands, while keeping the legacy mapping.
- Performance Optimization - The plugin is now less likely to experience memory leaks with an efficient and smart caching system
Removed:
- /grammarreload
- /grammarview
- /grammarforce
- /reloadgrammar
- /enablegrammar
- /disablegrammar
- /togglegrammar
- /grammartoggle
- /viewgrammar
Update: messages.yml
# NosGrammar Messages Configuration
# Supports MiniMessage hex colors and placeholders
# Global prefix for all messages
prefix: "<gradient:#FF8500:#FF9D33>[NosGrammar]</gradient> <#DBDBDB>»</#DBDBDB>"
# Status messages with customizable placeholders
status:
enabled: "&fGrammar correction is currently &6Enabled&f."
disabled: "&fGrammar correction is currently &6Disabled&f."
# Placeholders: {status} - enabled/disabled, {player} - player name
other_player: "&fGrammar correction is currently &6{status} &ffor &6{player}&f."
# Toggle messages
toggle:
enabled: "&fGrammar correction has been &6Enabled&f."
disabled: "&fGrammar correction has been &6Disabled&f."
# Force command messages
force:
success: "&aSuccessfully &f{action} &agrammar correction for &f{player}&a."
target_notified: "&fA staff member has &6{action} &fyour grammar correction."
# Placeholders: {action} - enabled/disabled, {player} - target player name
# Error messages
errors:
no_permission: "&cYou do not have permission to use this command."
player_not_found: "&cPlayer &4{player} &cwas not found."
invalid_input: "&cInvalid input. Use: &7enabled/disabled &c(or &7on/off, yes/no&c)."
only_players: "&cThis command can only be used by players."
export_failed: "&cFailed to export spellings. Check console for details."
import_failed: "&cFailed to import spellings. Check console for details."
usage:
general: "&cUsage: &7/grammar <toggle|force|check|reload|export|import>"
force: "&cUsage: &7/grammar force <player> <enabled|disabled>"
check: "&cUsage: &7/grammar check [player]"
export: "&cUsage: &7/grammar export <filename>"
import: "&cUsage: &7/grammar import <filename>"
# Success messages
success:
reload: "&aPlugin configuration has been &2reloaded&a successfully."
export: "&aSuccessfully exported spellings to &2{filename}.txt&a."
import: "&aSuccessfully imported spellings from &2{filename}.txt&a."
# Help messages
help:
header: "&6=== &eNosGrammar Commands &6==="
toggle: "&7/grammar toggle &8- &fToggle grammar correction for yourself"
force: "&7/grammar force <player> <enabled|disabled> &8- &fForce grammar correction for another player"
check: "&7/grammar check [player] &8- &fCheck grammar correction status"
reload: "&7/grammar reload &8- &fReload plugin configuration"
export: "&7/grammar export <filename> &8- &fExport current spellings to file"
import: "&7/grammar import <filename> &8- &fImport spellings from file"
footer: "&6========================"
# Advanced customization options
# You can use MiniMessage hex colors like: <#ff6b6b>text</#ff6b6b>
# Or gradient colors like: <gradient:red:blue>text</gradient>
# Or rainbow: <rainbow>text</rainbow>
# Example with hex colors (uncomment to use):
# status:
# enabled: "<#00ff00>Grammar correction is currently <#008000>enabled<#00ff00>."
# disabled: "<#ff0000>Grammar correction is currently <#800000>disabled<#ff0000>."
# Example with gradients (uncomment to use):
# toggle:
# enabled: "<gradient:green:lime>Grammar correction has been enabled.</gradient>"
# disabled: "<gradient:red:dark_red>Grammar correction has been disabled.</gradient>"
# Legacy message mappings (for backward compatibility)
# These will be automatically mapped to the new structure
legacy_mappings:
togglegrammar_enabled: "toggle.enabled"
togglegrammar_disabled: "toggle.disabled"
no_permission: "errors.no_permission"
player_not_found: "errors.player_not_found"
usage_forcegrammar: "errors.usage.force"
usage_grammarcheck: "errors.usage.check"
grammarforce_torf: "errors.invalid_input"
grammar_status: "status.enabled"
grammarcheck_status: "status.other_player"
reload_success: "success.reload"
authorized_player: "errors.only_players"
grammarcheck_status_informed: "force.target_notified"
Implemented:
1. Configuration system that tracks how many subcommands each command has before the actual message content.
2. Command aliases for /grammar and /grammartoggle - grammartoggle: togglegrammar, enablegrammar, disablegrammar - grammar: viewgrammar
Fixed:
- Unable to uppercase/capitalize the first letter of the word for commands that require a subcommand. - (/msg player hello. → /msg player Hello.)
Update your current commands.yml format:
Updated: commands.yml
# List of commands that should have grammar correction applied
whitelisted-commands:
- say
- msg
- tell
- whisper
- me
# Do not include "/" before the command to avoid any potential issues
# Specifies how many subcommands each command has before the actual message part
# For example: '/msg player hello world' has 1 subcommand ('player') before the message ('hello world')
command-structures:
say: 0 # /say <message> (no subcommands)
msg: 1 # /msg <player> <message>
tell: 1 # /tell <player> <message>
whisper: 1 # /whisper <player> <message>
me: 0 # /me <message> (no subcommands)
# Add other commands with their subcommand counts
# mail: 2 # Example: /mail send <player> <message> (2 subcommands)
Implemented Features:
- Added the ability to whitelist commands that grammar should be applied to using
commands.yml
- Added quotes support in
spellings.txt
to include illegal and/or special characters to be grammar-corrected.
Bugfixes:
- Fixed chat colors cause the first letter not to be capitalized. (&ahello. -> &aHello.)
- Fixed chat colors cause the words not to be overwritten. (&aWoord. -> &aWord.)