/
SubAPI.java
730 lines (675 loc) · 25.5 KB
/
SubAPI.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
package net.ME1312.SubServers.Bungee;
import com.google.common.collect.Range;
import net.ME1312.SubData.Server.DataServer;
import net.ME1312.SubServers.Bungee.Event.SubAddHostEvent;
import net.ME1312.SubServers.Bungee.Event.SubAddServerEvent;
import net.ME1312.SubServers.Bungee.Event.SubRemoveHostEvent;
import net.ME1312.SubServers.Bungee.Event.SubRemoveServerEvent;
import net.ME1312.SubServers.Bungee.Host.*;
import net.ME1312.SubServers.Bungee.Library.Exception.InvalidHostException;
import net.ME1312.Galaxi.Library.NamedContainer;
import net.ME1312.Galaxi.Library.UniversalFile;
import net.ME1312.Galaxi.Library.Util;
import net.ME1312.Galaxi.Library.Version.Version;
import net.ME1312.SubData.Server.SubDataServer;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.protocol.ProtocolConstants;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.*;
/**
* SubAPI Class
*/
public final class SubAPI {
LinkedList<Runnable> enableListeners = new LinkedList<Runnable>();
LinkedList<Runnable> reloadListeners = new LinkedList<Runnable>();
LinkedList<Runnable> disableListeners = new LinkedList<Runnable>();
private static HashMap<String, Object> knownSignatures = new HashMap<String, Object>();
boolean ready = false;
private final SubPlugin plugin;
private static SubAPI api;
protected SubAPI(SubPlugin plugin) {
this.plugin = plugin;
GAME_VERSION = getGameVersion();
api = this;
}
/**
* Gets the SubAPI Methods
*
* @return SubAPI
*/
public static SubAPI getInstance() {
return api;
}
/**
* Gets the SubServers Internals
*
* @deprecated Use SubAPI Methods when available
* @return SubPlugin Internals
*/
@Deprecated
public SubPlugin getInternals() {
return plugin;
}
/**
* Adds a SubAPI Listener
*
* @param enable An Event that will be called when SubAPI is ready
* @param disable An Event that will be called before SubAPI is disabled (your plugin should reset it's values in case this is a hard-reset instead of a shutdown)
*/
public void addListener(Runnable enable, Runnable disable) {
if (enable != null) enableListeners.add(enable);
if (disable != null) disableListeners.add(disable);
}
/**
* Adds a SubAPI Listener
*
* @param enable An Event that will be called when SubAPI is ready
* @param reload An Event that will be called after SubAPI is soft-reloaded
* @param disable An Event that will be called before SubAPI is disabled (your plugin should reset it's values in case this is a hard-reset instead of a shutdown)
*/
public void addListener(Runnable enable, Runnable reload, Runnable disable) {
addListener(enable, disable);
if (reload != null) reloadListeners.add(reload);
}
/**
* Gets the SubData Network Manager
*
* @return SubData Network Manager
*/
public DataServer getSubDataNetwork() {
return plugin.subdata;
}
/**
* Adds a Driver for Hosts
*
* @param driver Driver to add
* @param handle Handle to Bind
*/
public void addHostDriver(Class<? extends Host> driver, String handle) {
if (Util.isNull(driver, handle)) throw new NullPointerException();
if (plugin.hostDrivers.keySet().contains(handle.toUpperCase().replace('-', '_').replace(' ', '_'))) throw new IllegalStateException("Driver already exists: " + handle);
plugin.hostDrivers.put(handle.toUpperCase().replace('-', '_').replace(' ', '_'), driver);
}
/**
* Get a list of all available Host Drivers
*
* @return Host Driver handle list
*/
public List<String> getHostDrivers() {
return new LinkedList<String>(plugin.hostDrivers.keySet());
}
/**
* Gets the Hosts
*
* @return Host Map
*/
public Map<String, Host> getHosts() {
return new TreeMap<>(plugin.hosts);
}
/**
* Gets a Host
*
* @param name Host name
* @return a Host
*/
public Host getHost(String name) {
if (Util.isNull(name)) throw new NullPointerException();
return getHosts().get(name.toLowerCase());
}
/**
* Add a Host to the Network
*
* @param driver Driver to initiate
* @param name The Name of your Host
* @param ports The range of ports to auto-select from
* @param log Whether apps like SubCreator should log to console (does not apply to servers)
* @param enabled If your host is Enabled
* @param address The address of your Host
* @param directory The runtime directory of your Host
* @param gitBash The Git Bash directory
* @return The Host
* @throws NoSuchMethodException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws InstantiationException
*/
public Host addHost(String driver, String name, boolean enabled, Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
return addHost(null, driver, name, enabled, ports, log, address, directory, gitBash);
}
/**
* Add a Host to the Network
*
* @param player Player who added
* @param driver Driver to initiate
* @param name The Name of your Host
* @param ports The range of ports to auto-select from
* @param log Whether apps like SubCreator should log to console (does not apply to servers)
* @param enabled If your host is Enabled
* @param address The address of your Host
* @param directory The runtime directory of your Host
* @param gitBash The Git Bash directory
* @return The Host
* @throws NoSuchMethodException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws InstantiationException
*/
public Host addHost(UUID player, String driver, String name, boolean enabled, Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
if (Util.isNull(driver, name, enabled, ports, log, address, directory, gitBash)) throw new NullPointerException();
if (!getHostDrivers().contains(driver.toUpperCase().replace('-', '_').replace(' ', '_'))) throw new InvalidHostException("Invalid Driver for host: " + name);
return addHost(player, plugin.hostDrivers.get(driver.toUpperCase().replace('-', '_').replace(' ', '_')), name, enabled, ports, log, address, directory, gitBash);
}
/**
* Add a Host with a potentially unregistered driver to the Network
*
* @param driver Driver to initiate
* @param name The Name of your Host
* @param ports The range of ports to auto-select from
* @param log Whether apps like SubCreator should log to console (does not apply to servers)
* @param enabled If your host is Enabled
* @param address The address of your Host
* @param directory The runtime directory of your Host
* @param gitBash The Git Bash directory
* @return The Host
* @throws NoSuchMethodException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws InstantiationException
*/
public Host addHost(Class<? extends Host> driver, String name, boolean enabled, Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
return addHost(null, driver, name, enabled, ports, log, address, directory, gitBash);
}
/**
* Add a Host with a potentially unregistered driver to the Network
*
* @param player Player who added
* @param driver Driver to initiate
* @param name The Name of your Host
* @param ports The range of ports to auto-select from
* @param log Whether apps like SubCreator should log to console (does not apply to servers)
* @param enabled If your host is Enabled
* @param address The address of your Host
* @param directory The runtime directory of your Host
* @param gitBash The Git Bash directory
* @return The Host
* @throws NoSuchMethodException
* @throws IllegalAccessException
* @throws InvocationTargetException
* @throws InstantiationException
*/
public Host addHost(UUID player, Class<? extends Host> driver, String name, boolean enabled, Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
if (Util.isNull(driver, name, enabled, ports, log, address, directory, gitBash)) throw new NullPointerException();
Host host = driver.getConstructor(SubPlugin.class, String.class, boolean.class, Range.class, boolean.class, InetAddress.class, String.class, String.class).newInstance(plugin, name, enabled, ports, log, address, directory, gitBash);
return addHost(player, host)?host:null;
}
/**
* Add a Host with a potentially invalid/unregistered driver to the Network
*
* @param host Host to add
* @return Success status
*/
public boolean addHost(Host host) {
return addHost(null, host);
}
/**
* Add a Host with a potentially invalid/unregistered driver to the Network
*
* @param player Player who added
* @param host Host to add
* @return Success status
*/
public boolean addHost(UUID player, Host host) {
SubAddHostEvent event = new SubAddHostEvent(player, host);
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
plugin.hosts.put(host.getName().toLowerCase(), host);
return true;
} else {
return false;
}
}
/**
* Remove a Host from the Network
*
* @param name Name of the Host
* @return Success Status
*/
public boolean removeHost(String name) {
return removeHost(null, name);
}
/**
* Remove a Host from the Network
*
* @param player Player Removing
* @param name Name of the Host
* @return Success Status
*/
public boolean removeHost(UUID player, String name) {
if (Util.isNull(name, getHost(name))) throw new NullPointerException();
SubRemoveHostEvent event = new SubRemoveHostEvent(player, getHost(name));
plugin.getPluginManager().callEvent(event);
if (event.isCancelled()) {
try {
List<String> subservers = new ArrayList<String>();
subservers.addAll(getHost(name).getSubServers().keySet());
for (String server : subservers) {
getHost(name).removeSubServer(server);
}
subservers.clear();
getHost(name).getCreator().terminate();
getHost(name).getCreator().waitFor();
plugin.hosts.remove(name.toLowerCase());
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
} else return false;
}
/**
* Force Remove a Host from the Network
*
* @param name Name of the Host
* @return Success Status
*/
public boolean forceRemoveHost(String name) {
return forceRemoveHost(null, name);
}
/**
* Force Remove a Host from the Network
*
* @param player Player Removing
* @param name Name of the Host
* @return Success Status
*/
public boolean forceRemoveHost(UUID player, String name) {
if (Util.isNull(name, getHost(name))) throw new NullPointerException();
SubRemoveHostEvent event = new SubRemoveHostEvent(player, getHost(name));
plugin.getPluginManager().callEvent(event);
try {
List<String> subservers = new ArrayList<String>();
subservers.addAll(getHost(name).getSubServers().keySet());
for (String server : subservers) {
getHost(name).removeSubServer(server);
}
subservers.clear();
getHost(name).getCreator().terminate();
getHost(name).getCreator().waitFor();
plugin.hosts.remove(name.toLowerCase());
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* Gets the Server Groups (Group names are case sensitive here)
*
* @return Group Map
*/
public Map<String, List<Server>> getGroups() {
TreeMap<String, List<Server>> groups = new TreeMap<String, List<Server>>();
HashMap<String, String> conflitresolver = new HashMap<String, String>();
for (Server server : getServers().values()) {
for (String name : server.getGroups()) {
String group = name;
if (conflitresolver.keySet().contains(name.toLowerCase())) {
group = conflitresolver.get(name.toLowerCase());
} else {
conflitresolver.put(name.toLowerCase(), name);
}
List<Server> list = (groups.keySet().contains(group))?groups.get(group):new ArrayList<Server>();
list.add(server);
groups.put(group, list);
}
}
return groups;
}
/**
* Gets the Server Groups (Group names are all lowercase here)
*
* @return Group Map
*/
public Map<String, List<Server>> getLowercaseGroups() {
Map<String, List<Server>> groups = getGroups();
TreeMap<String, List<Server>> lowercaseGroups = new TreeMap<String, List<Server>>();
for (String key : groups.keySet()) {
lowercaseGroups.put(key.toLowerCase(), groups.get(key));
}
return lowercaseGroups;
}
/**
* Gets a Server Group (Group names are case insensitive here)
*
* @param name Group name
* @return a Server Group
*/
public List<Server> getGroup(String name) {
if (Util.isNull(name)) throw new NullPointerException();
return Util.getCaseInsensitively(getGroups(), name);
}
/**
* Gets the Servers (including SubServers)
*
* @return Server Map
*/
public Map<String, Server> getServers() {
TreeMap<String, Server> servers = new TreeMap<String, Server>();
servers.putAll(plugin.exServers);
for (Host host : plugin.hosts.values()) {
servers.putAll(host.getSubServers());
}
return servers;
}
/**
* Gets a Server
*
* @param name Server name
* @return a Server
*/
public Server getServer(String name) {
if (Util.isNull(name)) throw new NullPointerException();
return getServers().get(name.toLowerCase());
}
/**
* Adds a Server to the Network
*
* @param name Name of the Server
* @param ip IP of the Server
* @param port Port of the Server
* @param motd MOTD of the Server
* @param hidden if the server should be hidden from players
* @param restricted Players will need a permission to join if true
* @return The Server
*/
public Server addServer(String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted) {
return addServer(null, name, ip, port, motd, hidden, restricted);
}
/**
* Adds a Server to the Network
*
* @param player Player who added
* @param name Name of the Server
* @param ip IP of the Server
* @param port Port of the Server
* @param motd MOTD of the Server
* @param hidden If the server should be hidden from players
* @param restricted Players will need a permission to join if true
* @return The Server
*/
public Server addServer(UUID player, String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted) {
Server server = new ServerContainer(name, new InetSocketAddress(ip, port), motd, hidden, restricted);
SubAddServerEvent event = new SubAddServerEvent(player, null, server);
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
plugin.exServers.put(name.toLowerCase(), server);
return server;
} else {
return null;
}
}
/**
* Remove a Server from the Network
*
* @param name Name of the Server
* @return Success Status
*/
public boolean removeServer(String name) {
return removeServer(null, name);
}
/**
* Remove a Server from the Network
*
* @param player Player Removing
* @param name Name of the Server
* @return Success Status
*/
public boolean removeServer(UUID player, String name) {
if (Util.isNull(name, getServer(name))) throw new NullPointerException();
SubRemoveServerEvent event = new SubRemoveServerEvent(player, null, getServer(name));
plugin.getPluginManager().callEvent(event);
if (event.isCancelled()) {
plugin.exServers.remove(name.toLowerCase());
return true;
} else return false;
}
/**
* Force Remove a Server from the Network
*
* @param name Name of the Server
* @return Success Status
*/
public boolean forceRemoveServer(String name) {
return forceRemoveServer(null, name);
}
/**
* Force Remove a Server from the Network
*
* @param player Player Removing
* @param name Name of the Server
* @return Success Status
*/
public boolean forceRemoveServer(UUID player, String name) {
if (Util.isNull(name, getServer(name))) throw new NullPointerException();
SubRemoveServerEvent event = new SubRemoveServerEvent(player, null, getServer(name));
plugin.getPluginManager().callEvent(event);
plugin.exServers.remove(name.toLowerCase());
return true;
}
/**
* Gets the SubServers
*
* @return SubServer Map
*/
public Map<String, SubServer> getSubServers() {
TreeMap<String, SubServer> servers = new TreeMap<String, SubServer>();
for (Host host : plugin.hosts.values()) {
servers.putAll(host.getSubServers());
}
return servers;
}
/**
* Gets a SubServer
*
* @param name SubServer name
* @return a SubServer
*/
public SubServer getSubServer(String name) {
if (Util.isNull(name)) throw new NullPointerException();
return getSubServers().get(name.toLowerCase());
}
/**
* Gets the known Proxies
*
* @return Proxy Map
*/
public Map<String, Proxy> getProxies() {
return new TreeMap<String, Proxy>(plugin.proxies);
}
/**
* Gets a Proxy
*
* @param name Proxy name
* @return a Proxy
*/
public Proxy getProxy(String name) {
if (Util.isNull(name)) throw new NullPointerException();
return getProxies().get(name.toLowerCase());
}
/**
* Get the Master Proxy redis container (null if unavailable)
*
* @return Master Proxy
*/
public Proxy getMasterProxy() {
return plugin.redis;
}
/**
* Get players on this network across all known proxies
*
* @return Player Collection
*/
@SuppressWarnings("unchecked")
public Collection<NamedContainer<String, UUID>> getGlobalPlayers() {
List<NamedContainer<String, UUID>> players = new ArrayList<NamedContainer<String, UUID>>();
if (plugin.redis != null) {
try {
for (UUID player : (Set<UUID>) plugin.redis("getPlayersOnline")) players.add(new NamedContainer<>((String) plugin.redis("getNameFromUuid", new NamedContainer<>(UUID.class, player)), player));
} catch (Exception e) {}
} else {
for (ProxiedPlayer player : plugin.getPlayers()) players.add(new NamedContainer<>(player.getName(), player.getUniqueId()));
}
return players;
}
/**
* Adds to the SubServers Lang
*
* @param channel Lang Channel
* @param key Key
* @param value Lang Value
*/
public void setLang(String channel, String key, String value) {
if (Util.isNull(channel, key, value)) throw new NullPointerException();
LinkedHashMap<String, String> map = (plugin.lang.keySet().contains(channel.toLowerCase()))?plugin.lang.get(channel.toLowerCase()):new LinkedHashMap<String, String>();
map.put(key, value);
plugin.lang.put(channel.toLowerCase(), map);
}
/**
* Gets the current SubServers Lang Channels
*
* @return SubServers Lang Channel list
*/
public Collection<String> getLangChannels() {
return plugin.lang.keySet();
}
/**
* Gets values from the SubServers Lang
*
* @param channel Lang Channel
* @return Lang Value
*/
public Map<String, String> getLang(String channel) {
if (Util.isNull(channel)) throw new NullPointerException();
return new LinkedHashMap<>(plugin.lang.get(channel.toLowerCase()));
}
/**
* Gets a value from the SubServers Lang
*
* @param channel Lang Channel
* @param key Key
* @return Lang Values
*/
public String getLang(String channel, String key) {
if (Util.isNull(channel, key)) throw new NullPointerException();
return getLang(channel).get(key);
}
/**
* Get an Object Signature without linking the Signature to any object
*
* @return Anonymous Object Signature
*/
public String signAnonymousObject() {
return plugin.getNewSignature();
}
/**
* Signs an Object
*
* @param object Object to Sign
* @return Object's Signature (or an empty string if the object was null)
*/
public String signObject(Object object) {
if (object == null) {
return "";
} else {
String signature = signAnonymousObject();
knownSignatures.put(signature, object);
return signature;
}
}
/**
* Get an Object by it's Signature
*
* @param signature Object's Signature
* @param <R> Expected Object Type
* @return Object that is tied to this Signature (or null if the signature is unknown)
*/
@SuppressWarnings("unchecked")
public <R> R getObjectBySignature(String signature) {
if (Util.isNull(signature)) throw new NullPointerException();
return (R) knownSignatures.get(signature);
}
/**
* Invalidate an Object Signature. This will remove the link between the Signature and the Object
*
* @param signature Object's Signature
*/
public void invalidateObjectSignature(String signature) {
knownSignatures.remove(signature);
}
/**
* Gets the Runtime Directory
*
* @return Directory
*/
public UniversalFile getRuntimeDirectory() {
return plugin.dir;
}
/**
* Gets the SubServers Version
*
* @return SubServers Version
*/
public Version getWrapperVersion() {
return plugin.version;
}
/**
* Gets the SubServers Build Signature
*
* @return SubServers Build Signature (or null if unsigned)
*/
public Version getWrapperBuild() {
return (SubPlugin.class.getPackage().getSpecificationTitle() != null)?new Version(SubPlugin.class.getPackage().getSpecificationTitle()):null;
}
/**
* Gets the BungeeCord Version
*
* @return BungeeCord Version
*/
public Version getProxyVersion() {
return new Version(plugin.getVersion());
}
/**
* Get an array of compatible Minecraft Versions
*
* @return Minecraft Versions
*/
public Version[] getGameVersion() {
if (GAME_VERSION == null) {
if (System.getProperty("subservers.minecraft.version", "").length() > 0) {
return new Version[]{new Version(System.getProperty("subservers.minecraft.version"))};
} else if (Util.getDespiteException(() -> ProtocolConstants.SUPPORTED_VERSIONS != null, false)) {
List<Version> versions = new LinkedList<Version>();
for (String version : ProtocolConstants.SUPPORTED_VERSIONS) versions.add(new Version(version));
Collections.sort(versions);
return versions.toArray(new Version[versions.size()]);
} else if (Util.getDespiteException(() -> plugin.getGameVersion() != null, false)) {
String raw = plugin.getGameVersion();
if (raw.contains("-") || raw.contains(",")) {
List<Version> versions = new LinkedList<Version>();
for (String version : raw.split("(?:\\s*-|,)\\s*")) versions.add(new Version(version));
Collections.sort(versions);
return versions.toArray(new Version[versions.size()]);
} else {
return new Version[]{new Version(plugin.getGameVersion())};
}
} else {
plugin.getLogger().warning("Could not determine compatible Minecraft version(s); Now using 1.x.x as a placeholder.");
plugin.getLogger().warning("Use this launch argument to specify a compatible Minecraft version: -Dsubservers.minecraft.version=1.x.x");
return new Version[]{new Version("1.x.x")};
}
} else return GAME_VERSION;
}
private final Version[] GAME_VERSION;
}