mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 22:38:46 +00:00
use java8...
This commit is contained in:
parent
fb898dbfa0
commit
734ba2ae46
@ -16,7 +16,7 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
69
dependency-reduced-pom.xml
Normal file
69
dependency-reduced-pom.xml
Normal 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>
|
||||||
|
|
4
pom.xml
4
pom.xml
@ -19,8 +19,8 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.8</source>
|
||||||
<target>1.7</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -37,7 +37,7 @@ public class Yum extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
config = new FileConfig(this, "config.yml");
|
config = new FileConfig(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import cn.citycraft.Yum.Yum;
|
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 {
|
public void execute(final CommandSender sender, String label, final String[] args) throws CommandException {
|
||||||
final String pluginname = args[0];
|
final String pluginname = args[0];
|
||||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
|
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
|
||||||
if (plugin == null) {
|
if (plugin == null)
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(main, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
|
||||||
@Override
|
if (args.length < 2)
|
||||||
public void run() {
|
YumManager.install(sender, pluginname);
|
||||||
|
else
|
||||||
}
|
YumManager.install(sender, pluginname, args[1]);
|
||||||
});
|
});
|
||||||
} else {
|
else
|
||||||
sender.sendMessage("§c插件已安装在服务器 需要更新请使用yum update " + pluginname + "!");
|
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
|
@Override
|
||||||
public int getMinimumArguments() {
|
public int getMinimumArguments() {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -30,19 +30,15 @@ public class CommandUpdate extends BaseCommand {
|
|||||||
final String pluginname = args[0];
|
final String pluginname = args[0];
|
||||||
final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
|
final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname);
|
||||||
sender.sendMessage("§a开始更新插件: " + pluginname);
|
sender.sendMessage("§a开始更新插件: " + pluginname);
|
||||||
if (plugin != null) {
|
if (plugin != null)
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(main, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(main, () -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (args.length < 2)
|
if (args.length < 2)
|
||||||
YumManager.update(sender, plugin);
|
YumManager.update(sender, plugin);
|
||||||
else
|
else
|
||||||
YumManager.update(sender, plugin, args[1]);
|
YumManager.update(sender, plugin, args[1]);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
else
|
||||||
sender.sendMessage("§c插件未安装或已卸载 需要安装请使用yum install " + pluginname + "!");
|
sender.sendMessage("§c插件未安装或已卸载 需要安装请使用yum install " + pluginname + "!");
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user