61 lines
1.2 KiB
Java
61 lines
1.2 KiB
Java
package wtf.beatrice.nounspicker.objects;
|
|
|
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
|
import org.bukkit.entity.Player;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import wtf.beatrice.nounspicker.NounsPicker;
|
|
|
|
public class PAPIManager extends PlaceholderExpansion
|
|
{
|
|
|
|
private final NounsPicker plugin;
|
|
public PAPIManager(NounsPicker plugin)
|
|
{
|
|
this.plugin = plugin;
|
|
}
|
|
|
|
@Override
|
|
public boolean persist(){
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean canRegister(){
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public @NotNull String getIdentifier() {
|
|
return "nouns";
|
|
}
|
|
|
|
@Override
|
|
public @NotNull String getAuthor() {
|
|
return plugin.getDescription().getAuthors().toString();
|
|
}
|
|
|
|
@Override
|
|
public @NotNull String getVersion() {
|
|
return plugin.getDescription().getVersion();
|
|
}
|
|
|
|
|
|
@Override
|
|
public String onPlaceholderRequest(Player player, @NotNull String identifier) {
|
|
|
|
if (player == null) {
|
|
return "";
|
|
}
|
|
|
|
|
|
switch (identifier.toLowerCase()) {
|
|
case "main_pronoun":
|
|
return "1st";
|
|
case "secondary_pronoun":
|
|
return "2nd";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|