27
27
import java .util .concurrent .ExecutorService ;
28
28
import java .util .concurrent .Executors ;
29
29
import java .util .concurrent .Future ;
30
+ import java .util .concurrent .TimeUnit ;
31
+ import java .util .logging .Level ;
30
32
31
33
import net .kyori .text .serializer .ComponentSerializers ;
32
34
import net .md_5 .bungee .config .Configuration ;
33
35
import net .md_5 .bungee .config .ConfigurationProvider ;
34
36
import net .md_5 .bungee .config .YamlConfiguration ;
35
37
import ru .leymooo .simpleskins .command .SkinCommand ;
36
38
37
- @ Plugin (id = "simpleskins" , name = "SimpleSkins" , version = "1.0.0 " ,
39
+ @ Plugin (id = "simpleskins" , name = "SimpleSkins" , version = "1.0.1 " ,
38
40
description = "Simple skins restorer plugin for velocity" ,
39
41
authors = "Leymooo" )
40
42
public class SimpleSkins {
@@ -58,7 +60,7 @@ public SimpleSkins(ProxyServer server, Logger logger, @DataDirectory Path userCo
58
60
59
61
@ Subscribe
60
62
public void onProxyInitialize (ProxyInitializeEvent event ) {
61
- logger .info ("Enabling SimspleSkins version 1.0.0 " );
63
+ logger .info ("Enabling SimpleSkins " );
62
64
63
65
if (!loadConfig ()) {
64
66
server .getEventManager ().unregisterListeners (this );
@@ -69,15 +71,21 @@ public void onProxyInitialize(ProxyInitializeEvent event) {
69
71
this .dataBaseUtils = new DataBaseUtils (this );
70
72
71
73
this .server .getCommandManager ().register (new SkinCommand (this ), "skin" );
72
- //Config
73
- //Command
74
+ logger .info ("SimpleSkins enabled" );
74
75
}
75
76
76
77
@ Subscribe
77
78
public void onShutDown (ProxyShutdownEvent ev ) {
78
-
79
+ logger .info ("Disabling SimpleSkins" );
80
+ this .dataBaseUtils .closeConnection ();
81
+ this .service .shutdownNow ();
82
+ try {
83
+ this .service .awaitTermination (5000 , TimeUnit .MILLISECONDS );
84
+ } catch (InterruptedException ex ) {
85
+ }
86
+ logger .info ("SimpleSkins disabled" );
79
87
}
80
-
88
+
81
89
@ Subscribe
82
90
public void onGameProfileRequest (GameProfileRequestEvent event ) {
83
91
if (!event .isOnlineMode ()) {
0 commit comments