idk what i fucked up here all files are new in git?
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
-2
@@ -1,13 +1,11 @@
|
||||
package com.alttd.chat.managers;
|
||||
|
||||
import com.alttd.chat.database.Queries;
|
||||
import com.alttd.chat.objects.ChatUser;
|
||||
import com.alttd.chat.objects.Mail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class ChatUserManager {
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+20
@@ -1,11 +1,16 @@
|
||||
package com.alttd.chat.listeners;
|
||||
|
||||
import com.alttd.chat.managers.ChatUserManager;
|
||||
import com.alttd.chat.managers.RegexManager;
|
||||
import com.alttd.chat.objects.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayerListener implements Listener {
|
||||
@@ -21,5 +26,20 @@ public class PlayerListener implements Listener {
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true) // untested
|
||||
public void onSignChangeE(SignChangeEvent event) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
Component component = event.line(i);
|
||||
if (component != null) {
|
||||
String message = PlainComponentSerializer.plain().serialize(component);
|
||||
|
||||
message = RegexManager.replaceText(message); // todo a better way for this
|
||||
|
||||
component = message == null ? Component.empty() : Component.text(message);
|
||||
|
||||
event.line(i, component);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
-2
@@ -1,7 +1,6 @@
|
||||
package com.alttd.chat;
|
||||
|
||||
import com.alttd.chat.commands.GlobalAdminChat;
|
||||
import com.alttd.chat.commands.GlobalChat;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.alttd.chat.handlers.ChatHandler;
|
||||
import com.alttd.chat.handlers.ServerHandler;
|
||||
@@ -84,7 +83,6 @@ public class VelocityChat {
|
||||
|
||||
public void loadCommands() {
|
||||
new GlobalAdminChat(server);
|
||||
new GlobalChat(server);
|
||||
// all (proxy)commands go here
|
||||
}
|
||||
|
||||
|
||||
Regular → Executable
-2
@@ -1,7 +1,6 @@
|
||||
package com.alttd.chat.commands;
|
||||
|
||||
import com.alttd.chat.VelocityChat;
|
||||
import com.alttd.chat.events.GlobalAdminChatEvent;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
@@ -10,7 +9,6 @@ import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.velocitypowered.api.command.BrigadierCommand;
|
||||
import com.velocitypowered.api.command.CommandMeta;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
|
||||
public class GlobalAdminChat {
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.alttd.chat.commands;
|
||||
|
||||
import com.alttd.chat.VelocityChat;
|
||||
import com.alttd.chat.config.Config;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.velocitypowered.api.command.BrigadierCommand;
|
||||
import com.velocitypowered.api.command.CommandMeta;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
|
||||
public class GlobalChat {
|
||||
|
||||
public GlobalChat(ProxyServer proxyServer) {
|
||||
// LiteralCommandNode<CommandSource> command = LiteralArgumentBuilder
|
||||
// .<CommandSource>literal("globalchat")
|
||||
// .requires(ctx -> ctx.hasPermission("command.proxy.globalchat"))// TODO permission system? load permissions from config?
|
||||
// .requires(ctx -> ctx instanceof Player) // players only can use this
|
||||
// .then(RequiredArgumentBuilder
|
||||
// .<CommandSource, String>argument("message", StringArgumentType.greedyString())
|
||||
// .executes(context -> {
|
||||
// VelocityChat.getPlugin().getChatHandler().globalChat((Player) context.getSource(), context.getArgument("message", String.class));
|
||||
// return 1;
|
||||
// })
|
||||
// )
|
||||
// .executes(context -> 0) // todo info message /usage
|
||||
// .build();
|
||||
//
|
||||
// BrigadierCommand brigadierCommand = new BrigadierCommand(command);
|
||||
//
|
||||
// CommandMeta.Builder metaBuilder = proxyServer.getCommandManager().metaBuilder(brigadierCommand);
|
||||
//
|
||||
// for (String alias : Config.GCALIAS) {
|
||||
// metaBuilder.aliases(alias);
|
||||
// }
|
||||
// CommandMeta meta = metaBuilder.build();
|
||||
//
|
||||
// proxyServer.getCommandManager().register(meta, brigadierCommand);
|
||||
}
|
||||
}
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user