forked from Upstream/mmocore
Moved /mmocore admin transferdata
This commit is contained in:
parent
a7e2773ff7
commit
7c79f9cee3
@ -6,7 +6,6 @@ import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.command.rpg.CoinsCommandTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.NoteCommandTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.ReloadCommandTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.TransferDataTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.admin.AdminCommandTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.booster.BoosterCommandTreeNode;
|
||||
import net.Indyuce.mmocore.command.rpg.debug.DebugCommandTreeNode;
|
||||
@ -27,7 +26,6 @@ public class MMOCoreCommandTreeRoot extends CommandTreeRoot implements CommandEx
|
||||
super("mmocore", "mmocore.admin");
|
||||
|
||||
addChild(new ReloadCommandTreeNode(this));
|
||||
addChild(new TransferDataTreeNode(this));
|
||||
addChild(new CoinsCommandTreeNode(this));
|
||||
addChild(new NoteCommandTreeNode(this));
|
||||
addChild(new AdminCommandTreeNode(this));
|
||||
|
@ -15,6 +15,7 @@ public class AdminCommandTreeNode extends CommandTreeNode {
|
||||
addChild(new InfoCommandTreeNode(this));
|
||||
addChild(new ClassCommandTreeNode(this));
|
||||
addChild(new ForceClassCommandTreeNode(this));
|
||||
addChild(new TransferDataTreeNode(this));
|
||||
|
||||
addChild(new ExperienceCommandTreeNode(this));
|
||||
addChild(new LevelCommandTreeNode(this));
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.Indyuce.mmocore.command.rpg;
|
||||
package net.Indyuce.mmocore.command.rpg.admin;
|
||||
|
||||
import io.lumine.mythic.lib.command.api.CommandTreeNode;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
@ -12,19 +12,17 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
|
||||
/**
|
||||
* This command allows to transfer data from your actual datatype (yaml or sql) to the other one to make a change
|
||||
* in the data storage type.
|
||||
* This command allows to transfer data from your actual storage type
|
||||
* to the other one which lets the user switch between storage types.
|
||||
*/
|
||||
public class TransferDataTreeNode extends CommandTreeNode {
|
||||
|
||||
|
||||
public TransferDataTreeNode(CommandTreeNode parent) {
|
||||
super(parent, "transferdata");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandSender commandSender, String[] strings) {
|
||||
DataProvider provider=null;
|
||||
DataProvider provider = null;
|
||||
|
||||
try {
|
||||
|
||||
@ -46,7 +44,7 @@ public class TransferDataTreeNode extends CommandTreeNode {
|
||||
} catch (Exception e) {
|
||||
commandSender.sendMessage("Couldn't transfer properly the data.");
|
||||
e.printStackTrace();
|
||||
if(provider!=null&&provider instanceof MySQLDataProvider) {
|
||||
if (provider != null && provider instanceof MySQLDataProvider) {
|
||||
((MySQLDataProvider) provider).close();
|
||||
}
|
||||
return CommandResult.FAILURE;
|
||||
@ -58,14 +56,12 @@ public class TransferDataTreeNode extends CommandTreeNode {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if(finalProvider !=null&& finalProvider instanceof MySQLDataProvider) {
|
||||
if (finalProvider != null && finalProvider instanceof MySQLDataProvider) {
|
||||
((MySQLDataProvider) finalProvider).close();
|
||||
}
|
||||
}
|
||||
}.runTaskLater(MMOCore.plugin,200);
|
||||
|
||||
}.runTaskLater(MMOCore.plugin, 200);
|
||||
|
||||
return CommandResult.SUCCESS;
|
||||
|
||||
}
|
||||
}
|
@ -8,7 +8,6 @@ import net.Indyuce.mmocore.manager.data.yaml.YAMLGuildDataManager;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class MySQLDataProvider extends MMODataSource implements DataProvider {
|
||||
private final MySQLPlayerDataManager playerManager = new MySQLPlayerDataManager(this);
|
||||
|
Loading…
Reference in New Issue
Block a user