2022-10-25 13:03:07 +00:00
package net.t2code.t2codelib.SPIGOT.system.config.config ;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend ;
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig ;
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain ;
import net.t2code.t2codelib.Util ;
import org.bukkit.configuration.file.YamlConfiguration ;
import java.io.File ;
import java.io.IOException ;
public class ConfigCreate {
public static void configCreate ( ) {
long long_ = System . currentTimeMillis ( ) ;
if ( new File ( T2CodeLibMain . getPath ( ) , " config.yml " ) . exists ( ) ) {
if ( T2CodeLibMain . getPlugin ( ) . getConfig ( ) . getBoolean ( " Plugin.Debug " ) ) T2Csend . console ( Util . getPrefix ( ) + " §5DEBUG: §6 " + " §4config.yml are created / updated... " ) ;
} else T2Csend . console ( Util . getPrefix ( ) + " §4config.yml are created... " ) ;
File config = new File ( T2CodeLibMain . getPath ( ) , " config.yml " ) ;
YamlConfiguration yamlConfiguration = YamlConfiguration . loadConfiguration ( config ) ;
2023-05-10 19:07:36 +00:00
2022-10-25 13:03:07 +00:00
T2Cconfig . set ( " Plugin.UpdateCheck.OnJoin " , true , yamlConfiguration ) ;
T2Cconfig . set ( " Plugin.UpdateCheck.TimeInterval " , 60 , yamlConfiguration ) ;
2022-11-14 21:59:17 +00:00
T2Cconfig . set ( " Plugin.UpdateCheck.SeePreReleaseUpdates " , true , yamlConfiguration ) ;
2023-05-10 19:07:36 +00:00
T2Cconfig . set ( " Plugin.UpdateCheck.AllPlugins.FullDisable " , false , yamlConfiguration ) ;
2022-10-25 13:03:07 +00:00
T2Cconfig . set ( " Plugin.language " , " english " , yamlConfiguration ) ;
2023-06-30 15:57:59 +00:00
T2Cconfig . set ( " Plugin.Not recommended to disable.developerTool " , true , yamlConfiguration ) ;
2022-10-25 13:03:07 +00:00
2022-12-24 18:05:18 +00:00
T2Cconfig . set ( " BungeeCord.Enable " , T2CodeLibMain . getIsBungee ( ) , yamlConfiguration ) ;
2022-10-25 13:03:07 +00:00
T2Cconfig . set ( " Player.Inventories.CloseByServerStop " , true , yamlConfiguration ) ;
2023-07-16 06:22:30 +00:00
T2Cconfig . set ( " Command.PermToggle.PermissionSetCommand " , " lp user [player] permission set [perm] [value] " , yamlConfiguration ) ;
2022-10-25 13:03:07 +00:00
try {
yamlConfiguration . save ( config ) ;
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
T2Csend . console ( Util . getPrefix ( ) + " §2config.yml were successfully created / updated. " + " §7- §e " + ( System . currentTimeMillis ( ) - long_ ) + " ms " ) ;
}
}