mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
add bungeecord specific kick api
This commit is contained in:
parent
d79b729d79
commit
e8aa942a60
@ -10,6 +10,7 @@ dependencies {
|
|||||||
exclude("com.google.code.gson", "gson")
|
exclude("com.google.code.gson", "gson")
|
||||||
exclude("net.kyori","adventure-api")
|
exclude("net.kyori","adventure-api")
|
||||||
}
|
}
|
||||||
|
compileOnly(libs.adventure.platforms.bungeecord)
|
||||||
}
|
}
|
||||||
|
|
||||||
description = "RedisBungee Bungeecord API"
|
description = "RedisBungee Bungeecord API"
|
||||||
|
@ -13,7 +13,8 @@ package com.imaginarycode.minecraft.redisbungee;
|
|||||||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeeMode;
|
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeeMode;
|
||||||
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
|
||||||
import com.imaginarycode.minecraft.redisbungee.api.summoners.JedisPooledSummoner;
|
import com.imaginarycode.minecraft.redisbungee.api.summoners.JedisPooledSummoner;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.serializer.bungeecord.BungeeComponentSerializer;
|
||||||
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
import net.md_5.bungee.api.config.ServerInfo;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
@ -56,6 +57,30 @@ public class RedisBungeeAPI extends AbstractRedisBungeeAPI {
|
|||||||
return ((Plugin) this.plugin).getProxy().getServerInfo(serverName);
|
return ((Plugin) this.plugin).getProxy().getServerInfo(serverName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kicks a player from the network but with bungeecord chat Component system
|
||||||
|
* calls {@link #getUuidFromName(String)} to get uuid
|
||||||
|
*
|
||||||
|
* @param playerName player name
|
||||||
|
* @param message kick message that player will see on kick
|
||||||
|
* @since 0.13.0
|
||||||
|
*/
|
||||||
|
public void kickPlayer(String playerName, BaseComponent[] message) {
|
||||||
|
kickPlayer(getUuidFromName(playerName), message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Kicks a player from the network but with bungeecord chat Component system
|
||||||
|
*
|
||||||
|
* @param playerUUID player name
|
||||||
|
* @param message kick message that player will see on kick
|
||||||
|
* @since 0.13.0
|
||||||
|
*/
|
||||||
|
public void kickPlayer(UUID playerUUID, BaseComponent[] message) {
|
||||||
|
kickPlayer(playerUUID, BungeeComponentSerializer.get().deserialize(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// LEGACY API FOR BACKWARD COMPATIBILITY
|
// LEGACY API FOR BACKWARD COMPATIBILITY
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user