Skip to content

Commit

Permalink
Add compatability for another revision of the WaterfallConsole
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Sep 16, 2018
1 parent a2e481e commit 82849ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -99,8 +99,11 @@ public static void main(String[] args) throws Exception {

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;
Expand Down
3 changes: 3 additions & 0 deletions SubServers.Sync/src/net/ME1312/SubServers/Sync/Launch.java
Expand Up @@ -101,6 +101,9 @@ public static void main(String[] args) throws Exception {
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) {
Expand Down

0 comments on commit 82849ef

Please sign in to comment.