This commit is contained in:
Florian Bouillon 2017-08-01 23:26:30 +02:00
parent c466dbe388
commit 8e8e0e4cfb
22 changed files with 259 additions and 198 deletions

128
.gitignore vendored
View File

@ -1,8 +1,10 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
@ -10,24 +12,148 @@
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
src/test/
target/
target/
/.idea/dictionaries/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
# Gradle:
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Mongo Explorer plugin:
.idea/**/mongoSettings.xml
## File-based project format:
## Plugin-specific files:
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
# JIRA plugin
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
### Maven template
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar
### Linux template
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Windows template
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.google.code.gson:gson:2.2.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.2.4/gson-2.2.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.2.4/gson-2.2.4-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.google.guava:guava:17.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/17.0/guava-17.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/17.0/guava-17.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/17.0/guava-17.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: javax.persistence:persistence-api:1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/persistence/persistence-api/1.0/persistence-api-1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/persistence/persistence-api/1.0/persistence-api-1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: net.md-5:bungeecord-chat:1.10-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.10-SNAPSHOT/bungeecord-chat-1.10-20161106.005337-42.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.10-SNAPSHOT/bungeecord-chat-1.10-20161106.005337-42-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/md-5/bungeecord-chat/1.10-SNAPSHOT/bungeecord-chat-1.10-20161106.005337-42-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.avaje:ebean:2.8.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/avaje/ebean/2.8.1/ebean-2.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/avaje/ebean/2.8.1/ebean-2.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/avaje/ebean/2.8.1/ebean-2.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.11-R0.1-SNAPSHOT/spigot-api-1.11-R0.1-20161219.121403-111.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.11-R0.1-SNAPSHOT/spigot-api-1.11-R0.1-20161219.121403-111-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/spigotmc/spigot-api/1.11-R0.1-SNAPSHOT/spigot-api-1.11-R0.1-20161219.121403-111-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.yaml:snakeyaml:1.17">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/yaml/snakeyaml/1.17/snakeyaml-1.17-sources.jar!/" />
</SOURCES>
</library>
</component>

27
.idea/runConfigurations/BetterTP.xml generated Normal file
View File

@ -0,0 +1,27 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="BetterTP" type="MavenRunConfiguration" factoryName="Maven" singleton="true">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="install" />
</list>
</option>
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method />
</configuration>
</component>

View File

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Windows Server" type="JarApplication" factoryName="JAR Application" singleton="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="JAR_PATH" value="F:/testserver/spigot-1.12.jar" />
<option name="WORKING_DIRECTORY" value="F:\testserver\" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8.0_131" />
<envs />
<method />
</configuration>
</component>

View File

@ -21,16 +21,15 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.12-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:17.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.17" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.10-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.18" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.12-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.12-R0.1-SNAPSHOT" level="project" />
</component>
</module>

56
pom.xml
View File

@ -6,19 +6,23 @@
<groupId>Delta-Wings</groupId>
<artifactId>BetterTP</artifactId>
<version>1.1.0-DEV</version>
<packaging>jar</packaging>
<name>BetterTP</name>
<version>1.0.0</version>
<packaging>jar</packaging>
<description>The best teleportation plugin</description>
<url>https://delta-wings.net/</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>https://delta-wings.net</url>
<scm>
<connection>scm:svn:http://127.0.0.1/dummy</connection>
<developerConnection>scm:svn:https://127.0.0.1/dummy</developerConnection>
<tag>HEAD</tag>
<url>http://127.0.0.1/dummy</url>
</scm>
<build>
<finalName>BetterTP</finalName>
<finalName>${project.artifactId}-${project.version}</finalName>
<defaultGoal>clean package</defaultGoal>
<plugins>
<plugin>
@ -28,23 +32,31 @@
<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>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<id>buildnumber</id>
<phase>validate</phase>
<goals>
<goal>shade</goal>
<goal>create</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
<configuration>
<format>{0,number}</format>
<items>
<item>buildNumber</item>
</items>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<revisionOnScmFailure>unknownbuild</revisionOnScmFailure>
</configuration>
</plugin>
</plugins>
<resources>
@ -60,14 +72,24 @@
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.11-R0.1-SNAPSHOT</version>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
</project>

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.Location;
import org.bukkit.command.Command;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.Bukkit;
import org.bukkit.Location;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.Location;
import org.bukkit.command.Command;

