From 82849ef3c799ea5c51198a6c59ce6e95706f11e1 Mon Sep 17 00:00:00 2001 From: ME1312 Date: Sun, 16 Sep 2018 15:43:27 -0400 Subject: [PATCH] Add compatability for another revision of the WaterfallConsole --- .../src/net/ME1312/SubServers/Bungee/Launch.java | 5 ++++- SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java index 59ad9ce2..46c3d091 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java @@ -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; diff --git a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java index eb724157..5b7b4fab 100644 --- a/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java +++ b/SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java @@ -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) {