add ConfigWriter for Language Files / smal changes

This commit is contained in:
2024-07-03 03:28:17 +02:00
parent e9a43889cb
commit 5a49cc625a
16 changed files with 438 additions and 59 deletions

View File

@@ -58,15 +58,30 @@ public class T2Csend {
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
}
/**
*
* Use: T2Cdebug.debug(Plugin plugin, String msg) or T2Cdebug.debug(Plugin plugin, String msg, Integer stage)
*/
@Deprecated
public static void debug(Plugin plugin, String msg) {
debug(plugin, msg, null);
}
/**
*
* Use: T2Cdebug.debug(Plugin plugin, String msg) or T2Cdebug.debug(Plugin plugin, String msg, Integer stage)
*/
@Deprecated
public static void debug(Plugin plugin, String msg, Integer stage) {
// if (!new File(Main.getPath(), "config.yml").exists()) return;
T2Cdebug.debug(plugin, msg, stage);
}
/**
*
* Use: T2Cdebug.debugmsg(plugin, msg)
*/
@Deprecated
public static void debugmsg(Plugin plugin, String msg) {
T2Cdebug.debugmsg(plugin, msg);
}

View File

@@ -2,6 +2,7 @@ package net.t2code.t2codelib.SPIGOT.api.messages;
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
import net.t2code.t2codelib.T2CconfigItem;
import net.t2code.t2codelib.T2CupdateWebData;
import net.t2code.t2codelib.Util;
import org.bukkit.command.CommandSender;
@@ -35,10 +36,9 @@ public class T2Ctemplate {
*/
T2Csend.console(prefix + " §e╔════════════════════════════════════");
onStartMsg(prefix,"");
for (String s : Util.getLoadLogo()) {
onStartMsg(prefix, s);
T2Csend.console(prefix + " §e" + s);
}
onStartMsg(prefix,"");
onStartMsg(prefix,"§2Author §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
@@ -58,8 +58,14 @@ public class T2Ctemplate {
onLoadSeparateStroke(prefix);
if (version.toLowerCase().contains("dev") || version.toLowerCase().contains("snapshot") || version.toLowerCase().contains("beta")) {
T2Csend.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all" +
" bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
T2Csend.warning(T2CodeLibMain.getPlugin(), "");
T2Csend.warning(T2CodeLibMain.getPlugin(), "");
onStartMsg(prefix, "§eYou are running §4" + version + " §eof " + prefix + "§e!");
onStartMsg(prefix, "§eSome features may not be working as expected.");
onStartMsg(prefix, "§ePlease report all bugs here: http://dc.t2code.net");
onStartMsg(prefix, "§4UpdateChecker & bStats may be disabled!");
T2Csend.warning(T2CodeLibMain.getPlugin(), "");
T2Csend.warning(T2CodeLibMain.getPlugin(), "");
onLoadSeparateStroke(prefix);
try {

View File

@@ -31,6 +31,7 @@ public class T2CmcVersion {
mc1_19 = mcVersion.contains("MC: 1.19");
mc1_20 = mcVersion.contains("MC: 1.20");
mc1_21 = mcVersion.contains("MC: 1.21");
mc1_22 = mcVersion.contains("MC: 1.22");
nms1_8_R1 = nms.contains("1_8_R1");
nms1_8_R2 = nms.contains("1_8_R2");
@@ -57,6 +58,7 @@ public class T2CmcVersion {
nms1_20_R3 = nms.contains("1_20_R3");
nms1_20_R4 = nms.contains("1_20_R4");
nms1_21_R1 = nms.contains("1_21_R1");
nms1_21_R2 = nms.contains("1_21_R2");
}
private static String mcVersion;
@@ -75,6 +77,7 @@ public class T2CmcVersion {
private static boolean mc1_19;
private static boolean mc1_20;
private static boolean mc1_21;
private static boolean mc1_22;
private static String nms;
private static boolean nms1_8_R1;
@@ -102,6 +105,7 @@ public class T2CmcVersion {
private static boolean nms1_20_R3;
private static boolean nms1_20_R4;
private static boolean nms1_21_R1;
private static boolean nms1_21_R2;
public static String getMcVersion() {
return mcVersion;
@@ -167,6 +171,10 @@ public class T2CmcVersion {
return mc1_21;
}
public static boolean isMc1_22() {
return mc1_22;
}
public static String getNms() {
return nms;
}

View File

@@ -28,4 +28,5 @@ public enum T2CnmsEnum {
v1_20_R3,
v1_20_R4,
v1_21_R1,
v1_21_R2,
}

View File

@@ -93,6 +93,7 @@ public class T2CconfigWriter {
addSection((ConfigurationSection) value, comments, builder, fullKey, indentLevel + 1);
} else {
// Add value with proper indentation
// builder.append(indent).append(key).append(": ").append(value).append("\n");
if (value instanceof List) {
builder.append(indent).append(key).append(": ").append("\n");
List<Object> zw = (List<Object>) value;