commit 3d9428d399e58c2b02046ad7fb7a12eacc735b36 Author: 502647092 Date: Tue Sep 22 20:42:30 2015 +0800 init project... Signed-off-by: 502647092 diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..c2dd523 --- /dev/null +++ b/.classpath @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7876f5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# Eclipse stuff +/.settings + +# netbeans +/nbproject + +# we use maven! +/build.xml + +# maven +/target +/repo + +# vim +.*.sw[a-p] + +# various other potential build files +/build +/bin +/dist +/manifest.mf + +/world + +# Mac filesystem dust +*.DS_Store + +# intellij +*.iml +*.ipr +*.iws +.idea/ + +# Project Stuff +/src/main/resources/Soulbound + +# Atlassian Stuff +/atlassian-ide-plugin.xml \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000..f200e60 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + Manor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..347f893 --- /dev/null +++ b/pom.xml @@ -0,0 +1,97 @@ + + 4.0.0 + cn.citycraft + Manor + 1.0 + Manor + + ${project.name} + + + src/main/resources + true + + + + + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-shade-plugin + 2.3 + + false + true + + + cn.citycraft:PluginHelper + org.mcstats.*:* + + + + + org.mcstats + ${project.groupId}.${project.artifactId}.mcstats + + + cn.citycraft.PluginHelper + ${project.groupId}.${project.artifactId} + + + + + + package + + shade + + + + + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + citycraft-repo + http://ci.citycraft.cn:8800/jenkins/plugin/repository/everything/ + + + Plugin Metrics + http://repo.mcstats.org/content/repositories/public + + + + + org.spigotmc + spigot-api + jar + 1.8.3-R0.1-SNAPSHOT + + + cn.citycraft + PluginHelper + jar + 1.0 + + + org.mcstats.bukkit + metrics + R8-SNAPSHOT + compile + + + + UTF-8 + + \ No newline at end of file diff --git a/src/main/java/cn/citycraft/Manor/Manor.java b/src/main/java/cn/citycraft/Manor/Manor.java new file mode 100644 index 0000000..bdefb3f --- /dev/null +++ b/src/main/java/cn/citycraft/Manor/Manor.java @@ -0,0 +1,36 @@ +package cn.citycraft.Manor; + +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.plugin.java.JavaPlugin; + +import cn.citycraft.PluginHelper.config.FileConfig; + +public class Manor extends JavaPlugin { + public FileConfig config; + + @Override + public FileConfiguration getConfig() { + return config; + } + + @Override + public void onEnable() { + + } + + @Override + public void onLoad() { + config = new FileConfig(this); + } + + @Override + public void saveConfig() { + config.save(); + } + + @Override + public void saveDefaultConfig() { + config = new FileConfig(this); + } + +} diff --git a/src/main/java/cn/citycraft/Manor/runnable/TaskManager.java b/src/main/java/cn/citycraft/Manor/runnable/TaskManager.java new file mode 100644 index 0000000..98737ba --- /dev/null +++ b/src/main/java/cn/citycraft/Manor/runnable/TaskManager.java @@ -0,0 +1,30 @@ +package cn.citycraft.Manor.runnable; + +import java.util.HashMap; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitTask; + +public class TaskManager { + static HashMap tasklist; + static Plugin plugin; + static int tasktime; + + public static void add(Player p, Runnable run) { + tasklist.put(p.getName(), Bukkit.getScheduler().runTaskTimer(plugin, run, tasktime, tasktime)); + } + + public static void init(Plugin plugin) { + TaskManager.plugin = plugin; + tasktime = plugin.getConfig().getInt("CheckTime") * 20; + tasklist = new HashMap(); + } + + public static void remove(Player p) { + if (tasklist.containsKey(p.getName())) + tasklist.remove(p.getName()).cancel(); + } + +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..7d77f30 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,18 @@ +name: ${project.artifactId} +description: ${project.description} +main: ${project.groupId}.${project.artifactId}.${project.artifactId} +version: ${project.version} +auther: 喵♂呜 +website: http://ci.citycraft.cn:8800/jenkins/job/${project.artifactId}/ +commands: + manor: + description: XXXXX + aliases: [mn,res] + usage: §b使用/XX help 查看帮助! +permissions: + manor.use: + description: XXX使用! + default: true + manor.reload: + description: 重新载入插件! + default: op \ No newline at end of file