Class NukkitDirectPlayerExecutor
java.lang.Object
eu.cloudnetservice.modules.bridge.platform.PlatformPlayerExecutorAdapter<cn.nukkit.Player>
eu.cloudnetservice.modules.bridge.platform.nukkit.NukkitDirectPlayerExecutor
- All Implemented Interfaces:
PlayerExecutor
-
Field Summary
FieldsFields inherited from class eu.cloudnetservice.modules.bridge.platform.PlatformPlayerExecutorAdapter
playerSupplier, uniqueIdFields inherited from interface eu.cloudnetservice.modules.bridge.player.executor.PlayerExecutor
GLOBAL_UNIQUE_ID -
Constructor Summary
ConstructorsConstructorDescriptionNukkitDirectPlayerExecutor(@NonNull cn.nukkit.Server server, @NonNull UUID targetUniqueId, @NonNull Supplier<Collection<? extends cn.nukkit.Player>> playerSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidConnects the player associated with this player executor to the given service.voidconnectSelecting(@NonNull ServerSelectorType selectorType) Connects the player associated with this player executor to any service running the cluster.voidConnects the player associated with this player executor to the best matching fallback.voidconnectToGroup(@NonNull String group, @NonNull ServerSelectorType selectorType) Connects the player associated with this player executor to any service having the given group assigned.voidconnectToTask(@NonNull String task, @NonNull ServerSelectorType selectorType) Connects the player associated with this player executor to any service having the given task assigned.voidKicks the player associated with this player executor and the component as reason.voidsendChatMessage(@NonNull Component message, @Nullable String permission) Sends the given message component as chat message to the player associated with this player executor.voidsendPluginMessage(@NonNull String key, byte[] data) Sends a plugin channel message to the player associated with this player executor using the given channel and data.protected voidvoidspoofCommandExecution(@NonNull String command, boolean redirectToServer) Spoofs the command execution for the player associated with this player executor.Methods inherited from class eu.cloudnetservice.modules.bridge.platform.PlatformPlayerExecutorAdapter
forEach, sendTitle, uniqueIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.modules.bridge.player.executor.PlayerExecutor
sendChatMessage, spoofCommandExecution
-
Field Details
-
server
private final cn.nukkit.Server server
-
-
Constructor Details
-
NukkitDirectPlayerExecutor
-
-
Method Details
-
connect
Description copied from interface:PlayerExecutorConnects the player associated with this player executor to the given service.- Parameters:
serviceName- the service to connect the player to.
-
connectSelecting
Description copied from interface:PlayerExecutorConnects the player associated with this player executor to any service running the cluster. The service is chosen by the given server selector.- Parameters:
selectorType- the selector used for the service selection.
-
connectToFallback
public void connectToFallback()Description copied from interface:PlayerExecutorConnects the player associated with this player executor to the best matching fallback. -
connectToGroup
public void connectToGroup(@NonNull @NonNull String group, @NonNull @NonNull ServerSelectorType selectorType) Description copied from interface:PlayerExecutorConnects the player associated with this player executor to any service having the given group assigned. The service is chosen by the given server selector.- Parameters:
group- the group a service has to have.selectorType- the selector used for the service selection.
-
connectToTask
public void connectToTask(@NonNull @NonNull String task, @NonNull @NonNull ServerSelectorType selectorType) Description copied from interface:PlayerExecutorConnects the player associated with this player executor to any service having the given task assigned. The service is chosen by the given server selector.- Parameters:
task- the task the service has to have.selectorType- the selector used for the service selection.
-
kick
Description copied from interface:PlayerExecutorKicks the player associated with this player executor and the component as reason.- Parameters:
message- the message to display in the disconnect screen.
-
sendTitle
-
sendChatMessage
public void sendChatMessage(@NonNull @NonNull Component message, @Nullable @Nullable String permission) Description copied from interface:PlayerExecutorSends the given message component as chat message to the player associated with this player executor.If a permission is given the player is required to have the permission, otherwise the message is not sent.
- Parameters:
message- the message to send to the player.permission- the permission required to get the message.
-
sendPluginMessage
Description copied from interface:PlayerExecutorSends a plugin channel message to the player associated with this player executor using the given channel and data. The channel used has to be registered on the service software.- Parameters:
key- the channel to send the plugin message in.data- the data to send to the player.
-
spoofCommandExecution
Description copied from interface:PlayerExecutorSpoofs the command execution for the player associated with this player executor. The given command input should not contain a leading slash as it is added on the fly.If redirecting to the downstream service is desired the command is executed on the proxy first, if no command was found it is redirected to the downstream service the player is connected to.
- Parameters:
command- the command to execute for the player.redirectToServer- whether to command should get redirected to the downstream.
-