2021-11-28 01:13:21 +00:00
package net.t2code.lib.Spigot.system.config ;
import net.t2code.lib.Spigot.Lib.messages.send ;
2022-06-08 03:13:00 +00:00
import net.t2code.lib.Spigot.system.T2CodeMain ;
2021-11-28 01:13:21 +00:00
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config ;
import org.bukkit.configuration.file.YamlConfiguration ;
import java.io.File ;
import java.io.IOException ;
public class ConfigCreate {
public static void configCreate ( ) {
Long long_ = Long . valueOf ( System . currentTimeMillis ( ) ) ;
2022-06-08 03:13:00 +00:00
if ( new File ( T2CodeMain . getPath ( ) , " config.yml " ) . exists ( ) ) {
if ( T2CodeMain . getPlugin ( ) . getConfig ( ) . getBoolean ( " Plugin.Debug " ) ) send . console ( T2CodeMain . getPrefix ( ) + " §5DEBUG: §6 " + " §4config.yml are created / updated... " ) ;
} else send . console ( T2CodeMain . getPrefix ( ) + " §4config.yml are created... " ) ;
2021-11-28 01:13:21 +00:00
2022-06-08 03:13:00 +00:00
File config = new File ( T2CodeMain . getPath ( ) , " config.yml " ) ;
2021-11-28 01:13:21 +00:00
YamlConfiguration yamlConfiguration = YamlConfiguration . loadConfiguration ( config ) ;
2022-07-07 11:43:50 +00:00
Config . set ( " Plugin.UpdateCheck.OnJoin " , true , yamlConfiguration ) ;
Config . set ( " Plugin.UpdateCheck.TimeInterval " , 60 , yamlConfiguration ) ;
Config . set ( " Plugin.language " , " english " , yamlConfiguration ) ;
2021-11-28 01:13:21 +00:00
2022-07-07 11:43:50 +00:00
Config . set ( " BungeeCord.Enable " , false , yamlConfiguration ) ;
Config . set ( " BungeeCord.ThisServer " , " server " , yamlConfiguration ) ;
2021-12-31 00:34:41 +00:00
Config . set ( " Player.Inventories.CloseByServerStop " , true , yamlConfiguration ) ;
2021-11-28 01:13:21 +00:00
try {
yamlConfiguration . save ( config ) ;
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
2022-06-08 03:13:00 +00:00
send . console ( T2CodeMain . getPrefix ( ) + " §2config.yml were successfully created / updated. " + " §7- §e " + ( System . currentTimeMillis ( ) - long_ . longValue ( ) ) + " ms " ) ;
2021-11-28 01:13:21 +00:00
}
}