mirror of
https://e.coding.net/circlecloud/BukkitInjectedTools.git
synced 2024-11-22 01:48:45 +00:00
feat: 添加文件大小处理
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
8cc2e8a0ac
commit
282727c1a1
@ -23,6 +23,7 @@ import cn.citycraft.PluginHelper.utils.IOUtil;
|
|||||||
public class BukkitInjectedTools extends JavaPlugin implements HandlerCommands {
|
public class BukkitInjectedTools extends JavaPlugin implements HandlerCommands {
|
||||||
private final String prefix = "§6[§bYum §a注入工具§6]§r ";
|
private final String prefix = "§6[§bYum §a注入工具§6]§r ";
|
||||||
private boolean downloading = false;
|
private boolean downloading = false;
|
||||||
|
private String nfn = "null";
|
||||||
|
|
||||||
@HandlerCommand(name = "inject")
|
@HandlerCommand(name = "inject")
|
||||||
public void inject(final InvokeCommandEvent e) throws IOException {
|
public void inject(final InvokeCommandEvent e) throws IOException {
|
||||||
@ -73,6 +74,7 @@ public class BukkitInjectedTools extends JavaPlugin implements HandlerCommands {
|
|||||||
e.getSender().sendMessage(prefix + "§c正在主线程下载文件,请勿重复测试...!");
|
e.getSender().sendMessage(prefix + "§c正在主线程下载文件,请勿重复测试...!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
nfn = "null" + (e.getArgs().length == 1 ? "" : "-" + e.getArgs()[0]);
|
||||||
e.getSender().sendMessage(prefix + "§c主线程中断测试!");
|
e.getSender().sendMessage(prefix + "§c主线程中断测试!");
|
||||||
PluginKit.scheduleTask(new Runnable() {
|
PluginKit.scheduleTask(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -80,7 +82,7 @@ public class BukkitInjectedTools extends JavaPlugin implements HandlerCommands {
|
|||||||
downloading = true;
|
downloading = true;
|
||||||
try {
|
try {
|
||||||
final File nFile = new File(getDataFolder(), "null");
|
final File nFile = new File(getDataFolder(), "null");
|
||||||
IOUtil.downloadFile("http://pan.yumc.pw/null", nFile);
|
IOUtil.downloadFile("http://pan.yumc.pw/" + nfn, nFile);
|
||||||
nFile.delete();
|
nFile.delete();
|
||||||
e.getSender().sendMessage(prefix + "§a主线程中断测试结束!");
|
e.getSender().sendMessage(prefix + "§a主线程中断测试结束!");
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user