View File

@ -1,6 +1,6 @@
package net.DeltaWings.Minecraft.BetterTP.Commands;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;

View File

@ -1,55 +0,0 @@
package net.DeltaWings.Minecraft.BetterTP.Custom;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
public class FileManager {
public List<String> listFiles(String path) {
String[] t = new File(path).list();
if(t == null) return null;
else return Arrays.asList(t);
}
public List<String> listFiles(File path) {
String[] t = path.list();
if(t == null) return null;
else return Arrays.asList(t);
}
public void delete(File path) {
path.delete();
}
public void delete(String path) {
File file = new File(path);
file.delete();
}
public void createFile(String path) {
try {
new File(path).createNewFile();
} catch ( IOException e ) {
e.printStackTrace();
}
}
public void createFile(File path) {
try {
path.createNewFile();
} catch ( IOException e ) {
e.printStackTrace();
}
}
public void createFolder(File path) {
path.mkdirs();
}
public void createFolder(String path) {
new File(path).mkdirs();
}
}

View File

@ -1,4 +1,4 @@
package net.DeltaWings.Minecraft.BetterTP.Custom;
package net.DeltaWings.Minecraft.BetterTP.Libs;
import net.DeltaWings.Minecraft.BetterTP.Main;

View File

@ -1,11 +1,11 @@
package net.DeltaWings.Minecraft.BetterTP;
import net.DeltaWings.Minecraft.BetterTP.Commands.*;
import net.DeltaWings.Minecraft.BetterTP.Custom.Config;
import net.DeltaWings.Minecraft.BetterTP.Libs.Config;
import net.DeltaWings.Minecraft.BetterTP.TabCompleter.*;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.IOException;
@ -13,47 +13,69 @@ import java.util.logging.Level;
public final class Main extends JavaPlugin {
public static void log(String Message) {
Bukkit.getLogger().log(Level.INFO, Message);
}
private static Main instance;
public static Main getInstance() {
return instance;
}
public static void log(String message) {
getInstance().getLogger().log(Level.INFO, message);
}
public static void debug(String message) {
if(new Config("", "config").getBoolean("debug", false)) Main.getInstance().getLogger().info("[Debug] " + message);
if(new Config("", "config").getBoolean("debug", true)) getInstance().getLogger().log(Level.INFO, "[Debug] > " + message);
}
public static void error(String message) {
getInstance().getLogger().log(Level.WARNING, message);
}
@Override
public void onEnable() {
instance = this;
getCommand("Spawn").setExecutor(new Spawn());
getCommand("Lobby").setExecutor(new Lobby());
getCommand("Home").setExecutor(new Home());
debug("Loading Variables");
PluginManager pm = getServer().getPluginManager();
PluginCommand bettertp = getCommand("Bettertp");
bettertp.setExecutor(new Bettertp());
bettertp.setTabCompleter(new BettertpTab());
getCommand("Sethome").setExecutor(new Sethome());
getCommand("Delhome").setExecutor(new Delhome());
getCommand("Homelist").setExecutor(new Homelist());
debug("Loaded variables");
new Metrics(this);
debug("Loading Configuration");
try {
config();
} catch ( IOException e ) {
e.printStackTrace();
log("Shutting Down for security...");
error("Error Config not generated");
error("Shutting Down for security...");
this.getPluginLoader().disablePlugin(this);
}
debug("Loaded Configuration !");
log("Plugin Loaded !");
debug("Loading Events");
//pm.registerEvents(new Event(), this);
debug("Loaded Events");
debug("Loading Commands");
//getCommand("Command").setExecutor(new Command());
bettertp.setExecutor(new Bettertp());
bettertp.setTabCompleter(new BettertpTab());
getCommand("Spawn").setExecutor(new Spawn());
getCommand("Lobby").setExecutor(new Lobby());
getCommand("Home").setExecutor(new Home());
getCommand("Sethome").setExecutor(new Sethome());
getCommand("Delhome").setExecutor(new Delhome());
getCommand("Homelist").setExecutor(new Homelist());
debug("Loaded Commands");
debug("Enabling Metrics");
//new Metrics(this);
log("Metrics Started : https://bstats.org/plugin/bukkit/plugin/");
log("Loaded !");
}
@Override
public void onDisable() {
log("Plugin Unloaded !");
log("Unloaded !");
}
private void config() throws IOException {