Add plugin
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.alttd.chat.commands;
|
||||
package com.alttd.velocitychat.commands;
|
||||
|
||||
import com.alttd.chat.api.GlobalAdminChatEvent;
|
||||
import com.alttd.velocitychat.api.GlobalAdminChatEvent;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.alttd.chat.commands;
|
||||
package com.alttd.velocitychat.commands;
|
||||
|
||||
import com.alttd.chat.ChatPlugin;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
||||
@@ -17,12 +15,11 @@ public class GlobalChat {
|
||||
public GlobalChat(ProxyServer proxyServer) {
|
||||
LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
.<CommandSource>literal("globalchat")
|
||||
.requires(ctx -> ctx.hasPermission(Config.GCPERMISSION))
|
||||
.requires(ctx -> ctx.hasPermission("command.proxy.globalchat"))// TODO permission system? load permissions from config?
|
||||
.then(RequiredArgumentBuilder
|
||||
.<CommandSource, String>argument("message", StringArgumentType.greedyString())
|
||||
.executes(context -> {
|
||||
ChatPlugin.getPlugin().getChatHandler().globalChat(context.getSource(), context.getArgument("message", String.class));
|
||||
//ChatPlugin.getPlugin().getChatHandler().globalChat(context.getSource(), context.getArgument("message", String.class));
|
||||
return 1;
|
||||
})
|
||||
)
|
||||
@@ -33,10 +30,6 @@ public class GlobalChat {
|
||||
|
||||
CommandMeta.Builder metaBuilder = proxyServer.getCommandManager().metaBuilder(brigadierCommand);
|
||||
|
||||
for (String alias : Config.GCCOMMANDALIASES) {
|
||||
metaBuilder.aliases(alias);
|
||||
}
|
||||
|
||||
CommandMeta meta = metaBuilder.build();
|
||||
|
||||
proxyServer.getCommandManager().register(meta, brigadierCommand);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.alttd.chat.commands;
|
||||
package com.alttd.velocitychat.commands;
|
||||
|
||||
import com.alttd.chat.ChatPlugin;
|
||||
import com.alttd.velocitychat.ChatPlugin;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.alttd.chat.commands;
|
||||
package com.alttd.velocitychat.commands;
|
||||
|
||||
import com.alttd.chat.ChatPlugin;
|
||||
import com.alttd.chat.api.PrivateMessageEvent;
|
||||
import com.alttd.velocitychat.ChatPlugin;
|
||||
import com.alttd.velocitychat.api.PrivateMessageEvent;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
Reference in New Issue
Block a user