This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Enhance] Simplify Currency Configurations. * [Patch] Remove deprecated methods. * [Fix] Fix for strange issue on 1.13. * [Minor] Upgrade items.yml to 1.13. Adds 8k lines. * [Release] TNE Beta 1.1.1. * [MISC] Start work on item signs. * [Feat] Add command to download modules. * [Feat] Auto download missing H2/MySQL Modules. * [Fix] Fix for ender chest balances. * [Fix] Fix module download command.
- Loading branch information
1 parent
18a3eba
commit dfd40d0
Showing
17 changed files
with
213 additions
and
36 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
75 changes: 75 additions & 0 deletions
75
TNE/src/net/tnemc/core/commands/module/ModuleDownloadCommand.java
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package net.tnemc.core.commands.module; | ||
|
||
import net.tnemc.core.TNE; | ||
import net.tnemc.core.commands.TNECommand; | ||
import net.tnemc.core.common.Message; | ||
import net.tnemc.core.common.WorldVariant; | ||
import net.tnemc.core.common.account.WorldFinder; | ||
import net.tnemc.core.common.module.ModuleLoader; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.command.CommandSender; | ||
|
||
/** | ||
* The New Economy Minecraft Server Plugin | ||
* <p> | ||
* Created by Daniel on 8/8/2018. | ||
* <p> | ||
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. | ||
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to | ||
* Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. | ||
* Created by creatorfromhell on 06/30/2017. | ||
*/ | ||
public class ModuleDownloadCommand extends TNECommand { | ||
|
||
public ModuleDownloadCommand(TNE plugin) { | ||
super(plugin); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "download"; | ||
} | ||
|
||
@Override | ||
public String[] getAliases() { | ||
return new String[] { | ||
"dl" | ||
}; | ||
} | ||
|
||
@Override | ||
public String getNode() { | ||
return "tne.module.download"; | ||
} | ||
|
||
@Override | ||
public boolean console() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String getHelp() { | ||
return "Messages.Commands.Module.Download"; | ||
} | ||
|
||
@Override | ||
public boolean execute(CommandSender sender, String command, String[] arguments) { | ||
if(arguments.length >= 1) { | ||
final String moduleName = arguments[0].toLowerCase().trim(); | ||
final String world = WorldFinder.getWorld(sender, WorldVariant.ACTUAL); | ||
if(!ModuleLoader.modulePaths.containsKey(moduleName)) { | ||
Message message = new Message("Messages.Module.Invalid"); | ||
message.addVariable("$module", moduleName); | ||
message.translate(world, sender); | ||
return false; | ||
} | ||
Bukkit.getScheduler().runTaskAsynchronously(TNE.instance(), ()->ModuleLoader.downloadModule(moduleName)); | ||
Message message = new Message("Messages.Module.Downloaded"); | ||
message.addVariable("$module", moduleName); | ||
message.translate(world, sender); | ||
return true; | ||
} | ||
help(sender); | ||
return false; | ||
} | ||
} |
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
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
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
Oops, something went wrong.