Fixed incorrect string value error on legacy MySQL databases (fixes #826)

This commit is contained in:
Intelli committed 2026-04-23 22:05:22 -06:00
1 parent eee96fb5f9
commit aa2a3b9e8e
1 file changed
+34
@@ -0,0 +1,34 @@
package net.coreprotect.patch.script;
import java.sql.Statement;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.utility.Chat;
public class __2_24_0 {
protected static boolean patch(Statement statement) {
try {
if (Config.getGlobal().MYSQL) {
try {
statement.executeUpdate("ALTER TABLE " + ConfigHandler.prefix + "sign CONVERT TO CHARACTER SET utf8mb4");
}
catch (Exception e) {
Chat.console(Phrase.build(Phrase.PATCH_SKIP_UPDATE, ConfigHandler.prefix + "sign", Selector.FIRST, Selector.FIRST));
e.printStackTrace();
return false;
}
}
}
catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
}