From bbfce5bcfdc8e55e6e76ae7a7460989dd7ce1bd4 Mon Sep 17 00:00:00 2001 From: Sabrita Date: Mon, 27 Feb 2023 18:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95=E5=BA=93?= =?UTF-8?q?=20=E5=88=A0=E9=99=A4=20wecome=20=E5=A2=9E=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settings/WelcomeMessageConfiguration.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java b/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java index 36cdff01..2eb6c0e5 100644 --- a/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java +++ b/src/main/java/fr/xephi/authme/settings/WelcomeMessageConfiguration.java @@ -21,15 +21,10 @@ import org.bukkit.entity.Player; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import static fr.xephi.authme.util.FileUtils.copyFileFromResource; import static fr.xephi.authme.util.lazytags.TagBuilder.createTag; /** @@ -83,9 +78,6 @@ public class WelcomeMessageConfiguration implements Reloadable { } List welcomeMessage = new ArrayList<>(); - for (String line : readWelcomeFile()) { - welcomeMessage.add(ChatColor.translateAlternateColorCodes('&', line)); - } messageSupplier = TagReplacer.newReplacer(availableTags, welcomeMessage); } @@ -114,25 +106,4 @@ public class WelcomeMessageConfiguration implements Reloadable { } } } - - /** - * @return the lines of the welcome message file - */ - private List readWelcomeFile() { - if (!(service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE))) { - return Collections.emptyList(); - } - - File welcomeFile = new File(pluginFolder, "welcome.txt"); - if (copyFileFromResource(welcomeFile, "welcome.txt")) { - try { - return Files.readAllLines(welcomeFile.toPath(), StandardCharsets.UTF_8); - } catch (IOException e) { - logger.logException("Failed to read welcome.txt file:", e); - } - } else { - logger.warning("Failed to copy welcome.txt from JAR"); - } - return Collections.emptyList(); - } }