fix updating player

This commit is contained in:
Lennart ten Wolde 2016-03-23 04:14:31 +01:00
parent 8546bcb255
commit f20608e8f5
3 changed files with 40 additions and 5 deletions

View file

@ -4,7 +4,7 @@
<groupId>com.lenis0012.bukkit</groupId>
<artifactId>marriage2</artifactId>
<version>2.0.7</version>
<version>2.0.8-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Marriage</name>
<url>http://dev.bukkit.org/server-mods/marriage-reloaded/</url>
@ -188,6 +188,7 @@
</resources>
<!--<defaultGoal>install</defaultGoal>-->
<finalName>${project.name}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<!-- Plugins -->
<plugins>
<!-- Compiler plugin -->

View file

@ -0,0 +1,34 @@
package com.lenis0012.bukkit.marriage2;
import com.lenis0012.bukkit.marriage2.internal.MarriagePlugin;
public class MarriageAPI {
private static final int API_VERSION = 100;
/**
* Get the API main instance.
*
* @return
*/
public static Marriage getInstance() {
return MarriagePlugin.getCore();
}
/**
* Get current API version.
*
* @return API Version
*/
public static int getAPIVersion() {
return API_VERSION;
}
/**
* Get current plugin version
*
* @return Plugin version
*/
public static String getPluginVersion() {
return MarriagePlugin.getInstance().getDescription().getVersion();
}
}

View file

@ -226,10 +226,10 @@ public class DataManager {
PreparedStatement ps2 = connection.prepareStatement(String.format(
"UPDATE %splayers SET last_name=?,gender=?,priest=?,lastlogin=? WHERE unique_user_id=?;", prefix));
ps2.setString(1, player.getLastName());
ps2.setString(1, player.getGender().toString());
ps2.setBoolean(2, player.isPriest());
ps2.setLong(3, System.currentTimeMillis());
ps2.setString(4, player.getUniqueId().toString());
ps2.setString(2, player.getGender().toString());
ps2.setBoolean(3, player.isPriest());
ps2.setLong(4, System.currentTimeMillis());
ps2.setString(5, player.getUniqueId().toString());
ps2.executeUpdate();
ps2.close();
} else {