2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-05-05 12:40:27 +00:00

finishup bungeecord, move to mini message as serialzier

This commit is contained in:
2025-02-22 19:04:06 +04:00
parent 338297192c
commit 1fb429ea77
18 changed files with 165 additions and 92 deletions

View File

@@ -7,7 +7,6 @@ dependencies {
implementation(libs.acf.core)
compileOnly(libs.adventure.api)
compileOnly(libs.adventure.miniMessage)
compileOnly(libs.adventure.gson)
}
description = "RedisBungee common commands"

View File

@@ -14,7 +14,6 @@ import co.aikar.commands.CommandIssuer;
import co.aikar.commands.annotation.*;
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
import com.imaginarycode.minecraft.redisbungee.commands.utils.AdventureBaseCommand;
import net.kyori.adventure.text.Component;
import java.util.UUID;
@@ -33,16 +32,14 @@ public class CommandRedisBungeeDebug extends AdventureBaseCommand {
@Description("kicks a player from the network by name")
@Private
public void kick(CommandIssuer issuer, String playerName) {
String message = serializeMessage(Component.text("kicked using redisbungee api using name"));
plugin.playerDataManager().serializedPlayerKick(plugin.getUuidTranslator().getTranslatedUuid(playerName, false), message);
plugin.playerDataManager().serializedPlayerKick(plugin.getUuidTranslator().getTranslatedUuid(playerName, false), "kicked using redisbungee api using name");
}
@Subcommand("kickByUUID")
@Description("kicks a player from the network by UUID")
@Private
public void kick(CommandIssuer issuer, UUID uuid) {
String message = serializeMessage(Component.text("kicked using redisbungee api using uuid"));
plugin.playerDataManager().serializedPlayerKick(uuid, message);
plugin.playerDataManager().serializedPlayerKick(uuid, "kicked using redisbungee api using uuid");
}

View File

@@ -13,7 +13,6 @@ package com.imaginarycode.minecraft.redisbungee.commands.utils;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.CommandIssuer;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
/**
* this just dumb class that wraps the adventure stuff into base command
@@ -24,10 +23,4 @@ public abstract class AdventureBaseCommand extends BaseCommand {
CommandPlatformHelper.getPlatformHelper().sendMessage(issuer, component);
}
private static final GsonComponentSerializer COMPONENT_SERIALIZER = GsonComponentSerializer.gson();
protected String serializeMessage(Component message) {
return COMPONENT_SERIALIZER.serialize(message);
}
}