use java8...

This commit is contained in:
502647092 2015-09-02 15:24:09 +08:00
parent fb898dbfa0
commit 734ba2ae46
6 changed files with 88 additions and 41 deletions

View File

@ -16,7 +16,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.citycraft</groupId>
<artifactId>Yum</artifactId>
<name>Yum</name>
<version>1.3.2</version>
<description>Minecraft 服务器插件管理系统</description>
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<includes>
<include>cn.citycraft:PluginUtils</include>
</includes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>citycraft-repo</id>
<url>http://ci.citycraft.cn:8800/jenkins/plugin/repository/everything/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.3-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -19,8 +19,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>

View File

@ -37,7 +37,7 @@ public class Yum extends JavaPlugin {
@Override
public void onLoad() {
config = new FileConfig(this, "config.yml");
config = new FileConfig(this);
}
}

View File

@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import cn.citycraft.Yum.Yum;
import cn.citycraft.Yum.manager.YumManager;
/**
* 插件安装命令类
@ -30,37 +31,18 @@ public class CommandInstall extends BaseCommand {
public void execute(final CommandSender sender, String label, final String[] args) throws CommandException {
final String pluginname = args[0];
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
if (plugin == null) {
Bukkit.getScheduler().runTaskAsynchronously(main, new Runnable() {
@Override
public void run() {
}
if (plugin == null)
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
if (args.length < 2)
YumManager.install(sender, pluginname);
else
YumManager.install(sender, pluginname, args[1]);
});
} else {
else
sender.sendMessage("§c插件已安装在服务器 需要更新请使用yum update " + pluginname + "!");
}
};
// public static boolean installFromYum(CommandSender sender, String
// filename) {
// if (sender == null) {
// sender = Bukkit.getConsoleSender();
// }
// File file = new File("plugins/YumCenter", filename + ".jar");
// if (!file.exists()) {
// sender.sendMessage("§4错误: §c仓库不存在 " + filename + " 插件!");
// return false;
// }
// File pluginfile = new File("plugins", filename + ".jar");
// FileUtil.copyFile(file, pluginfile);
// if (PluginsManager.load(sender, filename + ".jar")) {
// sender.sendMessage("§6安装: §a从Yum仓库安装插件 " + filename + " 成功!");
// }
// return false;
// }
@Override
public int getMinimumArguments() {
return 1;

View File

@ -30,19 +30,15 @@ public class CommandUpdate extends BaseCommand {
final String pluginname = args[0];
final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
sender.sendMessage("§a开始更新插件: " + pluginname);
if (plugin != null) {
Bukkit.getScheduler().runTaskAsynchronously(main, new Runnable() {
@Override
public void run() {
if (plugin != null)
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
if (args.length < 2)
YumManager.update(sender, plugin);
else
YumManager.update(sender, plugin, args[1]);
}
});
} else {
else
sender.sendMessage("§c插件未安装或已卸载 需要安装请使用yum install " + pluginname + "!");
}
};
@Override