Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea705c879f | ||
|
|
f5c0a0676c | ||
|
|
9bd9e21321 | ||
|
|
1c570fd524 | ||
|
|
131ea6da9d | ||
|
|
3275db13d0 | ||
|
|
a908e32d0b | ||
|
|
8393d12c6d | ||
|
|
782c7df4ef | ||
|
|
a876a9f77b | ||
|
|
f3147b3256 | ||
|
|
65503a02f3 | ||
|
|
7140a0cd78 | ||
|
|
187f71d6c3 | ||
|
|
3b2aa84164 | ||
|
|
0fb497c2f1 | ||
|
|
192fca3a89 | ||
|
|
d6135f2456 | ||
|
|
c057c69653 | ||
|
|
c25767e473 | ||
|
|
37aa9fdf4c | ||
|
|
ed2ba74772 | ||
|
|
44d6e994cc |
@@ -3,10 +3,9 @@ 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
|
||||||
}
|
}
|
||||||
@@ -25,4 +24,4 @@ publishing {
|
|||||||
credentials(PasswordCredentials::class)
|
credentials(PasswordCredentials::class)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -424,6 +424,7 @@ 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);
|
||||||
@@ -432,6 +433,7 @@ 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<>();
|
||||||
@@ -503,7 +505,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>Hi, this is what my new nickname could look like!";
|
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_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.";
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ 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
|
||||||
@@ -22,4 +21,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.getServer().getName());
|
serverConfig = new ServerConfig(Bukkit.getServerName());
|
||||||
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.getServer().getName());
|
serverConfig = new ServerConfig(Bukkit.getServerName());
|
||||||
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.sendRichMessage(Config.CUSTOM_CHANNEL_TOGGLED, TagResolver.resolver(
|
player.sendMiniMessage(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.sendRichMessage(Config.PARTY_TOGGLED, Placeholder.component("status",
|
player.sendMiniMessage(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.getServer().getName())
|
Placeholder.parsed("server", Bukkit.getServerName())
|
||||||
);
|
);
|
||||||
|
|
||||||
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.getServer().getName()),
|
Placeholder.parsed("server", Bukkit.getServerName()),
|
||||||
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,9 +238,7 @@ 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.getServer().getName())) {
|
if (!chatChannel.getServers().contains(Bukkit.getServerName())) return;
|
||||||
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().getName(), PlainTextComponentSerializer.plainText().serialize(input), true);
|
chatLogHandler.addChatLog(uuid, player.getServer().getServerName(), 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().getName(), modifiableString.string(), false);
|
chatLogHandler.addChatLog(uuid, player.getServer().getServerName(), 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.getServer().getName())) {
|
if (!chatChannel.getServers().contains(Bukkit.getServerName())) {
|
||||||
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.sendRichMessage(Config.NICK_BLOCKED_COLOR_CODES);
|
sender.sendMiniMessage(Config.NICK_BLOCKED_COLOR_CODES, null);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Utility.checkNickBrightEnough(nickName)) {
|
if (!Utility.checkNickBrightEnough(nickName)) {
|
||||||
sender.sendRichMessage("<red>At least one color must be brighter than 30 for each color</red>");
|
sender.sendMiniMessage("<red>At least one color must be brighter than 30 for each color</red>", null);
|
||||||
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.sendRichMessage(Config.NICK_INVALID_LENGTH);
|
sender.sendMiniMessage(Config.NICK_INVALID_LENGTH, null);
|
||||||
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.sendRichMessage(Config.NICK_INVALID_CHARACTERS);
|
sender.sendMiniMessage(Config.NICK_INVALID_CHARACTERS, null);
|
||||||
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.sendRichMessage(Config.NICK_TAKEN);
|
sender.sendMiniMessage(Config.NICK_TAKEN, null);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ 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));
|
||||||
@@ -111,7 +112,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.sendRichMessage(Config.NICK_CURRENT, placeholders);
|
player.sendMiniMessage(Config.NICK_CURRENT, placeholders);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "help":
|
case "help":
|
||||||
|
|||||||
+1
-12
@@ -4,14 +4,11 @@ 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
|
||||||
@@ -19,14 +16,6 @@ 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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.1-SNAPSHOT")
|
compileOnly("com.alttd.proxydiscordlink:ProxyDiscordLink:1.0.0-BETA-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
@@ -30,4 +30,4 @@ tasks {
|
|||||||
dependsOn(shadowJar)
|
dependsOn(shadowJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,8 +23,10 @@ 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 {
|
||||||
|
|
||||||
@@ -68,9 +70,17 @@ public class ProxyPlayerListener {
|
|||||||
List<Mail> unReadMail = chatUser.getUnReadMail();
|
List<Mail> unReadMail = chatUser.getUnReadMail();
|
||||||
if (unReadMail.isEmpty())
|
if (unReadMail.isEmpty())
|
||||||
return;
|
return;
|
||||||
player.sendMessage(Utility.parseMiniMessage(Config.mailUnread,
|
VelocityChat plugin = VelocityChat.getPlugin();
|
||||||
Placeholder.unparsed("amount", String.valueOf(unReadMail.size()))
|
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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
Reference in New Issue
Block a user