Fix color preservation when changing prefix and add LibertyBans integration
- Fixed issue where gradient colors were lost when changing prefix - Updated GradientGUIListener to preserve existing colors when setting prefix - Updated GradientPrefixCommand to pass existing colors to confirmation GUI - Added LibertyBans integration (simple version without API dependency) - Added LibertyBans to softdepend in plugin.yml - LibertyBans integration detects plugin presence but relies on LibertyBans own mute handling
This commit is contained in:
parent
ef1a6320cb
commit
ee626c8d8b
6 changed files with 91 additions and 1 deletions
|
|
@ -0,0 +1,61 @@
|
|||
package com.loki.lochat.integrations;
|
||||
|
||||
import com.loki.lochat.LoChat;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Интеграция с LibertyBans для проверки мутов
|
||||
* Простая версия без API зависимости
|
||||
*/
|
||||
public class LibertyBansHook {
|
||||
|
||||
private final LoChat plugin;
|
||||
private boolean enabled = false;
|
||||
private Plugin libertyBansPlugin;
|
||||
|
||||
public LibertyBansHook(LoChat plugin) {
|
||||
this.plugin = plugin;
|
||||
initialize();
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
libertyBansPlugin = plugin.getServer().getPluginManager().getPlugin("LibertyBans");
|
||||
if (libertyBansPlugin == null || !libertyBansPlugin.isEnabled()) {
|
||||
plugin.getLogger().info("LibertyBans не найден, интеграция отключена");
|
||||
return;
|
||||
}
|
||||
|
||||
this.enabled = true;
|
||||
plugin.getLogger().info("LibertyBans найден, но API интеграция недоступна. Используйте команды LibertyBans для управления мутами.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Проверяет, замучен ли игрок
|
||||
* В простой версии всегда возвращает false, так как нет доступа к API
|
||||
* @param player игрок для проверки
|
||||
* @return CompletableFuture<Boolean> - всегда false в простой версии
|
||||
*/
|
||||
public CompletableFuture<Boolean> isMuted(Player player) {
|
||||
// В простой версии без API мы не можем проверить мут
|
||||
// Пользователи должны использовать команды LibertyBans
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* В простой версии без API недоступно
|
||||
*/
|
||||
public CompletableFuture<Object> getActiveMute(Player player) {
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public boolean isPluginPresent() {
|
||||
return libertyBansPlugin != null && libertyBansPlugin.isEnabled();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue