Compare commits
7 Commits
90df1fa5fb
...
16.8
Author | SHA1 | Date | |
---|---|---|---|
5f2c2cacbe | |||
6ea2335bc2 | |||
7b574ffa02 | |||
2f7f8e3bee | |||
987af06fb4 | |||
311ae66d18 | |||
8ae50fcbbf |
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>16.7_dev-24</version>
|
||||
<version>16.7_beta-1</version>
|
||||
<!--version>VERSION_snapshot-0</version-->
|
||||
<!--version>VERSION_beta-0</version-->
|
||||
<!--version>VERSION_dev-0</version-->
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package net.t2code.t2codelib.SPIGOT.api.commands;
|
||||
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2C_ProxyCommandSenderReceiver;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2C_Main;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -24,7 +25,7 @@ public class T2C_Cmd {
|
||||
}
|
||||
|
||||
public static void player(Player player, String cmdInput) {
|
||||
Map.Entry<String,Integer> map = delay(cmdInput);
|
||||
Map.Entry<String,Integer> map = delay(PlaceholderAPI.setPlaceholders(player, cmdInput));
|
||||
int delay = map.getValue();
|
||||
String cmd = map.getKey();
|
||||
Bukkit.getScheduler().runTaskLater(T2C_Main.getPlugin(), new Runnable() {
|
||||
|
@@ -7,7 +7,6 @@ import org.bukkit.entity.Player;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class T2C_Replace {
|
||||
|
||||
|
@@ -330,4 +330,8 @@ public class T2C_McVersion {
|
||||
return !isMc1_8() && !isMc1_9() && !isMc1_10() && !isMc1_11() && !isMc1_12() && !isMc1_13() && !isMc1_14() && !isMc1_15() && !isMc1_16() && !isMc1_17()
|
||||
&& !isMc1_18() && !isMc1_19();
|
||||
}
|
||||
public static boolean minMc1_21() {
|
||||
return !isMc1_8() && !isMc1_9() && !isMc1_10() && !isMc1_11() && !isMc1_12() && !isMc1_13() && !isMc1_14() && !isMc1_15() && !isMc1_16() && !isMc1_17()
|
||||
&& !isMc1_18() && !isMc1_19() && !isMc1_20();
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ public class T2C_ConfigWriter {
|
||||
private static FileConfiguration config;
|
||||
|
||||
public static void createConfig(String prefix, File configFile, T2C_ConfigItem[] values, boolean isReload, String... header) {
|
||||
long long_ = System.currentTimeMillis();
|
||||
boolean exist = configFile.exists();
|
||||
if (!exist) {
|
||||
configFile.getParentFile().mkdir();
|
||||
@@ -61,20 +62,21 @@ public class T2C_ConfigWriter {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copy default values if they are missing
|
||||
config.options().copyDefaults(true);
|
||||
|
||||
T2C_YmlWriter.saveConfigWithComments(configFile, config, comments, false, header);
|
||||
readConfig(prefix, configFile, config, values, isReload);
|
||||
readConfig(prefix, configFile, config, values, isReload, long_);
|
||||
}
|
||||
|
||||
private static void readConfig(String prefix, File configFile, FileConfiguration config, T2C_ConfigItem[] values, boolean isReload) {
|
||||
private static void readConfig(String prefix, File configFile, FileConfiguration config, T2C_ConfigItem[] values, boolean isReload, long long_) {
|
||||
for (T2C_ConfigItem value : values) {
|
||||
value.setValue(config.get(value.getPath()));
|
||||
}
|
||||
T2C_Send.sendStartTextCenter(prefix, "§2" + configFile.getName() + " were successfully created / updated.", isReload);
|
||||
T2C_Send.sendStartTextCenter(prefix, "§2Load successfully: §7" + configFile.getPath() + "/" + config.getName().replace("/","")+" §7- §e"+ (System.currentTimeMillis() - long_) + "ms", isReload);
|
||||
// T2C_Send.sendStartTextCenter(prefix, "§2Has been successfully created / updated §7- §e" + (System.currentTimeMillis() - long_) + "ms", isReload);
|
||||
//T2C_Send.sendStartTextCenter(prefix, "", isReload);
|
||||
//T2C_Send.sendStartTextCenter(Util.getPrefix(), "§2opWhitelist.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms",isReload);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class T2C_YmlWriter {
|
||||
protected static void saveConfigWithComments(File file, FileConfiguration config, Map<String, List<String>> comments, boolean oneListToString,String... headers) {
|
||||
public static void saveConfigWithComments(File file, FileConfiguration config, Map<String, List<String>> comments, boolean oneListToString,String... headers) {
|
||||
try {
|
||||
StringBuilder configContent = new StringBuilder();
|
||||
for (String h : headers) {
|
||||
|
@@ -18,7 +18,7 @@ public class ConvertT2ClibConfig {
|
||||
yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
|
||||
if (yamlConfiguration.contains("plugin.updateCheck.onJoin")) return;
|
||||
if (yamlConfiguration.contains("proxy.serverUUID")) return;
|
||||
|
||||
set("Plugin.UpdateCheck.OnJoin", T2C_LibConfig.VALUES.updateCheckOnJoin);
|
||||
set("Plugin.UpdateCheck.TimeInterval", T2C_LibConfig.VALUES.updateCheckTimeInterval);
|
||||
@@ -29,8 +29,8 @@ public class ConvertT2ClibConfig {
|
||||
set("Plugin.Not recommended to disable.developerTool", T2C_LibConfig.VALUES.developerTool);
|
||||
set("BungeeCord.Enable", T2C_LibConfig.VALUES.proxy);
|
||||
set("Player.Inventories.CloseByServerStop", T2C_LibConfig.VALUES.inventoriesCloseByServerStop);
|
||||
set("Command.PermToggle.PermissionSetCommand", T2C_LibConfig.VALUES.updateCheckOnJoin);
|
||||
|
||||
set("Command.PermToggle.PermissionSetCommand", T2C_LibConfig.VALUES.commandPermToggleCommand);
|
||||
config.delete();
|
||||
}
|
||||
|
||||
private static void set(String path, T2C_ConfigItem item) {
|
||||
|
@@ -133,6 +133,7 @@ public class T2C_LibConfig {
|
||||
|
||||
public static void set(boolean isReload) {
|
||||
long long_ = System.currentTimeMillis();
|
||||
ConvertT2ClibConfig.convert();
|
||||
T2C_ConfigWriter.createConfig(T2C_Util.getPrefix(), new File(T2C_Main.getPath(), "config.yml"), VALUES.values(), isReload, T2C_Util.getConfigLogo());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user