Class PlayerOnlyContextProvider
java.lang.Object
dev.rollczi.litecommands.velocity.context.PlayerOnlyContextProvider
- All Implemented Interfaces:
dev.rollczi.litecommands.context.ContextChainedProvider<com.velocitypowered.api.command.CommandSource,,com.velocitypowered.api.proxy.Player> dev.rollczi.litecommands.context.ContextProvider<com.velocitypowered.api.command.CommandSource,com.velocitypowered.api.proxy.Player>
public class PlayerOnlyContextProvider
extends Object
implements dev.rollczi.litecommands.context.ContextProvider<com.velocitypowered.api.command.CommandSource,com.velocitypowered.api.proxy.Player>
Built-in context provider that provides a player instance if the sender is a player.
Otherwise, it returns an error message. You can modify the message using
For example:
LiteCommandsBuilder.message(MessageKey, Object).
For example:
or with the lambda function:builder.message(LiteVelocityMessages.PLAYER_ONLY, "Your custom message here");
builder.message(LiteVelocityMessages.PLAYER_ONLY, (invocation, __) -> "Your custom message here");
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerOnlyContextProvider(dev.rollczi.litecommands.message.MessageRegistry<com.velocitypowered.api.command.CommandSource> messageRegistry) -
Method Summary
Modifier and TypeMethodDescriptiondev.rollczi.litecommands.context.ContextResult<com.velocitypowered.api.proxy.Player> provide(dev.rollczi.litecommands.invocation.Invocation<com.velocitypowered.api.command.CommandSource> invocation) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.rollczi.litecommands.context.ContextProvider
provide
-
Constructor Details
-
PlayerOnlyContextProvider
public PlayerOnlyContextProvider(dev.rollczi.litecommands.message.MessageRegistry<com.velocitypowered.api.command.CommandSource> messageRegistry)
-
-
Method Details
-
provide
public dev.rollczi.litecommands.context.ContextResult<com.velocitypowered.api.proxy.Player> provide(dev.rollczi.litecommands.invocation.Invocation<com.velocitypowered.api.command.CommandSource> invocation) - Specified by:
providein interfacedev.rollczi.litecommands.context.ContextProvider<com.velocitypowered.api.command.CommandSource,com.velocitypowered.api.proxy.Player>
-