idk what i fucked up here all files are new in git?

This commit is contained in:
destro174 committed 2021-06-20 22:03:39 +02:00
1 parent a5c23d842d
commit 5bea7c95f9
41 files changed
+21 -49

No files matched your search

+1
View File
@@ -0,0 +1 @@
* text=auto eol=lf
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
-2
View File
@@ -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 {
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
Regular → Executable
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
+20
View File
@@ -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);
}
}
}
}
View File
File mode changed.
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
-2
View File
@@ -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
}
-2
View File
@@ -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);
}
}
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
View File
File mode changed.
File mode changed.
File mode changed.