mirror of
https://github.com/ME1312/SubServers-2.git
synced 2025-02-14 18:51:41 +01:00
Add compatability for another revision of the WaterfallConsole
This commit is contained in:
parent
a2e481efe7
commit
82849ef3c7
@ -99,8 +99,11 @@ public final class Launch {
|
||||
|
||||
if (!options.has("noconsole")) {
|
||||
try {
|
||||
if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
|
||||
if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands") != null, false)) {
|
||||
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
|
||||
} else if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("start") != null, false)) {
|
||||
Class console = Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole");
|
||||
console.getMethod("start").invoke(console.getConstructor().newInstance());
|
||||
} else {
|
||||
plugin.canSudo = true;
|
||||
String line;
|
||||
|
@ -101,6 +101,9 @@ public final class Launch {
|
||||
try {
|
||||
if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole") != null, false)) {
|
||||
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
|
||||
} else if (Util.getDespiteException(() -> Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("start") != null, false)) {
|
||||
Class console = Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole");
|
||||
console.getMethod("start").invoke(console.getConstructor().newInstance());
|
||||
} else {
|
||||
String line;
|
||||
while (plugin.isRunning && (line = plugin.getConsoleReader().readLine(">")) != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user