Created quest_log table

This commit is contained in:
Teriuihi 2022-06-03 03:42:21 +02:00
parent cdff96fb4d
commit 6a5261ff9a
2 changed files with 24 additions and 1 deletions

View File

@ -98,7 +98,7 @@ public class Database {
"step_1_progress INT NOT NULL, " +
"step_2_progress INT NOT NULL, " +
"reward_received BIT(1) NOT NULL, " +
"PRIMARY KEY (UUID)" +
"PRIMARY KEY (uuid)" +
")";
getDatabase().getConnection().prepareStatement(sql).executeUpdate();
} catch (SQLException e) {
@ -109,4 +109,22 @@ public class Database {
}
}
private static void createQuestLogTable() {
try {
String sql = "CREATE TABLE IF NOT EXISTS quest_log(" +
"uuid VARCHAR(36) NOT NULL, " +
"year INT NOT NULL, " +
"month INT NOT NULL, " +
"day INT NOT NULL, " +
"PRIMARY KEY (uuid, year, month, day)" +
")";
getDatabase().getConnection().prepareStatement(sql).executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
Logger.severe("Error while trying to create quest log table");
Logger.severe("Shutting down AltitudeQuests");
Bukkit.getPluginManager().disablePlugin(AQuest.getInstance());
}
}
}

View File

@ -210,10 +210,15 @@ public abstract class Quest {
if (!isDone)
return;
//TODO add completed quest to database
saveDone(player);
QuestCompleteEvent event = new QuestCompleteEvent(player, this, true);
event.callEvent();
}
private void saveDone(Player player) {
}
public Variant getVariant() {
return variant;
}