Initial rework to Placeholder Manager

This commit is contained in:
Fabrizio La Rosa 2020-07-14 19:40:23 +02:00
parent 2fe3f5c661
commit a53729bed0
5 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package com.songoda.skyblock.placeholder.wip;
public class Placeholder {
private final String placeholder;
private final String result;
public Placeholder(String placeholder, String result) {
this.placeholder = placeholder;
this.result = result;
}
public String getPlaceholder() {
return placeholder;
}
public String getResult() {
return result;
}
}

View File

@ -0,0 +1,4 @@
package com.songoda.skyblock.placeholder.wip;
public class PlaceholderManager {
}

View File

@ -0,0 +1,13 @@
package com.songoda.skyblock.placeholder.wip;
import org.bukkit.entity.Player;
public class PlaceholderProcessor {
public static String processPlaceholder(Player player, String placeholder) {
if(player == null || placeholder == null) {
return "";
}
return "To be implemented";
}
}

View File

@ -0,0 +1,4 @@
package com.songoda.skyblock.placeholder.wip.hook;
public class MVdWPlaceholder {
}

View File

@ -0,0 +1,40 @@
package com.songoda.skyblock.placeholder.wip.hook;
import com.songoda.skyblock.SkyBlock;
import com.songoda.skyblock.placeholder.wip.PlaceholderProcessor;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player;
public class PlaceholderAPI extends PlaceholderExpansion {
private final SkyBlock plugin;
public PlaceholderAPI(SkyBlock plugin) {
this.plugin = plugin;
}
public String getIdentifier() {
return "fabledskyblock";
}
public String getPlugin() {
return null;
}
public String getAuthor() {
return plugin.getDescription().getAuthors().get(0);
}
public String getVersion() {
return plugin.getDescription().getVersion();
}
public boolean persist() {
return true;
}
public String onPlaceholderRequest(Player player, String identifier) {
return PlaceholderProcessor.processPlaceholder(player, "fabledskyblock_" + identifier);
}
}