Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e437079e4 |
@@ -3,9 +3,10 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") {
|
||||
// compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT") {
|
||||
// exclude("net.kyori")
|
||||
}
|
||||
// }
|
||||
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
|
||||
compileOnly("org.spongepowered:configurate-yaml:4.1.2") // Configurate
|
||||
compileOnly("net.luckperms:api:5.3") // Luckperms
|
||||
}
|
||||
|
||||
@@ -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 mailSent = "<green>Successfully send mail to <player_name></green>: <#2e8b57><message></#2e8b57>";
|
||||
public static List<String> mailCommandAlias = new ArrayList<>();
|
||||
public static int mailDisplayDelay = 5;
|
||||
private static void mailSettings() {
|
||||
mailHeader = getString("settings.mail.header", mailHeader);
|
||||
mailBody = getString("settings.mail.message", mailBody);
|
||||
@@ -433,7 +432,6 @@ public final class Config {
|
||||
mailReceived = getString("settings.mail.mail-received", mailReceived);
|
||||
mailUnread = getString("settings.mail.mail-unread", mailUnread);
|
||||
mailSent = getString("settings.mail.mail-sent", mailSent);
|
||||
mailDisplayDelay = getInt("settings.mail.delay", mailDisplayDelay);
|
||||
}
|
||||
|
||||
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_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_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_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.";
|
||||
|
||||
@@ -5,7 +5,8 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
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("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
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ChatPlugin extends JavaPlugin {
|
||||
chatAPI = new ChatImplementation();
|
||||
chatHandler = new ChatHandler();
|
||||
DatabaseConnection.initialize();
|
||||
serverConfig = new ServerConfig(Bukkit.getServerName());
|
||||
serverConfig = new ServerConfig(Bukkit.getServer().getName());
|
||||
ChatLogHandler chatLogHandler = ChatLogHandler.getInstance(true);
|
||||
registerListener(new PlayerListener(serverConfig), new ChatListener(chatLogHandler), new BookListener(), new ShutdownListener(chatLogHandler, this));
|
||||
if(serverConfig.GLOBALCHAT) {
|
||||
@@ -119,7 +119,7 @@ public class ChatPlugin extends JavaPlugin {
|
||||
public void ReloadConfig() {
|
||||
chatAPI.ReloadConfig();
|
||||
chatAPI.ReloadChatFilters();
|
||||
serverConfig = new ServerConfig(Bukkit.getServerName());
|
||||
serverConfig = new ServerConfig(Bukkit.getServer().getName());
|
||||
Bukkit.broadcast(Utility.parseMiniMessage("Reloaded ChatPlugin Config."), "command.chat.reloadchat");
|
||||
ALogger.info("Reloaded ChatPlugin config.");
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ChatChannel extends BukkitCommand {
|
||||
}
|
||||
|
||||
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.component("status", toggleableForCustomChannel.toggle(player.getUniqueId())
|
||||
? Config.TOGGLED_ON : Config.TOGGLED_OFF)));
|
||||
|
||||
@@ -27,7 +27,7 @@ public class PartyChat extends Toggleable implements CommandExecutor {
|
||||
}
|
||||
|
||||
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));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class ChatHandler {
|
||||
Placeholder.component("sender", senderName),
|
||||
Placeholder.component("prefix", prefix),
|
||||
Placeholder.component("message", parseMessageContent(player, message)),
|
||||
Placeholder.parsed("server", Bukkit.getServerName())
|
||||
Placeholder.parsed("server", Bukkit.getServer().getName())
|
||||
);
|
||||
|
||||
Component component = Utility.parseMiniMessage(Config.GCFORMAT, placeholders);
|
||||
@@ -165,7 +165,7 @@ public class ChatHandler {
|
||||
TagResolver placeholders = TagResolver.resolver(
|
||||
Placeholder.component("sender", senderName),
|
||||
Placeholder.component("message", parseMessageContent(player, message)),
|
||||
Placeholder.parsed("server", Bukkit.getServerName()),
|
||||
Placeholder.parsed("server", Bukkit.getServer().getName()),
|
||||
Placeholder.parsed("channel", channel.getChannelName())
|
||||
);
|
||||
Component component = Utility.parseMiniMessage(channel.getFormat(), placeholders);
|
||||
@@ -238,7 +238,9 @@ public class ChatHandler {
|
||||
}
|
||||
|
||||
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);
|
||||
if (player == null) {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ChatListener implements Listener {
|
||||
GalaxyUtility.sendBlockedNotification("Language", player,
|
||||
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
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ChatListener implements Listener {
|
||||
for (Player pingPlayer : playersToPing) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ public class PluginMessage implements PluginMessageListener {
|
||||
ALogger.warn("Received ChatChannel message for non existent channel.");
|
||||
return;
|
||||
}
|
||||
if (!chatChannel.getServers().contains(Bukkit.getServerName())) {
|
||||
if (!chatChannel.getServers().contains(Bukkit.getServer().getName())) {
|
||||
ALogger.warn("Received ChatChannel message for the wrong server.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,24 +149,24 @@ public class NickUtilities
|
||||
|
||||
public static boolean validNick(Player sender, OfflinePlayer target, String nickName) {
|
||||
if (!noBlockedCodes(nickName)) {
|
||||
sender.sendMiniMessage(Config.NICK_BLOCKED_COLOR_CODES, null);
|
||||
sender.sendRichMessage(Config.NICK_BLOCKED_COLOR_CODES);
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
String cleanNick = NickUtilities.removeAllColors(nickName);
|
||||
|
||||
if (cleanNick.length() < 3 || cleanNick.length() > 16) {
|
||||
sender.sendMiniMessage(Config.NICK_INVALID_LENGTH, null);
|
||||
sender.sendRichMessage(Config.NICK_INVALID_LENGTH);
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ public class NickUtilities
|
||||
if (uniqueId.equals(uuid)){
|
||||
ChatPlugin.getInstance().getLogger().info(uuid + " " + uniqueId);
|
||||
}
|
||||
sender.sendMiniMessage(Config.NICK_TAKEN, null);
|
||||
sender.sendRichMessage(Config.NICK_TAKEN);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||
sender.sendMessage(Utility.parseMiniMessage(Config.NICK_TRYOUT,
|
||||
Placeholder.component("prefix", Utility.applyColor(api.getUserManager().getUser(player.getUniqueId())
|
||||
.getCachedData().getMetaData().getPrefix())), // TODO pull this from chatuser?
|
||||
Placeholder.component("nick", Utility.applyColor(args[1])),
|
||||
Placeholder.unparsed("nickrequest", args[1])));
|
||||
Placeholder.component("nick", Utility.applyColor(args[1]))));
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(Utility.parseMiniMessage(Config.NICK_NO_LUCKPERMS));
|
||||
@@ -112,7 +111,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||
Placeholder.component("nickname", chatUser.getDisplayName()),
|
||||
Placeholder.parsed("currentnickname", chatUser.getNickNameString())
|
||||
);
|
||||
player.sendMiniMessage(Config.NICK_CURRENT, placeholders);
|
||||
player.sendRichMessage(Config.NICK_CURRENT, placeholders);
|
||||
}
|
||||
break;
|
||||
case "help":
|
||||
|
||||
+12
-1
@@ -4,11 +4,14 @@ include(":api")
|
||||
include(":galaxy")
|
||||
include(":velocity")
|
||||
|
||||
val nexusUser = providers.gradleProperty("alttdSnapshotUsername").get()
|
||||
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").get()
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
// mavenLocal()
|
||||
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/repositories/snapshots/") // Minimessage
|
||||
maven("https://nexus.velocitypowered.com/repository/") // Velocity
|
||||
@@ -16,6 +19,14 @@ dependencyResolutionManagement {
|
||||
maven("https://repo.spongepowered.org/maven") // Configurate
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // Papi
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ dependencies {
|
||||
implementation("org.spongepowered", "configurate-yaml", "4.1.2")
|
||||
compileOnly("net.kyori:adventure-text-minimessage:4.10.1")
|
||||
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 {
|
||||
|
||||
@@ -23,10 +23,8 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.title.Title;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class ProxyPlayerListener {
|
||||
|
||||
@@ -70,17 +68,9 @@ public class ProxyPlayerListener {
|
||||
List<Mail> unReadMail = chatUser.getUnReadMail();
|
||||
if (unReadMail.isEmpty())
|
||||
return;
|
||||
VelocityChat plugin = VelocityChat.getPlugin();
|
||||
plugin.getProxy().getScheduler().buildTask(plugin, () -> {
|
||||
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();
|
||||
|
||||
player.sendMessage(Utility.parseMiniMessage(Config.mailUnread,
|
||||
Placeholder.unparsed("amount", String.valueOf(unReadMail.size()))
|
||||
));
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
Reference in New Issue
Block a user