mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
Whoops lol
This commit is contained in:
parent
ccf572315f
commit
922fa4a34f
@ -8,6 +8,13 @@ import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.StyleBuilderApplicable;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.SoundCategory;
|
||||
@ -150,7 +157,8 @@ public class ChatManager extends FreedomService
|
||||
Displayable display = plugin.rm.getDisplay(sender);
|
||||
FLog.info("[ADMIN] " + sender.getName() + " " + display.getTag() + ": " + message, true);
|
||||
|
||||
if (plugin.dc != null) {
|
||||
if (plugin.dc != null)
|
||||
{
|
||||
plugin.dc.messageAdminChatChannel(sender.getName() + " \u00BB " + message);
|
||||
}
|
||||
|
||||
@ -160,12 +168,16 @@ public class ChatManager extends FreedomService
|
||||
if (!Strings.isNullOrEmpty(admin.getAcFormat()))
|
||||
{
|
||||
String format = admin.getAcFormat();
|
||||
ChatColor color = getColor(display);
|
||||
String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", color.toString()).replace("%msg%", message);
|
||||
player.sendMessage(FUtil.colorize(msg));
|
||||
|
||||
player.sendMessage(FUtil.miniMessage(format,
|
||||
Placeholder.unparsed("name", sender.getName()),
|
||||
Placeholder.unparsed("rank", display.getAbbr()),
|
||||
TagResolver.resolver("rankcolor", Tag.styling(TextColor.color(getColor(display).getColor().getRGB()))),
|
||||
Placeholder.unparsed("message", message)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// OH GOD, WHY ARE WE DOING THIS
|
||||
player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + sender.getName() + ChatColor.DARK_GRAY + " [" + getColoredTag(display) + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(message));
|
||||
}
|
||||
});
|
||||
@ -173,13 +185,17 @@ public class ChatManager extends FreedomService
|
||||
|
||||
public void reportAction(Player reporter, String reportedName, String report)
|
||||
{
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
{
|
||||
playerMsg(player, ChatColor.RED + "[REPORTS] " + ChatColor.GOLD + reporter.getName() + " has reported " + reportedName + " for " + report);
|
||||
}
|
||||
}
|
||||
FLog.info("[REPORTS] " + reporter.getName() + " has reported " + reportedName + " for " + report);
|
||||
messageAllAdmins("<red>[REPORTS]</red> <gold><reporter> has reported <reported> for <reason>.",
|
||||
Placeholder.unparsed("reporter", reporter.getName()),
|
||||
Placeholder.unparsed("reported", reportedName),
|
||||
Placeholder.unparsed("reason", report));
|
||||
}
|
||||
|
||||
public void messageAllAdmins(String message, TagResolver... placeholders)
|
||||
{
|
||||
Component parsed = FUtil.MINI_MESSAGE.deserialize(message, placeholders);
|
||||
plugin.getComponentLogger().info(parsed);
|
||||
server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)).forEach(player ->
|
||||
player.sendMessage(parsed));
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -10,9 +11,11 @@ import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.util.FConverter;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -200,24 +203,21 @@ public class LoginProcess extends FreedomService
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (String line : ConfigEntry.FIRST_JOIN_INFO.getStringList())
|
||||
{
|
||||
player.sendMessage(FUtil.colorize(line));
|
||||
}
|
||||
ConfigEntry.FIRST_JOIN_INFO.getStringList().forEach(line -> FUtil.playerMsgCooler(player, line));
|
||||
}
|
||||
}.runTaskLater(plugin, 20);
|
||||
}
|
||||
|
||||
player.sendTitle(FUtil.colorize(ConfigEntry.SERVER_LOGIN_TITLE.getString()), FUtil.colorize(ConfigEntry.SERVER_LOGIN_SUBTITLE.getString()), 20, 100, 60);
|
||||
FUtil.playerTitle(player, ConfigEntry.SERVER_LOGIN_TITLE.getString(), ConfigEntry.SERVER_LOGIN_SUBTITLE.getString());
|
||||
|
||||
if (TELEPORT_ON_JOIN.contains(player.getName()) || ConfigEntry.AUTO_TP.getBoolean())
|
||||
{
|
||||
int x = FUtil.randomInteger(-10000, 10000);
|
||||
int z = FUtil.randomInteger(-10000, 10000);
|
||||
int y = player.getWorld().getHighestBlockYAt(x, z);
|
||||
int y = player.getWorld().getHighestBlockYAt(x, z) + 1;
|
||||
Location location = new Location(player.getLocation().getWorld(), x, y, z);
|
||||
PaperLib.teleportAsync(player, location);
|
||||
player.sendMessage(ChatColor.AQUA + "You have been teleported to a random location automatically.");
|
||||
FUtil.playerMsgCooler(player, "<aqua>You have been automatically teleported to a random location.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -230,18 +230,18 @@ public class LoginProcess extends FreedomService
|
||||
if (CLEAR_ON_JOIN.contains(player.getName()) || ConfigEntry.AUTO_CLEAR.getBoolean())
|
||||
{
|
||||
player.getInventory().clear();
|
||||
player.sendMessage(ChatColor.AQUA + "Your inventory has been cleared automatically.");
|
||||
FUtil.playerMsgCooler(player, "<aqua>Your inventory has been automatically cleared.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ConfigEntry.SERVER_TABLIST_HEADER.getString().isEmpty())
|
||||
{
|
||||
player.setPlayerListHeader(FUtil.colorize(ConfigEntry.SERVER_TABLIST_HEADER.getString()).replace("\\n", "\n"));
|
||||
player.sendPlayerListHeader(FUtil.miniMessage(ConfigEntry.SERVER_TABLIST_HEADER.getString()));
|
||||
}
|
||||
|
||||
if (!ConfigEntry.SERVER_TABLIST_FOOTER.getString().isEmpty())
|
||||
{
|
||||
player.setPlayerListFooter(FUtil.colorize(ConfigEntry.SERVER_TABLIST_FOOTER.getString()).replace("\\n", "\n"));
|
||||
player.sendPlayerListFooter(FUtil.miniMessage(ConfigEntry.SERVER_TABLIST_FOOTER.getString()));
|
||||
}
|
||||
|
||||
if (!plugin.al.isAdmin(player))
|
||||
@ -255,10 +255,22 @@ public class LoginProcess extends FreedomService
|
||||
int noteCount = playerData.getNotes().size();
|
||||
if (noteCount != 0)
|
||||
{
|
||||
String noteMessage = "This player has " + noteCount + " admin note" + (noteCount > 1 ? "s" : "") + ".";
|
||||
FLog.info(noteMessage);
|
||||
plugin.al.messageAllAdmins(ChatColor.GOLD + noteMessage);
|
||||
plugin.al.messageAllAdmins(ChatColor.GOLD + "Do " + ChatColor.YELLOW + "/notes " + player.getName() + " list" + ChatColor.GOLD + " to view them.");
|
||||
plugin.cm.messageAllAdmins("<gold>This player has <yellow><count> <gold>admin note<plural>.",
|
||||
Placeholder.unparsed("count", String.valueOf(noteCount)), Placeholder.unparsed("plural", noteCount > 1 ? "s" : ""));
|
||||
plugin.cm.messageAllAdmins("<gold>Do <yellow>/notes <player> list<gold> to view them.",
|
||||
Placeholder.unparsed("player", player.getName()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Admin admin = plugin.al.getAdmin(player);
|
||||
String format = admin.getAcFormat();
|
||||
|
||||
if (!Strings.isNullOrEmpty(format) && FConverter.needsConversion(admin.getAcFormat()))
|
||||
{
|
||||
player.sendMessage(FUtil.miniMessage("<green>Converting your admin chat format..."));
|
||||
admin.setAcFormat(FConverter.convertAdminChatFormat(format));
|
||||
plugin.al.save(admin);
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,12 +281,12 @@ public class LoginProcess extends FreedomService
|
||||
{
|
||||
if (ConfigEntry.ADMIN_ONLY_MODE.getBoolean())
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Server is currently closed to non-admins.");
|
||||
FUtil.playerMsgCooler(player, "<red>Server is currently closed to non-admins.");
|
||||
}
|
||||
|
||||
if (lockdownEnabled)
|
||||
{
|
||||
FUtil.playerMsg(player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
|
||||
FUtil.playerMsgCooler(player, "<red>Warning: Server is currenty in lockdown-mode, new players will not be able to join!");
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 20L);
|
||||
|
@ -3,6 +3,7 @@ package me.totalfreedom.totalfreedommod;
|
||||
import com.google.gson.Gson;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -32,52 +33,35 @@ public class ServerPing extends FreedomService
|
||||
|
||||
if (plugin.bm.isIpBanned(ip))
|
||||
{
|
||||
event.setMotd(FUtil.colorize(ConfigEntry.SERVER_BAN_MOTD.getString()));
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_BAN_MOTD.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (ConfigEntry.ADMIN_ONLY_MODE.getBoolean())
|
||||
{
|
||||
event.setMotd(FUtil.colorize(ConfigEntry.SERVER_ADMINMODE_MOTD.getString()));
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_ADMINMODE_MOTD.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (LoginProcess.isLockdownEnabled())
|
||||
{
|
||||
event.setMotd(FUtil.colorize(ConfigEntry.SERVER_LOCKDOWN_MOTD.getString()));
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_LOCKDOWN_MOTD.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Bukkit.hasWhitelist())
|
||||
{
|
||||
event.setMotd(FUtil.colorize(ConfigEntry.SERVER_WHITELIST_MOTD.getString()));
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_WHITELIST_MOTD.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Bukkit.getOnlinePlayers().size() >= Bukkit.getMaxPlayers())
|
||||
{
|
||||
event.setMotd(FUtil.colorize(ConfigEntry.SERVER_FULL_MOTD.getString()));
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_FULL_MOTD.getString()));
|
||||
return;
|
||||
}
|
||||
|
||||
String baseMotd = ConfigEntry.SERVER_MOTD.getString().replace("%mcversion%", meta.id);
|
||||
baseMotd = baseMotd.replace("\\n", "\n");
|
||||
baseMotd = FUtil.colorize(baseMotd);
|
||||
|
||||
if (!ConfigEntry.SERVER_COLORFUL_MOTD.getBoolean())
|
||||
{
|
||||
event.setMotd(baseMotd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Colorful MOTD
|
||||
final StringBuilder motd = new StringBuilder();
|
||||
for (String word : baseMotd.split(" "))
|
||||
{
|
||||
motd.append(FUtil.randomChatColor()).append(word).append(" ");
|
||||
}
|
||||
|
||||
event.setMotd(motd.toString().trim());
|
||||
event.motd(FUtil.miniMessage(ConfigEntry.SERVER_MOTD.getString(), Placeholder.unparsed("version", meta.id)));
|
||||
}
|
||||
|
||||
private static class VersionMeta
|
||||
|
@ -1,11 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.ChatColor;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -39,8 +35,7 @@ public class VanishHandler extends FreedomService
|
||||
if (plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
plugin.esb.setVanished(player.getName(), true);
|
||||
FLog.info(player.getName() + " joined while still vanished.");
|
||||
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has joined silently.");
|
||||
plugin.cm.messageAllAdmins("<yellow><player> has joined silently.", Placeholder.unparsed("player", player.getName()));
|
||||
event.joinMessage(null);
|
||||
|
||||
new BukkitRunnable()
|
||||
@ -50,7 +45,7 @@ public class VanishHandler extends FreedomService
|
||||
{
|
||||
if (plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
player.sendActionBar(Component.text("You are hidden from other players.").color(NamedTextColor.GOLD));
|
||||
player.sendActionBar(FUtil.miniMessage("<gold>You are hidden from other players."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -69,8 +64,7 @@ public class VanishHandler extends FreedomService
|
||||
if (plugin.al.isVanished(player.getUniqueId()))
|
||||
{
|
||||
event.quitMessage(null);
|
||||
FLog.info(player.getName() + " left while still vanished.");
|
||||
plugin.al.messageAllAdmins(ChatColor.YELLOW + player.getName() + " has left silently.");
|
||||
plugin.cm.messageAllAdmins("<yellow><player> has left silently.", Placeholder.unparsed("player", player.getName()));
|
||||
}
|
||||
}
|
||||
}
|
@ -4,9 +4,11 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FConverter;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -11,6 +11,7 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -67,6 +68,11 @@ public class AdminList extends FreedomService
|
||||
FLog.info("Loaded " + allAdmins.size() + " admins (" + uuidTable.size() + " active, " + ipTable.size() + " IPs)");
|
||||
}
|
||||
|
||||
public void messageAllAdmins(Component message)
|
||||
{
|
||||
server.getOnlinePlayers().stream().filter(this::isAdmin).forEach(player -> player.sendMessage(message));
|
||||
}
|
||||
|
||||
public void messageAllAdmins(String message)
|
||||
{
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
|
@ -4,8 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
/* TODO This will have to be changed from com.github.atlasmediagroup.scissors to me.totalfreedom.scissors when we migrate to 1.19 */
|
||||
import com.github.atlasmediagroup.scissors.event.block.MasterBlockFireEvent;
|
||||
import me.totalfreedom.scissors.event.block.MasterBlockFireEvent;
|
||||
import io.papermc.paper.event.player.PlayerSignCommandPreprocessEvent;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
|
@ -52,10 +52,9 @@ public enum ConfigEntry
|
||||
HTTPD_PORT(Integer.class, "httpd.port"),
|
||||
HTTPD_PUBLIC_FOLDER(String.class, "httpd.public_folder"),
|
||||
//
|
||||
SERVER_COLORFUL_MOTD(Boolean.class, "server.colorful_motd"),
|
||||
SERVER_NAME(String.class, "server.name"),
|
||||
SERVER_ADDRESS(String.class, "server.address"),
|
||||
SERVER_MOTD(String.class, "server.motd"),
|
||||
SERVER_MOTD(String.class, "server.motds.normal"),
|
||||
SERVER_LOGIN_TITLE(String.class, "server.login_title.title"),
|
||||
SERVER_LOGIN_SUBTITLE(String.class, "server.login_title.subtitle"),
|
||||
SERVER_OWNERS(List.class, "server.owners"),
|
||||
|
@ -1,2 +1,32 @@
|
||||
package me.totalfreedom.totalfreedommod.util;public class FConverter {
|
||||
package me.totalfreedom.totalfreedommod.util;
|
||||
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class FConverter
|
||||
{
|
||||
private static final Pattern godFuckingDamnit = Pattern.compile(".*(?i)(&((#[a-f0-9]{3,6})|([0-9a-fklmnopr]))|%[a-z]+%).*");
|
||||
|
||||
public static boolean needsConversion(String messageOrFormat)
|
||||
{
|
||||
return godFuckingDamnit.matcher(messageOrFormat).find();
|
||||
}
|
||||
|
||||
public static String convertAdminChatFormat(String format)
|
||||
{
|
||||
// %name%
|
||||
// %rank%
|
||||
// %rankcolor%
|
||||
// %msg%
|
||||
|
||||
return FUtil.MINI_MESSAGE.serialize(FUtil.LEGACY_AMPERSAND.deserialize(
|
||||
format.replaceAll("%name%", "<name>")
|
||||
.replaceAll("%rank%", "<rank>")
|
||||
.replaceAll("%rankcolor%", "<rankcolor>")
|
||||
.replaceAll("%msg%", "<message>")))
|
||||
.replaceAll("\\\\<", "<"); // GOD FUCKING DAMMIT
|
||||
|
||||
//zTagResolver.resolver("rankcolor", Tag.styling(lol -> lol.color()))
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,12 @@ import com.earth2me.essentials.utils.DateUtil;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.*;
|
||||
@ -14,11 +19,13 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
@ -74,6 +81,14 @@ public class FUtil
|
||||
"G6_",
|
||||
"ayunami2000");
|
||||
public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.legacyAmpersand();
|
||||
public static final MiniMessage MINI_MESSAGE = MiniMessage.builder().tags(TagResolver.resolver(
|
||||
StandardTags.color(),
|
||||
StandardTags.rainbow(),
|
||||
StandardTags.gradient(),
|
||||
StandardTags.decorations(TextDecoration.ITALIC),
|
||||
StandardTags.decorations(TextDecoration.BOLD),
|
||||
StandardTags.decorations(TextDecoration.STRIKETHROUGH),
|
||||
StandardTags.decorations(TextDecoration.UNDERLINED))).build();
|
||||
public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>();
|
||||
public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList(
|
||||
ChatColor.DARK_RED,
|
||||
@ -232,6 +247,24 @@ public class FUtil
|
||||
FUtil.bcastMsg(message, null, true);
|
||||
}
|
||||
|
||||
public static void playerTitle(CommandSender sender, String title, String subtitle, Title.Times times, TagResolver... placeholders)
|
||||
{
|
||||
Component compTitle = MINI_MESSAGE.deserialize(title, placeholders);
|
||||
Component compSubtitle = MINI_MESSAGE.deserialize(subtitle, placeholders);
|
||||
|
||||
sender.showTitle(Title.title(compTitle, compSubtitle, times));
|
||||
}
|
||||
|
||||
public static void playerTitle(CommandSender sender, String title, String subtitle, TagResolver... placeholders)
|
||||
{
|
||||
playerTitle(sender, title, subtitle, Title.Times.times(Duration.ofSeconds(1), Duration.ofSeconds(5), Duration.ofSeconds(3)), placeholders);
|
||||
}
|
||||
|
||||
public static void playerMsgCooler(CommandSender sender, String message, TagResolver... placeholders)
|
||||
{
|
||||
sender.sendMessage(MINI_MESSAGE.deserialize(message, placeholders));
|
||||
}
|
||||
|
||||
// Still in use by listeners
|
||||
public static void playerMsg(CommandSender sender, String message, ChatColor color)
|
||||
{
|
||||
@ -460,6 +493,11 @@ public class FUtil
|
||||
return LEGACY_AMPERSAND.deserialize(string);
|
||||
}
|
||||
|
||||
public static Component miniMessage(String string, TagResolver... placeholders)
|
||||
{
|
||||
return MINI_MESSAGE.deserialize(string, placeholders);
|
||||
}
|
||||
|
||||
public static String stripColors(String string)
|
||||
{
|
||||
return string.replaceAll("§", "");
|
||||
|
@ -10,24 +10,19 @@ server:
|
||||
# The address your server is located at. Please do not include the port.
|
||||
address: play.totalfreedom.me
|
||||
|
||||
# Shown at the server list - Please note that support for %mcversion% has been withdrawn
|
||||
motd: TotalFreedom &8- The Original All-Op Server!
|
||||
|
||||
# Every word in the MOTD will be a different color unless prefixed by a color code
|
||||
colorful_motd: true
|
||||
|
||||
# MOTD Modification
|
||||
motds:
|
||||
ban: '&cYou are banned.'
|
||||
adminmode: '&cServer is closed.'
|
||||
lockdown: '&cServer is in lock-down.'
|
||||
whitelist: '&cWhitelist enabled.'
|
||||
full: '&cServer is full.'
|
||||
ban: '<red>You are banned.'
|
||||
adminmode: '<red>Server is closed.'
|
||||
lockdown: '<red>Server is in lock-down.'
|
||||
whitelist: '<red>Whitelist enabled.'
|
||||
full: '<red>Server is full.'
|
||||
normal: '<gold>TotalFreedom</gold> <dark_gray>-</dark_gray> <yellow>The Original All-Op Server!'
|
||||
|
||||
# Shown on join as a title
|
||||
login_title:
|
||||
title: '&7Welcome to &6TotalFreedom&7!'
|
||||
subtitle: '&eThe Original All-Op Server!'
|
||||
title: '<gray>Welcome to <gold>TotalFreedom</gold>!'
|
||||
subtitle: '<yellow>The Original All-Op Server!'
|
||||
|
||||
# All players who show up as owner
|
||||
owners:
|
||||
@ -552,18 +547,17 @@ announcer:
|
||||
- 'Join our Discord server! https://discord.com/invite/PW4savJR9a'
|
||||
- 'Remember to save your hotbar, otherwise you may lose your items!'
|
||||
- 'Link your discord account with &6/linkdiscord for extra features!'
|
||||
# - 'Check out our reddit at &6https://www.reddit.com/r/TotalFreedom/ &byou can even link your account!'
|
||||
- 'Want to see cool builds? Check out our Master Builder World with &6/mbworld'
|
||||
- 'Be sure to follow our twitter for all the latest updates. &6https://twitter.com/totalfreedommc'
|
||||
|
||||
# What to display in the admininfo command.
|
||||
admininfo:
|
||||
- '&bHow to apply for an admin position on the TotalFreedom Server:'
|
||||
- ' &6- Do not ask for admin in game'
|
||||
- ' &2- Be helpful within the server'
|
||||
- ' &6- Report those breaking the rules'
|
||||
- ' &2- And apply on our forums at the link:'
|
||||
- '&9https://forum.totalfreedom.me/d/45-admin-application-template'
|
||||
- '<aqua>How to apply for an admin position on the TotalFreedom Server:'
|
||||
- ' <gold>- Do not ask for admin in game'
|
||||
- ' <dark_green>- Be helpful within the server'
|
||||
- ' <gold>- Report those breaking the rules'
|
||||
- ' <dark_green>- And apply on our forums at the link:'
|
||||
- '<blue>https://forum.totalfreedom.me/d/45-admin-application-template'
|
||||
|
||||
# What to display in the vote command.
|
||||
votinginfo:
|
||||
@ -579,20 +573,20 @@ votinginfo:
|
||||
|
||||
# What to display in the Master Builder info command.
|
||||
masterbuilderinfo:
|
||||
- '&bHow to apply for Master Builder on the TotalFreedom Server:'
|
||||
- ' &6- Do not ask for Master Builder in game'
|
||||
- ' &2- Screenshot some of your previous builds (be ready to prove that the builds are yours)'
|
||||
- ' &6- Copy the template and create a thread on our forums'
|
||||
- ' &2- Template:'
|
||||
- '&9https://forum.totalfreedom.me/d/336-master-builder-application-process'
|
||||
- '<aqua>How to apply for Master Builder on the TotalFreedom Server:'
|
||||
- ' <gold>- Do not ask for Master Builder in game'
|
||||
- ' <dark_green>- Screenshot some of your previous builds (be ready to prove that the builds are yours)'
|
||||
- ' <gold>- Copy the template and create a thread on our forums'
|
||||
- ' <dark_gold>- Template:'
|
||||
- '<blue>https://forum.totalfreedom.me/d/336-master-builder-application-process'
|
||||
|
||||
# What new players will see upon joining for the first time.
|
||||
first_join_info:
|
||||
enabled: true
|
||||
text:
|
||||
- "&6Welcome to TotalFreedom -- the original Free-OP server!"
|
||||
- "&eThe server's name doesn't mean we have no rules. Do &6/rules &efor a list of them."
|
||||
- "&aNeed help getting started? Do &2/help &aor a list of commands!"
|
||||
- "<gold>Welcome to TotalFreedom -- the original Free-OP server!"
|
||||
- "<yellow>The server's name doesn't mean we have no rules. Do <gold>/rules</gold> for a list of them."
|
||||
- "<green>Need help getting started? Do <dark_green>/help</dark_green> for a list of commands!"
|
||||
|
||||
# Pet Protect - Prevent tamed pets from being killed.
|
||||
petprotect:
|
||||
|
Loading…
Reference in New Issue
Block a user