Skip to content

Commit

Permalink
Update to v5.8.2 and fix MySQL compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed Nov 13, 2022
1 parent b2563f9 commit 33d078b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {


group = "rocks.gravili.notquests"
version = "5.8.1"
version = "5.8.2"


repositories {
Expand Down
4 changes: 3 additions & 1 deletion paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ dependencies {
//compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT!!")
//implementation("de.themoep:inventorygui:1.5-SNAPSHOT")

compileOnly("net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT")
//compileOnly("net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT")
compileOnly(files("libs/citizens-2.0.30-8.jar"))

compileOnly("me.clip:placeholderapi:2.11.2")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")

Expand Down
Binary file added paper/libs/citizens-2.0.30-8.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,10 @@ private void migrationAddProfileColumns(final Statement statement, final String

try{
statement.executeUpdate(query);
}catch (Exception ignored){
}catch (Exception e){
if(main.getConfiguration().debug){
e.printStackTrace();
}
}
}

Expand All @@ -1545,7 +1548,7 @@ private void migrateActiveObjectivesTable(final Statement statement) throws SQLE
CREATE TABLE `ActiveObjectives` (`ObjectiveType` varchar(200), `QuestName` varchar(200), `PlayerUUID` varchar(200), `CurrentProgress` DOUBLE, `ObjectiveID` INT(255), `HasBeenCompleted` BOOLEAN, `ProgressNeeded` DOUBLE, `Profile` varchar(200))
""");
statement.executeUpdate("""
INSERT INTO ActiveObjectives (ObjectiveType,QuestName,PlayerUUID,CurrentProgress,ObjectiveID,HasBeenCompleted,ProgressNeeded,Profile) SELECT ObjectiveType,QuestName,PlayerUUID,CurrentProgress,ObjectiveID,HasBeenCompleted,ProgressNeeded FROM ActiveObjectivesOld
INSERT INTO ActiveObjectives (ObjectiveType,QuestName,PlayerUUID,CurrentProgress,ObjectiveID,HasBeenCompleted,ProgressNeeded,Profile) VALUES ((SELECT ObjectiveType FROM ActiveObjectivesOld), (SELECT QuestName FROM ActiveObjectivesOld), (SELECT PlayerUUID FROM ActiveObjectivesOld), (SELECT CurrentProgress FROM ActiveObjectivesOld), (SELECT ObjectiveID FROM ActiveObjectivesOld), (SELECT HasBeenCompleted FROM ActiveObjectivesOld), (SELECT ProgressNeeded FROM ActiveObjectivesOld), 'default')
""");
statement.executeUpdate("""
DROP TABLE ActiveObjectivesOld
Expand All @@ -1562,7 +1565,7 @@ private void migrateQuestPlayerDataTable(final Statement statement) throws SQLEx
CREATE TABLE `QuestPlayerData` (`PlayerUUID` varchar(200), `QuestPoints` BIGINT(255), `Profile` varchar(200))
""");
statement.executeUpdate("""
INSERT INTO QuestPlayerData (PlayerUUID,QuestPoints,Profile) SELECT PlayerUUID,QuestPoints,Profile FROM QuestPlayerDataOld
INSERT INTO QuestPlayerData (PlayerUUID,QuestPoints,Profile) VALUES( (SELECT PlayerUUID FROM QuestPlayerDataOld),(SELECT QuestPoints FROM QuestPlayerDataOld), (SELECT Profile FROM QuestPlayerDataOld) )
""");
statement.executeUpdate("""
DROP TABLE QuestPlayerDataOld
Expand Down Expand Up @@ -1611,12 +1614,12 @@ private void reloadDataInternal() {


//Migrations
migrationAddProfileColumns(statement, "ALTER TABLE QuestPlayerData ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveQuests ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE CompletedQuests ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveObjectives ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveTriggers ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE Tags ADD COLUMN `Profile` VARCHAR NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE QuestPlayerData ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveQuests ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE CompletedQuests ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveObjectives ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE ActiveTriggers ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");
migrationAddProfileColumns(statement, "ALTER TABLE Tags ADD COLUMN `Profile` VARCHAR(200) NOT NULL DEFAULT 'default'");

if(hasToMigrateQuestPlayerDataTable){
migrateQuestPlayerDataTable(statement);
Expand Down
3 changes: 2 additions & 1 deletion spigot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ dependencies {
//implementation(files("libs/InventoryGui.jar"))

compileOnly("org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT")
compileOnly("net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT")
//compileOnly("net.citizensnpcs:citizens-main:2.0.30-SNAPSHOT")
compileOnly(files("libs/citizens-2.0.30-8.jar"))
compileOnly("me.clip:placeholderapi:2.11.2")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")

Expand Down
Binary file added spigot/libs/citizens-2.0.30-8.jar
Binary file not shown.

0 comments on commit 33d078b

Please sign in to comment.