Skip to content

Commit

Permalink
Update Readme and command descriptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ataranlen committed Dec 22, 2016
1 parent 568ecc9 commit b6eb84a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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༼ つ ◕_◕ ༽つ'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]");
}
Expand Down Expand Up @@ -396,7 +396,7 @@ public void members_cmd() throws SCException {

sendMessage(sender, leaderString);
}
ArrayList<String> members = badge.getLeaderUUIDs();
ArrayList<String> members = badge.getMemberUUIDs();
if (!members.isEmpty()) {
String memberString = SCColor.White+"[Members]: "+SCColor.ITALIC;

Expand Down Expand Up @@ -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.");
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/badges.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Default Badges
#MySQL Configuration:
mysql:
hostname: localhost
port: '3306'
Expand All @@ -9,6 +9,7 @@ mysql:
min_conns: '5'
max_conns: '10'
parts: '3'
#Legacy (Non-Group, permission based) Badges
badges:
- name: 'gimmie'
badgeText: ' &b༼ つ ◕_◕ ༽つ'
Expand Down

0 comments on commit b6eb84a

Please sign in to comment.