mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-09-24 19:42:40 +02: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")) {
|
if (!options.has("noconsole")) {
|
||||||
try {
|
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);
|
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 {
|
} else {
|
||||||
plugin.canSudo = true;
|
plugin.canSudo = true;
|
||||||
String line;
|
String line;
|
||||||
|
@ -101,6 +101,9 @@ public final class Launch {
|
|||||||
try {
|
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") != null, false)) {
|
||||||
Class.forName("io.github.waterfallmc.waterfall.console.WaterfallConsole").getMethod("readCommands").invoke(null);
|
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 {
|
} else {
|
||||||
String line;
|
String line;
|
||||||
while (plugin.isRunning && (line = plugin.getConsoleReader().readLine(">")) != null) {
|
while (plugin.isRunning && (line = plugin.getConsoleReader().readLine(">")) != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user