Complete config redesign and feature additions
🎨 Config Redesign: - Unified style for all config files with beautiful headers - Consistent color scheme using gradients throughout - Improved readability with proper sections and comments - Fixed color formatting issues ✨ New Features: - SkinsRestorer integration for custom skins support - Head emoji system (:head_nickname: and @head nickname) - Clear chat message configuration command (/clearchatconfig) - Enhanced custom commands with more examples - Improved emoji system with 200+ emojis 📝 Documentation: - Completely rewritten README.md with modern styling - Added comprehensive feature descriptions - Detailed command and permission tables - Configuration examples and usage guides - Professional formatting and structure 🔧 Technical Improvements: - Fixed compilation errors - Improved code organization - Better error handling - Enhanced compatibility All configs now follow consistent MiniMessage gradient styling!
This commit is contained in:
parent
e616667c78
commit
01d8c3a2e7
34 changed files with 2650 additions and 1563 deletions
|
|
@ -0,0 +1,82 @@
|
|||
package com.loki.lochat.integrations;
|
||||
|
||||
import com.loki.lochat.LoChat;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* Интеграция с SkinsRestorer для получения скинов игроков
|
||||
* Использует рефлексию для совместимости без прямой зависимости
|
||||
*/
|
||||
public class SkinsRestorerHook {
|
||||
|
||||
private final LoChat plugin;
|
||||
private Object skinsAPI;
|
||||
private Method getSkinDataMethod;
|
||||
private boolean enabled = false;
|
||||
|
||||
public SkinsRestorerHook(LoChat plugin) {
|
||||
this.plugin = plugin;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
try {
|
||||
Plugin skinsPlugin = Bukkit.getPluginManager().getPlugin("SkinsRestorer");
|
||||
if (skinsPlugin == null || !skinsPlugin.isEnabled()) {
|
||||
plugin.getLogger().info("SkinsRestorer не найден");
|
||||
return;
|
||||
}
|
||||
|
||||
// Пытаемся получить API через рефлексию
|
||||
Class<?> apiClass = Class.forName("net.skinsrestorer.api.SkinsRestorerAPI");
|
||||
Method getApiMethod = apiClass.getMethod("getApi");
|
||||
skinsAPI = getApiMethod.invoke(null);
|
||||
|
||||
getSkinDataMethod = skinsAPI.getClass().getMethod("getSkinData", String.class);
|
||||
|
||||
enabled = true;
|
||||
plugin.getLogger().info("SkinsRestorer подключен!");
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().info("SkinsRestorer не найден или несовместимая версия");
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получает текстуру скина игрока
|
||||
* @param player игрок
|
||||
* @return URL текстуры или null
|
||||
*/
|
||||
public String getPlayerSkinTexture(Player player) {
|
||||
if (!enabled) return null;
|
||||
|
||||
try {
|
||||
Object property = getSkinDataMethod.invoke(skinsAPI, player.getName());
|
||||
if (property != null) {
|
||||
Method getValueMethod = property.getClass().getMethod("getValue");
|
||||
return (String) getValueMethod.invoke(property);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Игнорируем ошибки получения скина
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Получает URL головы игрока для отображения
|
||||
* @param playerName имя игрока
|
||||
* @return URL головы
|
||||
*/
|
||||
public String getPlayerHeadUrl(String playerName) {
|
||||
// Используем стандартные сервисы для получения голов
|
||||
return "https://minotar.net/helm/" + playerName + "/8.png";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue