idk what i fucked up here all files are new in git?
This commit is contained in:
parent
a5c23d842d
commit
5bea7c95f9
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
* text=auto eol=lf
|
||||
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
api/pom.xml
Normal file → Executable file
0
api/pom.xml
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/ChatAPI.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/ChatAPI.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/ChatImplementation.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/ChatImplementation.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/config/Config.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/config/Config.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/config/RegexConfig.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/config/RegexConfig.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/database/DatabaseConnection.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/database/DatabaseConnection.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/database/Queries.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/database/Queries.java
Normal file → Executable file
2
api/src/main/java/com/alttd/chat/managers/ChatUserManager.java
Normal file → Executable file
2
api/src/main/java/com/alttd/chat/managers/ChatUserManager.java
Normal file → Executable 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 {
|
||||
|
|
|
|||
0
api/src/main/java/com/alttd/chat/managers/RegexManager.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/managers/RegexManager.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/ChatFilter.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/ChatFilter.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/ChatUser.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/ChatUser.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/FilterType.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/FilterType.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/Mail.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/Mail.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/Party.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/objects/Party.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/util/ALogger.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/util/ALogger.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/util/Utility.java
Normal file → Executable file
0
api/src/main/java/com/alttd/chat/util/Utility.java
Normal file → Executable file
0
galaxy/pom.xml
Normal file → Executable file
0
galaxy/pom.xml
Normal file → Executable file
0
galaxy/src/main/java/com/alttd/chat/ChatPlugin.java
Normal file → Executable file
0
galaxy/src/main/java/com/alttd/chat/ChatPlugin.java
Normal file → Executable file
0
galaxy/src/main/java/com/alttd/chat/handler/ChatHandler.java
Normal file → Executable file
0
galaxy/src/main/java/com/alttd/chat/handler/ChatHandler.java
Normal file → Executable file
20
galaxy/src/main/java/com/alttd/chat/listeners/PlayerListener.java
Normal file → Executable file
20
galaxy/src/main/java/com/alttd/chat/listeners/PlayerListener.java
Normal file → Executable 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
0
galaxy/src/main/java/com/alttd/chat/listeners/PluginMessage.java
Normal file → Executable file
0
galaxy/src/main/java/com/alttd/chat/listeners/PluginMessage.java
Normal file → Executable file
0
galaxy/src/main/resources/plugin.yml
Normal file → Executable file
0
galaxy/src/main/resources/plugin.yml
Normal file → Executable file
0
velocity/pom.xml
Normal file → Executable file
0
velocity/pom.xml
Normal file → Executable file
2
velocity/src/main/java/com/alttd/chat/VelocityChat.java
Normal file → Executable file
2
velocity/src/main/java/com/alttd/chat/VelocityChat.java
Normal file → Executable 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
velocity/src/main/java/com/alttd/chat/commands/GlobalAdminChat.java
Normal file → Executable file
2
velocity/src/main/java/com/alttd/chat/commands/GlobalAdminChat.java
Normal file → Executable 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);
|
||||
}
|
||||
}
|
||||
0
velocity/src/main/java/com/alttd/chat/commands/Message.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/commands/Message.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/commands/SendMail.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/commands/SendMail.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/config/ServerConfig.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/config/ServerConfig.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/data/ServerWrapper.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/data/ServerWrapper.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/events/GlobalAdminChatEvent.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/events/GlobalAdminChatEvent.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/events/PrivateMessageEvent.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/events/PrivateMessageEvent.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/handlers/ChatHandler.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/handlers/ChatHandler.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/handlers/ServerHandler.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/handlers/ServerHandler.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/ChatListener.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/ChatListener.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/PluginMessageListener.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/PluginMessageListener.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/ProxyPlayerListener.java
Normal file → Executable file
0
velocity/src/main/java/com/alttd/chat/listeners/ProxyPlayerListener.java
Normal file → Executable file
Loading…
Reference in New Issue
Block a user