Skip to content

Commit d925ba4

Browse files
committed
Removed the custom commands
1 parent 3533077 commit d925ba4

File tree

9 files changed

+5
-302
lines changed

9 files changed

+5
-302
lines changed

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/PlayerBalancer.java

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.jaimemartz.playerbalancer;
22

33
import com.google.common.reflect.TypeToken;
4-
import com.jaimemartz.playerbalancer.commands.*;
4+
import com.jaimemartz.playerbalancer.commands.FallbackCommand;
5+
import com.jaimemartz.playerbalancer.commands.MainCommand;
6+
import com.jaimemartz.playerbalancer.commands.ManageCommand;
57
import com.jaimemartz.playerbalancer.connection.ServerAssignRegistry;
68
import com.jaimemartz.playerbalancer.helper.NetworkManager;
79
import com.jaimemartz.playerbalancer.helper.PasteHelper;
@@ -24,7 +26,6 @@
2426
import java.net.URL;
2527
import java.net.URLConnection;
2628
import java.nio.file.Files;
27-
import java.util.concurrent.TimeUnit;
2829
import java.util.logging.Handler;
2930
import java.util.logging.Level;
3031
import java.util.logging.LogRecord;
@@ -179,28 +180,6 @@ private void execStart() {
179180
getProxy().getPluginManager().registerListener(this, kickListener);
180181
}
181182

182-
//After the modules have loaded (hopefully?)
183-
getProxy().getScheduler().schedule(this, () -> {
184-
if (settings.getFeaturesProps().getCustomFindCommandProps().isEnabled()) {
185-
tryUnregisterCommands("cmd_find");
186-
findCommand = new CustomFindCommand(this);
187-
getProxy().getPluginManager().registerCommand(this, findCommand);
188-
}
189-
190-
if (settings.getFeaturesProps().getCustomListCommandProps().isEnabled()) {
191-
tryUnregisterCommands("cmd_list");
192-
listCommand = new CustomListCommand(this);
193-
getProxy().getPluginManager().registerCommand(this, listCommand);
194-
}
195-
196-
if (settings.getFeaturesProps().getCustomServerCommandProps().isEnabled()) {
197-
tryUnregisterCommands("cmd_server");
198-
serverCommand = new CustomServerCommand(this);
199-
getProxy().getPluginManager().registerCommand(this, serverCommand);
200-
}
201-
202-
}, 5L, TimeUnit.SECONDS);
203-
204183
PasteHelper.reset();
205184
getLogger().info("The plugin has finished loading without any problems");
206185
} else {
@@ -281,27 +260,6 @@ private void execStop() {
281260
manageCommand = null;
282261
}
283262

284-
if (settings.getFeaturesProps().getCustomFindCommandProps().isEnabled()) {
285-
if (findCommand != null) {
286-
getProxy().getPluginManager().unregisterCommand(findCommand);
287-
findCommand = null;
288-
}
289-
}
290-
291-
if (settings.getFeaturesProps().getCustomListCommandProps().isEnabled()) {
292-
if (listCommand != null) {
293-
getProxy().getPluginManager().unregisterCommand(listCommand);
294-
listCommand = null;
295-
}
296-
}
297-
298-
if (settings.getFeaturesProps().getCustomServerCommandProps().isEnabled()) {
299-
if (serverCommand != null) {
300-
getProxy().getPluginManager().unregisterCommand(serverCommand);
301-
serverCommand = null;
302-
}
303-
}
304-
305263
if (sectionManager != null) {
306264
sectionManager.flush();
307265
}

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/commands/CustomFindCommand.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/commands/CustomListCommand.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/commands/CustomServerCommand.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/settings/props/FeaturesProps.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ public class FeaturesProps {
2323
@Setting(value = "server-refresh")
2424
private ServerRefreshProps serverRefreshProps;
2525

26-
@Setting(value = "custom-find-command")
27-
private CustomFindCommandProps customFindCommandProps;
28-
29-
@Setting(value = "custom-list-command")
30-
private CustomListCommandProps customListCommandProps;
31-
32-
@Setting(value = "custom-server-command")
33-
private CustomServerCommandProps customServerCommandProps;
34-
3526
@Setting(value = "permission-router")
3627
private PermissionRouterProps permissionRouterProps;
3728
}

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/settings/props/features/CustomFindCommandProps.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/settings/props/features/CustomListCommandProps.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

Main Plugin/src/main/java/com/jaimemartz/playerbalancer/settings/props/features/CustomServerCommandProps.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

Main Plugin/src/main/resources/default.conf

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -222,54 +222,8 @@ features {
222222
interval=5000
223223
}
224224

225-
custom-find-command {
226-
enabled=false
227-
228-
# Leave permission empty for no permission
229-
command {
230-
name=find
231-
permission=""
232-
aliases=[]
233-
}
234-
235-
formats {
236-
result="&a{name} &cis online at &a{server}"
237-
missing="&cThere is no such player named {name}"
238-
usage="&cUsage: /find <user>"
239-
}
240-
}
241-
242-
custom-list-command {
243-
enabled=false
244-
245-
# Leave permission empty for no permission
246-
command {
247-
name=glist
248-
permission=""
249-
aliases=[]
250-
}
251-
252-
formats {
253-
server = ""
254-
total = ""
255-
}
256-
}
257-
258-
custom-server-command {
259-
enabled=false
260-
261-
# Leave permission empty for no permission
262-
command {
263-
name=server
264-
permission=""
265-
aliases=[]
266-
}
267-
268-
formats {
269-
# Nothing yet
270-
}
271-
}
272-
225+
# Redirect players when connecting to a section in case they have a permission, useful for special lobbies
226+
# Players will not get redirected if they are connected to a server where they were previously redirected to
273227
permission-router {
274228
enabled=false
275229

0 commit comments

Comments
 (0)