parent
dad3ac76e3
commit
80c761dff9
4 changed files with 41 additions and 3 deletions
@ -0,0 +1,36 @@ |
|||||||
|
package xyz.soukup.ecocraftVelocity.chat; |
||||||
|
|
||||||
|
import com.mojang.brigadier.Command; |
||||||
|
import com.mojang.brigadier.arguments.StringArgumentType; |
||||||
|
import com.mojang.brigadier.context.CommandContext; |
||||||
|
import com.mojang.brigadier.tree.LiteralCommandNode; |
||||||
|
import com.velocitypowered.api.command.BrigadierCommand; |
||||||
|
import com.velocitypowered.api.command.CommandSource; |
||||||
|
import com.velocitypowered.api.proxy.Player; |
||||||
|
import com.velocitypowered.api.proxy.ProxyServer; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public class ReplyCommand { |
||||||
|
|
||||||
|
public static HashMap<CommandSource, List<Player>> replyRecipients = new HashMap<>(); |
||||||
|
|
||||||
|
public static BrigadierCommand replyCommand(final ProxyServer proxy){ |
||||||
|
LiteralCommandNode<CommandSource> reply = BrigadierCommand.literalArgumentBuilder("r") |
||||||
|
.then(BrigadierCommand.requiredArgumentBuilder("message", StringArgumentType.greedyString()) |
||||||
|
.executes(ReplyCommand::reply) |
||||||
|
) |
||||||
|
.build(); |
||||||
|
|
||||||
|
return new BrigadierCommand(reply); |
||||||
|
} |
||||||
|
|
||||||
|
private static int reply(CommandContext<CommandSource> ctx){ |
||||||
|
String message = ctx.getArgument("message", String.class); |
||||||
|
List<Player> recipients = replyRecipients.get(ctx.getSource()); |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue