11package io .github .chafficui .CrucialAPI ;
22
33import io .github .chafficui .CrucialAPI .Utils .Plugin ;
4+ import io .github .chafficui .CrucialAPI .Utils .Server ;
45import io .github .chafficui .CrucialAPI .exceptions .CrucialException ;
56import io .github .chafficui .CrucialAPI .Utils .Stats ;
67import org .bukkit .Bukkit ;
1314import java .net .URL ;
1415import java .nio .channels .Channels ;
1516import java .nio .channels .ReadableByteChannel ;
16- import java .util .logging .Logger ;
1717
1818public final class Main extends JavaPlugin {
1919 private final String version = getDescription ().getVersion ();
2020
2121 @ Override
2222 public void onEnable () {
2323 // Plugin startup logic
24+ if (!Server .checkCompatibility ("1.15" , "1.16" , "1.17" )) {
25+ Server .error ("Your server is not compatible with this plugin. Please update to 1.15 or 1.16 or 1.17." );
26+ }
27+
2428 new Stats (this , 9549 );
2529 try {
2630 setupConfig ();
@@ -31,30 +35,22 @@ public void onEnable() {
3135 ex .printStackTrace ();
3236 }
3337 }
34- log (ChatColor .DARK_GREEN + getDescription ().getName () + " is now enabled (Version: " + version + ") made by "
38+ Server . log (ChatColor .DARK_GREEN + getDescription ().getName () + " is now enabled (Version: " + version + ") made by "
3539 + ChatColor .AQUA + getDescription ().getAuthors () + "." );
3640 }
3741
3842 @ Override
3943 public void onDisable () {
4044 // Plugin shutdown logic
4145 Bukkit .getScheduler ().cancelTasks (this );
42- log (ChatColor .DARK_GREEN + getDescription ().getName () + " is now disabled." );
46+ Server . log (ChatColor .DARK_GREEN + getDescription ().getName () + " is now disabled." );
4347 }
4448
4549 public
4650 File getFile (){
4751 return super .getFile ();
4852 }
4953
50- public void log (String message ){
51- Logger .getLogger ("CrucialAPI" ).info (message );
52- }
53-
54- public void error (String message ){
55- Logger .getLogger ("CrucialAPI" ).severe (message );
56- }
57-
5854 public String getVersion () {
5955 return version ;
6056 }
0 commit comments