-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
package net.coreprotect.extensions; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import org.bukkit.command.CommandSender; | ||
|
||
import net.coreprotect.language.Phrase; | ||
import net.coreprotect.utility.Chat; | ||
import net.coreprotect.utility.Color; | ||
|
||
public class Extensions { | ||
|
||
public static void runDatabaseMigration(CommandSender user, String[] argumentArray) { | ||
DatabaseMigration.runCommand(user, argumentArray); | ||
public static void runDatabaseMigration(String command, CommandSender user, String[] argumentArray) { | ||
try { | ||
Class<?> patchClass = Class.forName("net.coreprotect.extensions.DatabaseMigration"); | ||
Method patchMethod = patchClass.getDeclaredMethod("runCommand", CommandSender.class, String[].class); | ||
patchMethod.invoke(null, user, argumentArray); | ||
} | ||
catch (Exception e) { | ||
// plugin not compiled with extension | ||
Chat.sendMessage(user, Color.DARK_AQUA + "CoreProtect " + Color.WHITE + "- " + Phrase.build(Phrase.COMMAND_NOT_FOUND, Color.WHITE, "/co " + command)); | ||
} | ||
} | ||
|
||
} |