Skip to content

Commit

Permalink
small fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
RhythmicSys committed Feb 21, 2024
1 parent e058251 commit cb22f95
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 16 deletions.
52 changes: 40 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,42 @@
# Simple Pronouns

Basic pronoun plugin that allows users to choose pronouns to be used in various Placeholders.

> Please note:
>
> Currently, there is no way for individual players to add their own pronouns.
> <br>The server-selectable options are configurable, though.
### Placeholders
For each configured pronoun option there are 15 separate placeholders.
| | Basic | Title-Case | All-Caps |
| ----- | ----- | ----- |
| subjective | `%sp_sub%` | `%sp_sub_caps%`
Basic pronoun plugin that allows users to choose pronouns to be used in various Placeholders.

## Placeholders
There are 15 placeholders that you can use to check a player's pronouns.
(For reference, people usually put the subjective and objective pronouns in their bios)

| ---- | Basic | Title Case | ALL CAPS |
|----------------------|---------------|---------------------|--------------------|
| Subjective | `%sp_sub%` | `%sp_sub-title%` | `%sp_sub-caps%` |
| Objective | `%sp_obj%` | `%sp_obj-title%` | `%sp_obj-caps%` |
| Possessive | `%sp_pos%` | `%sp_pos-title%` | `%sp_pos-caps%` |
| Possessive-Adjective | `%sp_posadj%` | `%sp_posadj-title%` | `%sp_posadj-caps%` |
| Reflexive | `%sp_ref%` | `%sp_ref-title%` | `%sp_ref-caps%` |

## Permissions
| Permission | Description | Default |
|-------------------------|-------------------------------------------------------------|---------|
| **`pronouns`** | Base permission required for using the plugin | op |
| `pronouns.set` | Allows the user to set their pronouns | op |
| `pronouns.list` | Allows the user to see a list of all pronouns | op |
| `pronouns.get` | Allows the user to see what pronouns other people are using | op |
| `pronouns.clear` | Allows the user to remove their pronouns | op |
| `pronouns.custom` | Allows the user to set custom pronouns for themselves | op |
| `pronouns.admin` | Allows the user to use administrative commands | op |
| `pronouns.admin.set` | Allows the user to set other users' pronouns | op |
| `pronouns.admin.clear` | Allows the user to clear other users' pronouns | op |
| `pronouns.admin.custom` | Allows the user to set custom pronouns on other users | op |
| `pronouns.reload` | Allows the user to reload the plugin | op |

## Commands
| Subcommand | Permission | Usage |
|------------|-------------------|--------------------------------------------------------|
| set | `pronouns.set` | `/pronouns set <pronouns>` |
| list | `pronouns.list` | `/pronouns list` |
| help | `pronouns` | `/pronouns help` |
| get | `pronouns.get` | `/pronouns get [player]` |
| clear | `pronouns.clear` | `/pronouns clear` |
| custom | `pronouns.custom` | `/pronouns custom <args>` |
| admin | `pronouns.admin` | `/pronouns admin <set\|clear\|custom> <player> <args>` |

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
sender.sendRichMessage(LocaleLoader.getInstance().getNoPermission());
return false;
}
Component helpMessage = miniMessage.deserialize(LocaleLoader.getInstance().getHelpHeader());
Component helpMessage = Component.empty();
for (SubCommand subCommand : SimplePronouns.subCommands.values()) {
if (!sender.hasPermission(subCommand.getPermission())) continue;
helpMessage = helpMessage.append(miniMessage.deserialize(subCommand.getHelpMessage()));
Expand All @@ -34,7 +34,11 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
if (!sender.hasPermission(adminSubCommand.getPermission())) continue;
helpMessage = helpMessage.append(miniMessage.deserialize(adminSubCommand.getHelpMessage()));
}
sender.sendMessage(helpMessage);
if (helpMessage.equals(Component.empty())) {
sender.sendRichMessage(LocaleLoader.getInstance().getHelpHeader() + LocaleLoader.getInstance().getNoCommands());
return false;
}
sender.sendMessage(miniMessage.deserialize(LocaleLoader.getInstance().getHelpHeader()).append(helpMessage));
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class LocaleLoader {

private String pronounsSet, pronounsClear, pronounsGet, pronounsAdminSet, pronounsAdminClear;
private String exampleSentence;
private String noPermission, syntaxError, notEnoughArguments, notConfigured, invalidPlayer, defaultPronoun, onlyAPlayer;
private String noPermission, syntaxError, notEnoughArguments, notConfigured, invalidPlayer, defaultPronoun, onlyAPlayer, noCommands;
private String commandReloaded, helpHeader, listHelp, setHelp, getHelp, clearHelp, adminSetHelp, adminClearHelp, adminCustomHelp,
listHeader, listItem, userPronouns;

Expand Down Expand Up @@ -56,6 +56,7 @@ public void loadLocale() {
invalidPlayer = localeConfig.getString("errors.invalid-player");
defaultPronoun = localeConfig.getString("errors.default-pronoun");
onlyAPlayer = localeConfig.getString("errors.only-a-player");
noCommands = localeConfig.getString("errors.no-commands");
commandReloaded = localeConfig.getString("command-feedback.reloaded");
helpHeader = localeConfig.getString("command-feedback.help-header");
listHelp = localeConfig.getString("command-feedback.list-help");
Expand Down Expand Up @@ -114,6 +115,9 @@ public String getNotConfigured() {
public String getInvalidPlayer() {
return invalidPlayer;
}
public String getNoCommands() {
return noCommands;
}

public String getDefaultPronoun() {
return defaultPronoun;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allow-custom-pronouns: false
save-type: PDC
mysql:
ip: "localhost:3306"
name: coolDatabase
name: pronouns
username: username1
password: badpassword!

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ errors:
invalid-player: "<red><input> is not a valid player. Please check your syntax and try again.</red>"
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>"
only-a-player: "<red>Only a player can run this command</red>"
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>"
command-feedback:
reloaded: "<gold>SimplePronouns Reloaded</gold>"
help-header: "<white><bold>[</bold><aqua>Pronouns Help</aqua><bold>]</bold></white>"
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: SimplePronouns
version: '${project.version}'
main: simplexity.simplepronouns.SimplePronouns
website: https://github.com/Simplexity-Development/SimplePronouns
authors:
- Rhythmic
- Peashooter101
api-version: '1.20'
commands:
pronouns:
Expand All @@ -10,6 +14,9 @@ commands:
permission: pronouns.reload
description: Reloads the plugin
permissions:
pronouns:
description: Allows the user to use the plugin
default: op
pronouns.set:
description: Allows the user to set their pronouns
default: op
Expand Down

0 comments on commit cb22f95

Please sign in to comment.