Skip to content

Commit cb22f95

Browse files
committed
small fix 2
1 parent e058251 commit cb22f95

6 files changed

Lines changed: 60 additions & 16 deletions

File tree

README.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
11
# Simple Pronouns
22

3-
Basic pronoun plugin that allows users to choose pronouns to be used in various Placeholders.
4-
5-
> Please note:
6-
>
7-
> Currently, there is no way for individual players to add their own pronouns.
8-
> <br>The server-selectable options are configurable, though.
9-
10-
### Placeholders
11-
For each configured pronoun option there are 15 separate placeholders.
12-
| | Basic | Title-Case | All-Caps |
13-
| ----- | ----- | ----- |
14-
| subjective | `%sp_sub%` | `%sp_sub_caps%`
3+
Basic pronoun plugin that allows users to choose pronouns to be used in various Placeholders.
4+
5+
## Placeholders
6+
There are 15 placeholders that you can use to check a player's pronouns.
7+
(For reference, people usually put the subjective and objective pronouns in their bios)
8+
9+
| ---- | Basic | Title Case | ALL CAPS |
10+
|----------------------|---------------|---------------------|--------------------|
11+
| Subjective | `%sp_sub%` | `%sp_sub-title%` | `%sp_sub-caps%` |
12+
| Objective | `%sp_obj%` | `%sp_obj-title%` | `%sp_obj-caps%` |
13+
| Possessive | `%sp_pos%` | `%sp_pos-title%` | `%sp_pos-caps%` |
14+
| Possessive-Adjective | `%sp_posadj%` | `%sp_posadj-title%` | `%sp_posadj-caps%` |
15+
| Reflexive | `%sp_ref%` | `%sp_ref-title%` | `%sp_ref-caps%` |
16+
17+
## Permissions
18+
| Permission | Description | Default |
19+
|-------------------------|-------------------------------------------------------------|---------|
20+
| **`pronouns`** | Base permission required for using the plugin | op |
21+
| `pronouns.set` | Allows the user to set their pronouns | op |
22+
| `pronouns.list` | Allows the user to see a list of all pronouns | op |
23+
| `pronouns.get` | Allows the user to see what pronouns other people are using | op |
24+
| `pronouns.clear` | Allows the user to remove their pronouns | op |
25+
| `pronouns.custom` | Allows the user to set custom pronouns for themselves | op |
26+
| `pronouns.admin` | Allows the user to use administrative commands | op |
27+
| `pronouns.admin.set` | Allows the user to set other users' pronouns | op |
28+
| `pronouns.admin.clear` | Allows the user to clear other users' pronouns | op |
29+
| `pronouns.admin.custom` | Allows the user to set custom pronouns on other users | op |
30+
| `pronouns.reload` | Allows the user to reload the plugin | op |
31+
32+
## Commands
33+
| Subcommand | Permission | Usage |
34+
|------------|-------------------|--------------------------------------------------------|
35+
| set | `pronouns.set` | `/pronouns set <pronouns>` |
36+
| list | `pronouns.list` | `/pronouns list` |
37+
| help | `pronouns` | `/pronouns help` |
38+
| get | `pronouns.get` | `/pronouns get [player]` |
39+
| clear | `pronouns.clear` | `/pronouns clear` |
40+
| custom | `pronouns.custom` | `/pronouns custom <args>` |
41+
| admin | `pronouns.admin` | `/pronouns admin <set\|clear\|custom> <player> <args>` |
42+

