mirror of
https://github.com/Verdurae/PlaceholderPlus.git
synced 2026-11-25 14:24:32 +08:00
修改代码结构
添加了api
This commit is contained in:
1 parent
11289fa6c6
commit
4d2919cfb3
10 files changed
+101
-15
No files matched your search
@@ -4,12 +4,15 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.verdurae.placeholderplus.API.PlayerAPI;
|
||||
import org.verdurae.placeholderplus.Util.PlayerAPI;
|
||||
|
||||
public class ThisPlaceholder extends PlaceholderExpansion {
|
||||
@Override
|
||||
public @Nullable("null") String onRequest(OfflinePlayer player, @NotNull String param) {
|
||||
String[] params = param.split("_");
|
||||
if (params.length < 2) {
|
||||
params = new String[]{"normal", params[0]};
|
||||
}
|
||||
if (params[0].equals("normal")) {
|
||||
String a = PlayerAPI.getPlayerData(player.getName()).getString("normal." + params[1]);
|
||||
return (a == null) ? PlaceholderPlus.config.getString("Placeholders.normal." + params[1]) : a;
|
||||
|
||||
Reference in new issue
Block a user