1 Commits
Author SHA1 Message Date
auto 9e437079e4 Remove Galaxy dependency
Switched back to paper since we don't use any features from Galaxy that aren't already in paper
2025-03-21 20:34:45 +01:00
14 changed files with 46 additions and 44 deletions
+4 -3
View File
@@ -3,9 +3,10 @@ plugins {
} }
dependencies { dependencies {
compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") { // compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") {
// exclude("net.kyori") // exclude("net.kyori")
} // }
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
compileOnly("org.spongepowered:configurate-yaml:4.1.2") // Configurate compileOnly("org.spongepowered:configurate-yaml:4.1.2") // Configurate
compileOnly("net.luckperms:api:5.3") // Luckperms compileOnly("net.luckperms:api:5.3") // Luckperms
} }
@@ -24,4 +25,4 @@ publishing {
credentials(PasswordCredentials::class) credentials(PasswordCredentials::class)
} }
} }
} }
@@ -424,7 +424,6 @@ public final class Config {
public static String mailUnread = "<green><click:run_command:/mail list unread>You have <amount> unread mail, click to view it.</click></green>"; public static String mailUnread = "<green><click:run_command:/mail list unread>You have <amount> unread mail, click to view it.</click></green>";
public static String mailSent = "<green>Successfully send mail to <player_name></green>: <#2e8b57><message></#2e8b57>"; public static String mailSent = "<green>Successfully send mail to <player_name></green>: <#2e8b57><message></#2e8b57>";
public static List<String> mailCommandAlias = new ArrayList<>(); public static List<String> mailCommandAlias = new ArrayList<>();
public static int mailDisplayDelay = 5;
private static void mailSettings() { private static void mailSettings() {
mailHeader = getString("settings.mail.header", mailHeader); mailHeader = getString("settings.mail.header", mailHeader);
mailBody = getString("settings.mail.message", mailBody); mailBody = getString("settings.mail.message", mailBody);
@@ -433,7 +432,6 @@ public final class Config {
mailReceived = getString("settings.mail.mail-received", mailReceived); mailReceived = getString("settings.mail.mail-received", mailReceived);
mailUnread = getString("settings.mail.mail-unread", mailUnread); mailUnread = getString("settings.mail.mail-unread", mailUnread);
mailSent = getString("settings.mail.mail-sent", mailSent); mailSent = getString("settings.mail.mail-sent", mailSent);
mailDisplayDelay = getInt("settings.mail.delay", mailDisplayDelay);
} }
public static HashMap<String, Long> serverChannelId = new HashMap<>(); public static HashMap<String, Long> serverChannelId = new HashMap<>();
@@ -505,7 +503,7 @@ public final class Config {
public static String NICK_TOO_SOON = "<red>Please wait <time><red> until requesting a new nickname"; public static String NICK_TOO_SOON = "<red>Please wait <time><red> until requesting a new nickname";
public static String NICK_REQUEST_PLACED = "<green>Replaced your previous request <oldrequestednick><green> with <newrequestednick><green>."; public static String NICK_REQUEST_PLACED = "<green>Replaced your previous request <oldrequestednick><green> with <newrequestednick><green>.";
public static String NICK_REQUEST_NEW = "<green>New nickname request by <player><green>!"; public static String NICK_REQUEST_NEW = "<green>New nickname request by <player><green>!";
public static String NICK_TRYOUT = "<white><prefix><white> <nick><gray>: <white><click:suggest_command:/nick request <nickrequest>>Hi, this is what my new nickname could look like! Click this message to request."; public static String NICK_TRYOUT = "<white><prefix><white> <nick><gray>: <white>Hi, this is what my new nickname could look like!";
public static String NICK_REQUESTED = "<green>Your requested to be nicknamed <nick><green> has been received. Staff will accept or deny this request asap!"; public static String NICK_REQUESTED = "<green>Your requested to be nicknamed <nick><green> has been received. Staff will accept or deny this request asap!";
public static String NICK_REVIEW_WAITING = "<green>There are <amount> nicknames waiting for review!"; public static String NICK_REVIEW_WAITING = "<green>There are <amount> nicknames waiting for review!";
public static String NICK_TAKEN = "<red>Someone else already has this nickname, or has this name as their username."; public static String NICK_TAKEN = "<red>Someone else already has this nickname, or has this name as their username.";
+3 -2
View File
@@ -5,7 +5,8 @@ plugins {
dependencies { dependencies {
implementation(project(":api")) // API implementation(project(":api")) // API
compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") // Galaxy // compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") // Galaxy
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") // move to proxy compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") // move to proxy
compileOnly("org.apache.commons:commons-lang3:3.12.0") // needs an alternative, already removed from upstream api and will be removed in server compileOnly("org.apache.commons:commons-lang3:3.12.0") // needs an alternative, already removed from upstream api and will be removed in server
compileOnly("net.luckperms:api:5.3") // Luckperms compileOnly("net.luckperms:api:5.3") // Luckperms
@@ -21,4 +22,4 @@ tasks {
dependsOn(shadowJar) dependsOn(shadowJar)
} }
} }
@@ -38,7 +38,7 @@ public class ChatPlugin extends JavaPlugin {
chatAPI = new ChatImplementation(); chatAPI = new ChatImplementation();
chatHandler = new ChatHandler(); chatHandler = new ChatHandler();
DatabaseConnection.initialize(); DatabaseConnection.initialize();
serverConfig = new ServerConfig(Bukkit.getServerName()); serverConfig = new ServerConfig(Bukkit.getServer().getName());
ChatLogHandler chatLogHandler = ChatLogHandler.getInstance(true); ChatLogHandler chatLogHandler = ChatLogHandler.getInstance(true);
registerListener(new PlayerListener(serverConfig), new ChatListener(chatLogHandler), new BookListener(), new ShutdownListener(chatLogHandler, this)); registerListener(new PlayerListener(serverConfig), new ChatListener(chatLogHandler), new BookListener(), new ShutdownListener(chatLogHandler, this));
if(serverConfig.GLOBALCHAT) { if(serverConfig.GLOBALCHAT) {
@@ -119,7 +119,7 @@ public class ChatPlugin extends JavaPlugin {
public void ReloadConfig() { public void ReloadConfig() {
chatAPI.ReloadConfig(); chatAPI.ReloadConfig();
chatAPI.ReloadChatFilters(); chatAPI.ReloadChatFilters();
serverConfig = new ServerConfig(Bukkit.getServerName()); serverConfig = new ServerConfig(Bukkit.getServer().getName());
Bukkit.broadcast(Utility.parseMiniMessage("Reloaded ChatPlugin Config."), "command.chat.reloadchat"); Bukkit.broadcast(Utility.parseMiniMessage("Reloaded ChatPlugin Config."), "command.chat.reloadchat");
ALogger.info("Reloaded ChatPlugin config."); ALogger.info("Reloaded ChatPlugin config.");
} }
@@ -38,7 +38,7 @@ public class ChatChannel extends BukkitCommand {
} }
if(args.length == 0 && player.hasPermission(channel.getPermission())) { if(args.length == 0 && player.hasPermission(channel.getPermission())) {
player.sendMiniMessage(Config.CUSTOM_CHANNEL_TOGGLED, TagResolver.resolver( player.sendRichMessage(Config.CUSTOM_CHANNEL_TOGGLED, TagResolver.resolver(
Placeholder.unparsed("channel", channel.getChannelName()), Placeholder.unparsed("channel", channel.getChannelName()),
Placeholder.component("status", toggleableForCustomChannel.toggle(player.getUniqueId()) Placeholder.component("status", toggleableForCustomChannel.toggle(player.getUniqueId())
? Config.TOGGLED_ON : Config.TOGGLED_OFF))); ? Config.TOGGLED_ON : Config.TOGGLED_OFF)));
@@ -27,7 +27,7 @@ public class PartyChat extends Toggleable implements CommandExecutor {
} }
if(args.length == 0) { if(args.length == 0) {
player.sendMiniMessage(Config.PARTY_TOGGLED, Placeholder.component("status", player.sendRichMessage(Config.PARTY_TOGGLED, Placeholder.component("status",
toggle(player.getUniqueId()) ? Config.TOGGLED_ON : Config.TOGGLED_OFF)); toggle(player.getUniqueId()) ? Config.TOGGLED_ON : Config.TOGGLED_OFF));
return true; return true;
} }
@@ -131,7 +131,7 @@ public class ChatHandler {
Placeholder.component("sender", senderName), Placeholder.component("sender", senderName),
Placeholder.component("prefix", prefix), Placeholder.component("prefix", prefix),
Placeholder.component("message", parseMessageContent(player, message)), Placeholder.component("message", parseMessageContent(player, message)),
Placeholder.parsed("server", Bukkit.getServerName()) Placeholder.parsed("server", Bukkit.getServer().getName())
); );
Component component = Utility.parseMiniMessage(Config.GCFORMAT, placeholders); Component component = Utility.parseMiniMessage(Config.GCFORMAT, placeholders);
@@ -165,7 +165,7 @@ public class ChatHandler {
TagResolver placeholders = TagResolver.resolver( TagResolver placeholders = TagResolver.resolver(
Placeholder.component("sender", senderName), Placeholder.component("sender", senderName),
Placeholder.component("message", parseMessageContent(player, message)), Placeholder.component("message", parseMessageContent(player, message)),
Placeholder.parsed("server", Bukkit.getServerName()), Placeholder.parsed("server", Bukkit.getServer().getName()),
Placeholder.parsed("channel", channel.getChannelName()) Placeholder.parsed("channel", channel.getChannelName())
); );
Component component = Utility.parseMiniMessage(channel.getFormat(), placeholders); Component component = Utility.parseMiniMessage(channel.getFormat(), placeholders);
@@ -238,7 +238,9 @@ public class ChatHandler {
} }
private void sendChatChannelMessage(CustomChannel chatChannel, UUID uuid, Component component) { private void sendChatChannelMessage(CustomChannel chatChannel, UUID uuid, Component component) {
if (!chatChannel.getServers().contains(Bukkit.getServerName())) return; if (!chatChannel.getServers().contains(Bukkit.getServer().getName())) {
return;
}
Player player = Bukkit.getPlayer(uuid); Player player = Bukkit.getPlayer(uuid);
if (player == null) { if (player == null) {
@@ -106,7 +106,7 @@ public class ChatListener implements Listener {
GalaxyUtility.sendBlockedNotification("Language", player, GalaxyUtility.sendBlockedNotification("Language", player,
modifiableString.component(), modifiableString.component(),
""); "");
chatLogHandler.addChatLog(uuid, player.getServer().getServerName(), PlainTextComponentSerializer.plainText().serialize(input), true); chatLogHandler.addChatLog(uuid, player.getServer().getName(), PlainTextComponentSerializer.plainText().serialize(input), true);
return; // the message was blocked return; // the message was blocked
} }
@@ -129,7 +129,7 @@ public class ChatListener implements Listener {
for (Player pingPlayer : playersToPing) { for (Player pingPlayer : playersToPing) {
pingPlayer.playSound(pingPlayer.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 1); pingPlayer.playSound(pingPlayer.getLocation(), Sound.BLOCK_NOTE_BLOCK_BASS, 1, 1);
} }
chatLogHandler.addChatLog(uuid, player.getServer().getServerName(), modifiableString.string(), false); chatLogHandler.addChatLog(uuid, player.getServer().getName(), modifiableString.string(), false);
ALogger.info(PlainTextComponentSerializer.plainText().serialize(input)); ALogger.info(PlainTextComponentSerializer.plainText().serialize(input));
} }
@@ -219,4 +219,4 @@ public class ChatListener implements Listener {
} }
} }
@@ -194,7 +194,7 @@ public class PluginMessage implements PluginMessageListener {
ALogger.warn("Received ChatChannel message for non existent channel."); ALogger.warn("Received ChatChannel message for non existent channel.");
return; return;
} }
if (!chatChannel.getServers().contains(Bukkit.getServerName())) { if (!chatChannel.getServers().contains(Bukkit.getServer().getName())) {
ALogger.warn("Received ChatChannel message for the wrong server."); ALogger.warn("Received ChatChannel message for the wrong server.");
return; return;
} }
@@ -228,4 +228,4 @@ public class PluginMessage implements PluginMessageListener {
return target.hasPermission("chat.ignorebypass"); return target.hasPermission("chat.ignorebypass");
} }
} }
@@ -149,24 +149,24 @@ public class NickUtilities
public static boolean validNick(Player sender, OfflinePlayer target, String nickName) { public static boolean validNick(Player sender, OfflinePlayer target, String nickName) {
if (!noBlockedCodes(nickName)) { if (!noBlockedCodes(nickName)) {
sender.sendMiniMessage(Config.NICK_BLOCKED_COLOR_CODES, null); sender.sendRichMessage(Config.NICK_BLOCKED_COLOR_CODES);
return false; return false;
} }
if (!Utility.checkNickBrightEnough(nickName)) { if (!Utility.checkNickBrightEnough(nickName)) {
sender.sendMiniMessage("<red>At least one color must be brighter than 30 for each color</red>", null); sender.sendRichMessage("<red>At least one color must be brighter than 30 for each color</red>");
return false; return false;
} }
String cleanNick = NickUtilities.removeAllColors(nickName); String cleanNick = NickUtilities.removeAllColors(nickName);
if (cleanNick.length() < 3 || cleanNick.length() > 16) { if (cleanNick.length() < 3 || cleanNick.length() > 16) {
sender.sendMiniMessage(Config.NICK_INVALID_LENGTH, null); sender.sendRichMessage(Config.NICK_INVALID_LENGTH);
return false; return false;
} }
if (!cleanNick.matches("[a-zA-Z0-9_]*") || nickName.length() > 192) { //192 is if someone puts {#xxxxxx<>} in front of every letter if (!cleanNick.matches("[a-zA-Z0-9_]*") || nickName.length() > 192) { //192 is if someone puts {#xxxxxx<>} in front of every letter
sender.sendMiniMessage(Config.NICK_INVALID_CHARACTERS, null); sender.sendRichMessage(Config.NICK_INVALID_CHARACTERS);
return false; return false;
} }
@@ -183,7 +183,7 @@ public class NickUtilities
if (uniqueId.equals(uuid)){ if (uniqueId.equals(uuid)){
ChatPlugin.getInstance().getLogger().info(uuid + " " + uniqueId); ChatPlugin.getInstance().getLogger().info(uuid + " " + uniqueId);
} }
sender.sendMiniMessage(Config.NICK_TAKEN, null); sender.sendRichMessage(Config.NICK_TAKEN);
return false; return false;
} }
} }
@@ -95,8 +95,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
sender.sendMessage(Utility.parseMiniMessage(Config.NICK_TRYOUT, sender.sendMessage(Utility.parseMiniMessage(Config.NICK_TRYOUT,
Placeholder.component("prefix", Utility.applyColor(api.getUserManager().getUser(player.getUniqueId()) Placeholder.component("prefix", Utility.applyColor(api.getUserManager().getUser(player.getUniqueId())
.getCachedData().getMetaData().getPrefix())), // TODO pull this from chatuser? .getCachedData().getMetaData().getPrefix())), // TODO pull this from chatuser?
Placeholder.component("nick", Utility.applyColor(args[1])), Placeholder.component("nick", Utility.applyColor(args[1]))));
Placeholder.unparsed("nickrequest", args[1])));
} }
} else { } else {
sender.sendMessage(Utility.parseMiniMessage(Config.NICK_NO_LUCKPERMS)); sender.sendMessage(Utility.parseMiniMessage(Config.NICK_NO_LUCKPERMS));
@@ -112,7 +111,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
Placeholder.component("nickname", chatUser.getDisplayName()), Placeholder.component("nickname", chatUser.getDisplayName()),
Placeholder.parsed("currentnickname", chatUser.getNickNameString()) Placeholder.parsed("currentnickname", chatUser.getNickNameString())
); );
player.sendMiniMessage(Config.NICK_CURRENT, placeholders); player.sendRichMessage(Config.NICK_CURRENT, placeholders);
} }
break; break;
case "help": case "help":
+12 -1
View File
@@ -4,11 +4,14 @@ include(":api")
include(":galaxy") include(":galaxy")
include(":velocity") include(":velocity")
val nexusUser = providers.gradleProperty("alttdSnapshotUsername").get()
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").get()
dependencyResolutionManagement { dependencyResolutionManagement {
repositories { repositories {
// mavenLocal() // mavenLocal()
mavenCentral() mavenCentral()
maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy // maven("https://repo.destro.xyz/snapshots") // Altitude - Galaxy
maven("https://oss.sonatype.org/content/groups/public/") // Adventure maven("https://oss.sonatype.org/content/groups/public/") // Adventure
maven("https://oss.sonatype.org/content/repositories/snapshots/") // Minimessage maven("https://oss.sonatype.org/content/repositories/snapshots/") // Minimessage
maven("https://nexus.velocitypowered.com/repository/") // Velocity maven("https://nexus.velocitypowered.com/repository/") // Velocity
@@ -16,6 +19,14 @@ dependencyResolutionManagement {
maven("https://repo.spongepowered.org/maven") // Configurate maven("https://repo.spongepowered.org/maven") // Configurate
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // Papi maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // Papi
maven("https://jitpack.io") maven("https://jitpack.io")
maven {
name = "nexus"
url = uri("https://repo.alttd.com/repository/alttd-snapshot/")
credentials {
username = nexusUser
password = nexusPass
}
}
} }
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
} }
+2 -2
View File
@@ -11,7 +11,7 @@ dependencies {
implementation("org.spongepowered", "configurate-yaml", "4.1.2") implementation("org.spongepowered", "configurate-yaml", "4.1.2")
compileOnly("net.kyori:adventure-text-minimessage:4.10.1") compileOnly("net.kyori:adventure-text-minimessage:4.10.1")
compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5")
compileOnly("com.alttd.proxydiscordlink:ProxyDiscordLink:1.0.0-BETA-SNAPSHOT") compileOnly("com.alttd.proxydiscordlink:ProxyDiscordLink:1.0.1-SNAPSHOT")
} }
tasks { tasks {
@@ -30,4 +30,4 @@ tasks {
dependsOn(shadowJar) dependsOn(shadowJar)
} }
} }
@@ -23,10 +23,8 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import net.kyori.adventure.title.Title;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
public class ProxyPlayerListener { public class ProxyPlayerListener {
@@ -70,17 +68,9 @@ public class ProxyPlayerListener {
List<Mail> unReadMail = chatUser.getUnReadMail(); List<Mail> unReadMail = chatUser.getUnReadMail();
if (unReadMail.isEmpty()) if (unReadMail.isEmpty())
return; return;
VelocityChat plugin = VelocityChat.getPlugin(); player.sendMessage(Utility.parseMiniMessage(Config.mailUnread,
plugin.getProxy().getScheduler().buildTask(plugin, () -> { Placeholder.unparsed("amount", String.valueOf(unReadMail.size()))
if (!player.isActive()) ));
return;
Component message = Utility.parseMiniMessage(Config.mailUnread,
Placeholder.unparsed("amount", String.valueOf(unReadMail.size())));
player.sendMessage(message);
player.showTitle(Title.title(message, Component.empty()));
}).delay(Config.mailDisplayDelay * 50L, TimeUnit.MILLISECONDS).schedule();
} }
@Subscribe @Subscribe