Changed the usage of the cursor.

This commit is contained in:
RicardormDev 2021-04-25 12:46:44 -05:00
parent e917670c1f
commit 6a6f6a4eb8
No known key found for this signature in database
GPG Key ID: DDC0B37FB6B8C169

View File

@ -13,6 +13,7 @@ import net.Indyuce.mmocore.manager.data.mysql.MySQLTableEditor.Table;
import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.MythicLib;
import org.apache.commons.lang.Validate; import org.apache.commons.lang.Validate;
import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -36,7 +37,7 @@ public class MySQLPlayerDataManager extends PlayerDataManager {
try { try {
MMOCore.sqlDebug("Loading data for: '" + data.getUniqueId() + "'..."); MMOCore.sqlDebug("Loading data for: '" + data.getUniqueId() + "'...");
if (!result.first()) { if (!result.next()) {
data.setLevel(getDefaultData().getLevel()); data.setLevel(getDefaultData().getLevel());
data.setClassPoints(getDefaultData().getClassPoints()); data.setClassPoints(getDefaultData().getClassPoints());
data.setSkillPoints(getDefaultData().getSkillPoints()); data.setSkillPoints(getDefaultData().getSkillPoints());
@ -187,7 +188,7 @@ public class MySQLPlayerDataManager extends PlayerDataManager {
provider.getResult("SELECT * FROM mmocore_playerdata WHERE uuid = '" + uuid + "';", (result) -> { provider.getResult("SELECT * FROM mmocore_playerdata WHERE uuid = '" + uuid + "';", (result) -> {
try { try {
MMOCore.sqlDebug("Loading OFFLINE data for '" + uuid + "'."); MMOCore.sqlDebug("Loading OFFLINE data for '" + uuid + "'.");
if (!result.first()) { if (!result.next()) {
level = 0; level = 0;
lastLogin = 0; lastLogin = 0;
profess = MMOCore.plugin.classManager.getDefaultClass(); profess = MMOCore.plugin.classManager.getDefaultClass();