Spaces in pom + optimizations

This commit is contained in:
Gabriele C 2015-08-02 14:22:34 +02:00
parent 5ac5bfc9a4
commit acbae36ddf
4 changed files with 542 additions and 582 deletions

82
pom.xml
View File

@ -7,8 +7,6 @@
<artifactId>authme</artifactId> <artifactId>authme</artifactId>
<version>5.0-SNAPSHOT</version> <version>5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>AuthMeReloaded</name> <name>AuthMeReloaded</name>
<description>Authentication plugin for CraftBukkit/Spigot!</description> <description>Authentication plugin for CraftBukkit/Spigot!</description>
<inceptionYear>2013</inceptionYear> <inceptionYear>2013</inceptionYear>
@ -19,7 +17,6 @@
<connection>scm:git:https://github.com/Xephi/AuthMeReloaded.git</connection> <connection>scm:git:https://github.com/Xephi/AuthMeReloaded.git</connection>
<developerConnection>scm:git:git@github.com:Xephi/AuthMeReloaded.git</developerConnection> <developerConnection>scm:git:git@github.com:Xephi/AuthMeReloaded.git</developerConnection>
<url>http://github.com/Xephi/AuthMeReloaded</url> <url>http://github.com/Xephi/AuthMeReloaded</url>
<tag>HEAD</tag>
</scm> </scm>
<!-- Official Build Server --> <!-- Official Build Server -->
@ -42,58 +39,32 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Change Compiler Version (JDK) HERE! --> <!-- Change Compiler Version (JDK) HERE! -->
<maven.compiler.source>1.7</maven.compiler.source> <javaVersion>1.7</javaVersion>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- Change MC Version HERE! --> <!-- Change MC Version HERE! -->
<bukkitVersion>1.8.8-R0.1-SNAPSHOT</bukkitVersion> <bukkitVersion>1.8.8-R0.1-SNAPSHOT</bukkitVersion>
<jarPluginName>AuthMe</jarPluginName>
</properties> </properties>
<build> <build>
<finalName>${project.name}-${project.version}</finalName>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>*.yml</include>
</includes>
</resource>
</resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version> <version>3.3</version>
<configuration> <configuration>
<source>${maven.compiler.source}</source> <source>1.7</source>
<target>${maven.compiler.target}</target> <target>${javaVersion}</target>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>target/classes/plugin.yml</file>
<replacements>
<replacement>
<token>maven-version</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifestFile>${manifest.file}</manifestFile>
</archive>
<finalName>${jarPluginName}-${project.version}</finalName>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -128,15 +99,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<projectId>55bab9e8653762002000190a</projectId>
<!--<apiKey>my_secret_api_key</apiKey> -->
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
@ -208,7 +170,7 @@
<!-- Maven Dependencies --> <!-- Maven Dependencies -->
<!-- MySql Library --> <!-- MySql Connection Pool -->
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId> <artifactId>slf4j-simple</artifactId>
@ -268,26 +230,16 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId> <artifactId>bukkit</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project, <!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
http://bukkit.org/ --> http://bukkit.org/ -->
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.bukkit</groupId>
<artifactId>spigot-api</artifactId> <artifactId>bukkit</artifactId>
<version>${bukkitVersion}</version> <version>${bukkitVersion}</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- Attribute --> <!-- Attribute -->

View File

@ -120,6 +120,7 @@ public class AuthMe extends JavaPlugin {
this.database = database; this.database = database;
} }
@SuppressWarnings("deprecation")
@Override @Override
public void onEnable() { public void onEnable() {
authme = this; authme = this;

View File

@ -504,7 +504,8 @@ public class FileCache {
armours[i] = attributes.getStack(); armours[i] = attributes.getStack();
else armours[i] = item; else armours[i] = item;
} }
} catch (final RuntimeException e) {
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
} catch (final Exception e) { } catch (final Exception e) {
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming..."); ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
} finally { } finally {
@ -513,6 +514,9 @@ public class FileCache {
} }
return new DataFileCache(inv, armours, group, op, flying); return new DataFileCache(inv, armours, group, op, flying);
} }
} catch (RuntimeException e) {
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
return null;
} catch (Exception e) { } catch (Exception e) {
ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming..."); ConsoleLogger.showError("Error while reading file for " + player.getName() + ", some wipe inventory incoming...");
return null; return null;

View File

@ -477,6 +477,7 @@ public class AdminCommand implements CommandExecutor {
m.send(sender, "error"); m.send(sender, "error");
return true; return true;
} }
@SuppressWarnings("deprecation")
Player target = Bukkit.getPlayer(name); Player target = Bukkit.getPlayer(name);
PlayerCache.getInstance().removePlayer(name); PlayerCache.getInstance().removePlayer(name);
Utils.getInstance().setGroup(name, groupType.UNREGISTERED); Utils.getInstance().setGroup(name, groupType.UNREGISTERED);
@ -559,6 +560,7 @@ public class AdminCommand implements CommandExecutor {
sender.sendMessage("Usage: /authme getip <onlineplayername>"); sender.sendMessage("Usage: /authme getip <onlineplayername>");
return true; return true;
} }
@SuppressWarnings("deprecation")
Player player = Bukkit.getPlayer(args[1]); Player player = Bukkit.getPlayer(args[1]);
if (player == null) { if (player == null) {
sender.sendMessage("This player is not actually online"); sender.sendMessage("This player is not actually online");
@ -574,6 +576,7 @@ public class AdminCommand implements CommandExecutor {
return true; return true;
} }
try { try {
@SuppressWarnings("deprecation")
Player player = Bukkit.getPlayer(args[1]); Player player = Bukkit.getPlayer(args[1]);
if (player == null || !player.isOnline()) { if (player == null || !player.isOnline()) {
sender.sendMessage("Player needs to be online!"); sender.sendMessage("Player needs to be online!");