26
26
27
27
import com .comphenix .protocol .error .ErrorReporter ;
28
28
import com .comphenix .protocol .events .PacketListener ;
29
- import com .comphenix .protocol .metrics .Updater ;
30
- import com .comphenix .protocol .metrics .Updater .UpdateType ;
31
29
import com .comphenix .protocol .timing .TimedListenerManager ;
32
30
import com .comphenix .protocol .timing .TimingReportGenerator ;
33
31
@@ -43,13 +41,11 @@ class CommandProtocol extends CommandBase {
43
41
public static final String NAME = "protocol" ;
44
42
45
43
private Plugin plugin ;
46
- private Updater updater ;
47
44
private ProtocolConfig config ;
48
45
49
- public CommandProtocol (ErrorReporter reporter , Plugin plugin , Updater updater , ProtocolConfig config ) {
46
+ public CommandProtocol (ErrorReporter reporter , Plugin plugin , ProtocolConfig config ) {
50
47
super (reporter , CommandBase .PERMISSION_ADMIN , NAME , 1 );
51
48
this .plugin = plugin ;
52
- this .updater = updater ;
53
49
this .config = config ;
54
50
}
55
51
@@ -60,10 +56,6 @@ protected boolean handleCommand(CommandSender sender, String[] args) {
60
56
// Only return TRUE if we executed the correct command
61
57
if (subCommand .equalsIgnoreCase ("config" ) || subCommand .equalsIgnoreCase ("reload" ))
62
58
reloadConfiguration (sender );
63
- else if (subCommand .equalsIgnoreCase ("check" ))
64
- checkVersion (sender );
65
- // else if (subCommand.equalsIgnoreCase("update"))
66
- // updateVersion(sender);
67
59
else if (subCommand .equalsIgnoreCase ("timings" ))
68
60
toggleTimings (sender , args );
69
61
else if (subCommand .equalsIgnoreCase ("listeners" ))
@@ -73,14 +65,6 @@ else if (subCommand.equalsIgnoreCase("listeners"))
73
65
return true ;
74
66
}
75
67
76
- public void checkVersion (final CommandSender sender ) {
77
- performUpdate (sender , UpdateType .NO_DOWNLOAD );
78
- }
79
-
80
- public void updateVersion (final CommandSender sender ) {
81
- performUpdate (sender , UpdateType .DEFAULT );
82
- }
83
-
84
68
// Display every listener on the server
85
69
private void printListeners (final CommandSender sender , String [] args ) {
86
70
ProtocolManager manager = ProtocolLibrary .getProtocolManager ();
@@ -96,26 +80,6 @@ private void printListeners(final CommandSender sender, String[] args) {
96
80
}
97
81
}
98
82
99
- private void performUpdate (final CommandSender sender , UpdateType type ) {
100
- if (updater .isChecking ()) {
101
- sender .sendMessage (ChatColor .RED + "Already checking for an update." );
102
- return ;
103
- }
104
-
105
- // Perform on an async thread
106
- Runnable notify = new Runnable () {
107
- @ Override
108
- public void run () {
109
- sender .sendMessage (ChatColor .YELLOW + "[ProtocolLib] " + updater .getResult ());
110
-
111
- updater .removeListener (this );
112
- updateFinished ();
113
- }
114
- };
115
- updater .start (type );
116
- updater .addListener (notify );
117
- }
118
-
119
83
private void toggleTimings (CommandSender sender , String [] args ) {
120
84
TimedListenerManager manager = TimedListenerManager .getInstance ();
121
85
boolean state = !manager .isTiming (); // toggle
0 commit comments