mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-01 15:03:36 +01:00
change version only if update checks are correct
This commit is contained in:
parent
d2299bfe03
commit
3f4f113891
@ -34,7 +34,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.JobsPlugin;
|
||||
import com.gamingmesh.jobs.config.ConfigManager;
|
||||
import com.gamingmesh.jobs.container.Convert;
|
||||
import com.gamingmesh.jobs.container.ExploreChunk;
|
||||
@ -63,11 +62,6 @@ public abstract class JobsDAO {
|
||||
|
||||
private JobsConnectionPool pool;
|
||||
private String prefix;
|
||||
private JobsPlugin plugin;
|
||||
|
||||
public JobsDAO(JobsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
protected JobsDAO(String driverName, String url, String username, String password, String prefix) {
|
||||
this.prefix = prefix;
|
||||
@ -105,8 +99,8 @@ public abstract class JobsDAO {
|
||||
checkUpdate8();
|
||||
|
||||
version = 8;
|
||||
} finally {
|
||||
updateSchemaVersion(version);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,9 +499,6 @@ public abstract class JobsDAO {
|
||||
}
|
||||
|
||||
public void fixUuid(final CommandSender sender) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JobsConnection conn = getConnection();
|
||||
if (conn == null)
|
||||
return;
|
||||
@ -547,14 +538,8 @@ public abstract class JobsDAO {
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
public void fixName(final CommandSender sender) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
JobsConnection conn = getConnection();
|
||||
if (conn == null)
|
||||
return;
|
||||
@ -608,10 +593,6 @@ public abstract class JobsDAO {
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,12 @@ public class JobsDAOMySQL extends JobsDAO {
|
||||
PreparedStatement insert = null;
|
||||
while (rs.next()) {
|
||||
|
||||
String uuid = UUIDUtil.fromBytes(rs.getBytes("player_uuid")).toString();
|
||||
byte[] uuidBytes = rs.getBytes("player_uuid");
|
||||
|
||||
if (uuidBytes == null)
|
||||
continue;
|
||||
|
||||
String uuid = UUIDUtil.fromBytes(uuidBytes).toString();
|
||||
|
||||
if (uuid != null) {
|
||||
insert = conn.prepareStatement("INSERT INTO `" + getPrefix()
|
||||
|
@ -328,8 +328,12 @@ public class JobsDAOSQLite extends JobsDAO {
|
||||
ResultSet rs = pst1.executeQuery();
|
||||
PreparedStatement insert = null;
|
||||
while (rs.next()) {
|
||||
byte[] uuidBytes = rs.getBytes("player_uuid");
|
||||
|
||||
String uuid = UUIDUtil.fromBytes(rs.getBytes("player_uuid")).toString();
|
||||
if (uuidBytes == null)
|
||||
continue;
|
||||
|
||||
String uuid = UUIDUtil.fromBytes(uuidBytes).toString();
|
||||
|
||||
if (uuid != null) {
|
||||
insert = conn.prepareStatement("INSERT INTO `" + getPrefix()
|
||||
|
Loading…
Reference in New Issue
Block a user