mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2025-12-26 02:19:28 +00:00
delete useless files
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
package net.momirealms.customnameplates;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class HookManager {
|
||||
|
||||
private boolean placeholderAPI;
|
||||
private boolean itemsAdder;
|
||||
|
||||
public boolean hasPlaceholderAPI() {
|
||||
return this.placeholderAPI;
|
||||
}
|
||||
public boolean hasItemsAdder() {
|
||||
return this.itemsAdder;
|
||||
}
|
||||
|
||||
public HookManager(CustomNameplates plugin) {
|
||||
this.initializePlaceholderAPI();
|
||||
this.initializeItemsAdder();
|
||||
}
|
||||
|
||||
//Papi Hook检测
|
||||
private void initializePlaceholderAPI() {
|
||||
if(!ConfigManager.MainConfig.placeholderAPI){
|
||||
this.placeholderAPI = false;
|
||||
return;
|
||||
}
|
||||
if(CustomNameplates.instance.getServer().getPluginManager().getPlugin("PlaceholderAPI") != null){
|
||||
this.placeholderAPI = true;
|
||||
AdventureManager.consoleMessage("<gradient:#DDE4FF:#8DA2EE>[CustomNameplates]</gradient> " + "<color:#F5F5F5>PlaceholderAPI Hooked!");
|
||||
}
|
||||
}
|
||||
//ItemsAdder Hook检测
|
||||
private void initializeItemsAdder() {
|
||||
if (!ConfigManager.MainConfig.itemsAdder) {
|
||||
this.itemsAdder = false;
|
||||
}
|
||||
if(CustomNameplates.instance.getServer().getPluginManager().getPlugin("ItemsAdder") != null){
|
||||
this.itemsAdder = true;
|
||||
AdventureManager.consoleMessage("<gradient:#DDE4FF:#8DA2EE>[CustomNameplates]</gradient> " + "<color:#F5F5F5>ItemsAdder Hooked!");
|
||||
}
|
||||
}
|
||||
/*
|
||||
解析prefix与suffix
|
||||
*/
|
||||
public String parsePlaceholders(Player player, String papi) {
|
||||
String s = StringUtils.replace(StringUtils.replace(papi, "%player_name%", player.getName()), "%player_displayname%", player.getDisplayName());
|
||||
s = PlaceholderAPI.setPlaceholders(player, s);
|
||||
return ChatColor.translateAlternateColorCodes('&', s);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package net.momirealms.customnameplates.hook;
|
||||
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.momirealms.customnameplates.CustomNameplates;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PapiPlate extends PlaceholderExpansion{
|
||||
|
||||
private CustomNameplates plugin;
|
||||
|
||||
public PapiPlate(CustomNameplates plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getIdentifier() {
|
||||
return "nameplates";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getAuthor() {
|
||||
return "XiaoMoMi";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onRequest(OfflinePlayer player, String params) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user