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

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

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto eol=lf

0
.gitignore vendored Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
api/pom.xml Normal file → Executable file
View File

0
api/src/main/java/com/alttd/chat/ChatAPI.java Normal file → Executable file
View File

View File

0
api/src/main/java/com/alttd/chat/config/Config.java Normal file → Executable file
View File

View File

View File

0
api/src/main/java/com/alttd/chat/database/Queries.java Normal file → Executable file
View File

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

View File

0
api/src/main/java/com/alttd/chat/objects/ChatUser.java Normal file → Executable file
View File

View File

0
api/src/main/java/com/alttd/chat/objects/Mail.java Normal file → Executable file
View File

0
api/src/main/java/com/alttd/chat/objects/Party.java Normal file → Executable file
View File

0
api/src/main/java/com/alttd/chat/util/ALogger.java Normal file → Executable file
View File

0
api/src/main/java/com/alttd/chat/util/Utility.java Normal file → Executable file
View File

0
galaxy/pom.xml Normal file → Executable file
View File

0
galaxy/src/main/java/com/alttd/chat/ChatPlugin.java Normal file → Executable file
View File

View File

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

0
galaxy/src/main/resources/plugin.yml Normal file → Executable file
View File

0
pom.xml Normal file → Executable file
View File

0
velocity/pom.xml Normal file → Executable file
View File

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
}

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 {

View File

@ -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

View File

View File

View File

View File

View File

View File

View File

View File