From b6eb84aede6b41dfd852a09620a5905133673b2f Mon Sep 17 00:00:00 2001 From: Nathan Stoltenberg Date: Thu, 22 Dec 2016 10:23:00 -0600 Subject: [PATCH] Update Readme and command descriptions. --- README.md | 25 ++++++++++++++----- .../suffixcommands/commands/BadgeCommand.java | 20 +++++++-------- src/main/resources/badges.yml | 3 ++- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5952793..50c70c8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ -A fairly simple plugin, but it requires that you use permissionsEX. +A fairly simple plugin, but it requires that you use permissionsEX and MySQL. With this plugin, you can give players access to change their own suffix. I couldn't find a plugin that would do exactly what I wanted, so I started writing one to fit my own needs. If you have any suggestions, feel free to join the discussion. If you want to see it in action, join anarchy.minetexas.com ##Requirements: -- Spigot 1.9+ +- Spigot 1.11+ - permissionsEX - Herochat (Optional) +- A MySQL server and Database ##Commands: * /badge set [name]- Change your badge to one you own @@ -19,6 +20,8 @@ If you want to see it in action, join anarchy.minetexas.com * /badge owned - List all your owned badges * /badge group - List all your group badges * /badge list - List all possible badges +* /badge create [name] [owner] [badgeText] [ColorCode] - "Create a new badge group. [Admin Only] +* /badge rename [name] [newName] [badgeText] - Rename a badge group. * /badge reload - Reload from the badges.yml [OP/Console only] * /chat [name] [message] - Send a chat message to all players with permissions to chat for the named badge. * /bc [name] [message] - Same as /chat @@ -27,14 +30,24 @@ If you want to see it in action, join anarchy.minetexas.com ##Permissions: ``` suffixcommands.badge.set - Allows setting of own badge -suffixcommands.badge.[name] - gives access to set the named badge -suffixcommands.badgegroup - Allows use of set, give, and take for a badge +suffixcommands.badge.[name] - gives access to set the named legacy badge suffixcommands.chat.[name] - Allows sending and receiving 'Badge Chat' with /chat or /bc +suffixcommands.createbadge - Allows creation and renaming of unowned badges, useful for admins ``` ##Default Config: -``` -#Default Badges +#MySQL Configuration: +mysql: + hostname: localhost + port: '3306' + database: game + username: user + password: 'PasswordForDatabaseUser' + table_prefix: '' + min_conns: '5' + max_conns: '10' + parts: '3' +#Legacy (Non-Group, permission based) Badges badges: - name: 'gimmie' badgeText: ' &b༼ つ ◕_◕ ༽つ' diff --git a/src/main/java/com/minetexas/suffixcommands/commands/BadgeCommand.java b/src/main/java/com/minetexas/suffixcommands/commands/BadgeCommand.java index 964a321..9401dcb 100644 --- a/src/main/java/com/minetexas/suffixcommands/commands/BadgeCommand.java +++ b/src/main/java/com/minetexas/suffixcommands/commands/BadgeCommand.java @@ -28,20 +28,20 @@ public class BadgeCommand extends CommandBase { @Override public void init() { command = "/badge"; - displayName = "Manage Your Badges"; + displayName = "Manage Your Badges. Badge names are case sensitive."; - commands.put("set", "Change your badge to one you own"); - commands.put("give", "Grant a player access to a group badge"); - commands.put("take", "Remove a player's access to a group badge"); - commands.put("share", "Grant a player access to give a group badge"); + commands.put("set", "Change your badge to one you own. Usage: /badge set [name]"); + commands.put("give", "Grant a player access to a group badge. Usage: /badge give [name] [player]"); + commands.put("take", "Remove a player's access to a group badge. Usage: /badge take [name] [player]"); + commands.put("share", "Grant a player access to give a group badge. Usage: /badge share [name] [player]"); commands.put("leave", "Leave a group badge"); commands.put("remove", "Remove your current badge"); commands.put("owned", "List all your owned badges"); commands.put("group", "List all your group badges"); commands.put("list", "List all possible badges"); commands.put("members", "List all members of the named badge group"); - commands.put("create", "Create a new badge group"); - commands.put("rename", "Rename a badge group"); + commands.put("create", "Create a new badge group. [Admin Only] Usage: /badge create [name] [owner] [badgeText] [Chat Color Code]"); + commands.put("rename", "Rename a badge group. Usage: /badge rename [name] [newname] [badgeText]"); commands.put("reload", "Reload Badges from the Config [Admin Only]"); } @@ -396,7 +396,7 @@ public void members_cmd() throws SCException { sendMessage(sender, leaderString); } - ArrayList members = badge.getLeaderUUIDs(); + ArrayList members = badge.getMemberUUIDs(); if (!members.isEmpty()) { String memberString = SCColor.White+"[Members]: "+SCColor.ITALIC; @@ -484,11 +484,11 @@ public void rename_cmd() throws SCException { newName = newName.replaceAll("&", ""); badgeText = badgeText.replaceAll("", "&"); badgeText = badgeText.replaceAll("&k", ""); - if (newName.length() >= 10) { + if (newName.length() >= 16 && !permissionCheck(SCSettings.PERMISSION_CREATE)) { throw new SCException("Please limit your New name to 10 characters."); } - if (badgeText.length() >= 12) { + if (badgeText.length() >= 20 && !permissionCheck(SCSettings.PERMISSION_CREATE)) { throw new SCException("Please limit your displayText to 12 characters."); } diff --git a/src/main/resources/badges.yml b/src/main/resources/badges.yml index c420aed..1616b99 100644 --- a/src/main/resources/badges.yml +++ b/src/main/resources/badges.yml @@ -1,4 +1,4 @@ -#Default Badges +#MySQL Configuration: mysql: hostname: localhost port: '3306' @@ -9,6 +9,7 @@ mysql: min_conns: '5' max_conns: '10' parts: '3' +#Legacy (Non-Group, permission based) Badges badges: - name: 'gimmie' badgeText: ' &b༼ つ ◕_◕ ༽つ'