commit
3d9428d399
@ -0,0 +1,36 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<classpath> |
||||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> |
||||
<attributes> |
||||
<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.8"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
||||
<attributes> |
||||
<attribute name="optional" value="true"/> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> |
||||
<attributes> |
||||
<attribute name="maven.pomderived" value="true"/> |
||||
</attributes> |
||||
</classpathentry> |
||||
<classpathentry kind="output" path="target/classes"/> |
||||
</classpath> |
@ -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 |
@ -0,0 +1,23 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<projectDescription> |
||||
<name>Manor</name> |
||||
<comment></comment> |
||||
<projects> |
||||
</projects> |
||||
<buildSpec> |
||||
<buildCommand> |
||||
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
<buildCommand> |
||||
<name>org.eclipse.m2e.core.maven2Builder</name> |
||||
<arguments> |
||||
</arguments> |
||||
</buildCommand> |
||||
</buildSpec> |
||||
<natures> |
||||
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature> |
||||
</natures> |
||||
</projectDescription> |
@ -0,0 +1,97 @@ |
||||
<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/xsd/maven-4.0.0.xsd"> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
<groupId>cn.citycraft</groupId> |
||||
<artifactId>Manor</artifactId> |
||||
<version>1.0</version> |
||||
<name>Manor</name> |
||||
<build> |
||||
<finalName>${project.name}</finalName> |
||||
<resources> |
||||
<resource> |
||||
<directory>src/main/resources</directory> |
||||
<filtering>true</filtering> |
||||
</resource> |
||||
</resources> |
||||
<plugins> |
||||
<plugin> |
||||
<artifactId>maven-compiler-plugin</artifactId> |
||||
<version>3.1</version> |
||||
<configuration> |
||||
<source>1.8</source> |
||||
<target>1.8</target> |
||||
</configuration> |
||||
</plugin> |
||||
<plugin> |
||||
<groupId>org.apache.maven.plugins</groupId> |
||||
<artifactId>maven-shade-plugin</artifactId> |
||||
<version>2.3</version> |
||||
<configuration> |
||||
<createDependencyReducedPom>false</createDependencyReducedPom> |
||||
<minimizeJar>true</minimizeJar> |
||||
<artifactSet> |
||||
<includes> |
||||
<include>cn.citycraft:PluginHelper</include> |
||||
<include>org.mcstats.*:*</include> |
||||
</includes> |
||||
</artifactSet> |
||||
<relocations> |
||||
<relocation> |
||||
<pattern>org.mcstats</pattern> |
||||
<shadedPattern>${project.groupId}.${project.artifactId}.mcstats</shadedPattern> |
||||
</relocation> |
||||
<relocation> |
||||
<pattern>cn.citycraft.PluginHelper</pattern> |
||||
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern> |
||||
</relocation> |
||||
</relocations> |
||||
</configuration> |
||||
<executions> |
||||
<execution> |
||||
<phase>package</phase> |
||||
<goals> |
||||
<goal>shade</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
</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> |
||||
<repository> |
||||
<id>Plugin Metrics</id> |
||||
<url>http://repo.mcstats.org/content/repositories/public</url> |
||||
</repository> |
||||
</repositories> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>org.spigotmc</groupId> |
||||
<artifactId>spigot-api</artifactId> |
||||
<type>jar</type> |
||||
<version>1.8.3-R0.1-SNAPSHOT</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>cn.citycraft</groupId> |
||||
<artifactId>PluginHelper</artifactId> |
||||
<type>jar</type> |
||||
<version>1.0</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.mcstats.bukkit</groupId> |
||||
<artifactId>metrics</artifactId> |
||||
<version>R8-SNAPSHOT</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
<properties> |
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
</properties> |
||||
</project> |
@ -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); |
||||
} |
||||
|
||||
} |
@ -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<String, BukkitTask> 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<String, BukkitTask>(); |
||||
} |
||||
|
||||
public static void remove(Player p) { |
||||
if (tasklist.containsKey(p.getName())) |
||||
tasklist.remove(p.getName()).cancel(); |
||||
} |
||||
|
||||
} |
@ -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 |
Loading…
Reference in new issue