src/main/java/simplexity/simplepronouns/commands/subcommands/HelpCommand.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
2525
sender.sendRichMessage(LocaleLoader.getInstance().getNoPermission());
2626
return false;
2727
}
28-
Component helpMessage = miniMessage.deserialize(LocaleLoader.getInstance().getHelpHeader());
28+
Component helpMessage = Component.empty();
2929
for (SubCommand subCommand : SimplePronouns.subCommands.values()) {
3030
if (!sender.hasPermission(subCommand.getPermission())) continue;
3131
helpMessage = helpMessage.append(miniMessage.deserialize(subCommand.getHelpMessage()));
@@ -34,7 +34,11 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
3434
if (!sender.hasPermission(adminSubCommand.getPermission())) continue;
3535
helpMessage = helpMessage.append(miniMessage.deserialize(adminSubCommand.getHelpMessage()));
3636
}
37-
sender.sendMessage(helpMessage);
37+
if (helpMessage.equals(Component.empty())) {
38+
sender.sendRichMessage(LocaleLoader.getInstance().getHelpHeader() + LocaleLoader.getInstance().getNoCommands());
39+
return false;
40+
}
41+
sender.sendMessage(miniMessage.deserialize(LocaleLoader.getInstance().getHelpHeader()).append(helpMessage));
3842
return true;
3943
}
4044

src/main/java/simplexity/simplepronouns/configs/LocaleLoader.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class LocaleLoader {
1717

1818
private String pronounsSet, pronounsClear, pronounsGet, pronounsAdminSet, pronounsAdminClear;
1919
private String exampleSentence;
20-
private String noPermission, syntaxError, notEnoughArguments, notConfigured, invalidPlayer, defaultPronoun, onlyAPlayer;
20+
private String noPermission, syntaxError, notEnoughArguments, notConfigured, invalidPlayer, defaultPronoun, onlyAPlayer, noCommands;
2121
private String commandReloaded, helpHeader, listHelp, setHelp, getHelp, clearHelp, adminSetHelp, adminClearHelp, adminCustomHelp,
2222
listHeader, listItem, userPronouns;
2323

@@ -56,6 +56,7 @@ public void loadLocale() {
5656
invalidPlayer = localeConfig.getString("errors.invalid-player");
5757
defaultPronoun = localeConfig.getString("errors.default-pronoun");
5858
onlyAPlayer = localeConfig.getString("errors.only-a-player");
59+
noCommands = localeConfig.getString("errors.no-commands");
5960
commandReloaded = localeConfig.getString("command-feedback.reloaded");
6061
helpHeader = localeConfig.getString("command-feedback.help-header");
6162
listHelp = localeConfig.getString("command-feedback.list-help");
@@ -114,6 +115,9 @@ public String getNotConfigured() {
114115
public String getInvalidPlayer() {
115116
return invalidPlayer;
116117
}
118+
public String getNoCommands() {
119+
return noCommands;
120+
}
117121

118122
public String getDefaultPronoun() {
119123
return defaultPronoun;

src/main/resources/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ allow-custom-pronouns: false
77
save-type: PDC
88
mysql:
99
ip: "localhost:3306"
10-
name: coolDatabase
10+
name: pronouns
1111
username: username1
1212
password: badpassword!
1313

src/main/resources/locale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ errors:
1515
invalid-player: "<red><input> is not a valid player. Please check your syntax and try again.</red>"
1616
default-pronoun: "<red>There is a configuration error and there is currently no valid default pronoun. Please fix the configuration file before using this command again.</red>"
1717
only-a-player: "<red>Only a player can run this command</red>"
18+
no-commands: "\n<gray>Someone configured the permissions incorrectly, you have access to the help command but nothing else. I, the developer of the plugin, unfortunately cannot help with that. The staff on whichever server this is probably can though. You should probably ask them to fix that.</gray>"
1819
command-feedback:
1920
reloaded: "<gold>SimplePronouns Reloaded</gold>"
2021
help-header: "<white><bold>[</bold><aqua>Pronouns Help</aqua><bold>]</bold></white>"

src/main/resources/plugin.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: SimplePronouns
22
version: '${project.version}'
33
main: simplexity.simplepronouns.SimplePronouns
4+
website: https://github.com/Simplexity-Development/SimplePronouns
5+
authors:
6+
- Rhythmic
7+
- Peashooter101
48
api-version: '1.20'
59
commands:
610
pronouns:
@@ -10,6 +14,9 @@ commands:
1014
permission: pronouns.reload
1115
description: Reloads the plugin
1216
permissions:
17+
pronouns:
18+
description: Allows the user to use the plugin
19+
default: op
1320
pronouns.set:
1421
description: Allows the user to set their pronouns
1522
default: op

0 commit comments

Comments
 (0)