Compare commits
No commits in common. "1dbb199258b6e920e1f843638aa891c93bccc14b" and "8e3226408734eef3942962f9b07e08548aafdbe1" have entirely different histories.
1dbb199258
...
8e32264087
13 changed files with 57 additions and 87 deletions
|
@ -4,23 +4,18 @@
|
||||||
|
|
||||||
1.2.0-RC1: Update n°12 (XX/XX/25)
|
1.2.0-RC1: Update n°12 (XX/XX/25)
|
||||||
[FEATURES]
|
[FEATURES]
|
||||||
- Updated to support Minecraft 1.21.5.
|
- Updated to support up to Minecraft 1.21.4.
|
||||||
- Added a sub-command (/nicko about) to get information about Nicko.
|
|
||||||
- Modernized the messages and added various sound effects upon interacting with the plugin.
|
- Modernized the messages and added various sound effects upon interacting with the plugin.
|
||||||
- Cleaned up GUI titles.
|
- Made GUIs names cleaner.
|
||||||
|
|
||||||
[FIXES]
|
[FIXES]
|
||||||
|
- Cleaned up the codebase to prepare for future updates.
|
||||||
- Fixed an oversight preventing the configuration from properly being migrated.
|
- Fixed an oversight preventing the configuration from properly being migrated.
|
||||||
- Fixed a rare bug that could prevent data from being saved.
|
|
||||||
- Fixed the placeholder item in the skin cache invalidation not being translated.
|
- Fixed the placeholder item in the skin cache invalidation not being translated.
|
||||||
- Fixed a oversight about a column name using SQL storage.
|
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
- Moved the prefix to the language file.
|
- Moved the prefix to the language file.
|
||||||
|
|
||||||
[OTHER]
|
|
||||||
- Cleaned up the codebase to prepare for future updates.
|
|
||||||
|
|
||||||
1.1.7-RC1: Hotfix n°5 (04/05/24)
|
1.1.7-RC1: Hotfix n°5 (04/05/24)
|
||||||
[OTHER]
|
[OTHER]
|
||||||
- Restored download link again on spigotmc.org
|
- Restored download link again on spigotmc.org
|
||||||
|
|
|
@ -2,7 +2,7 @@ plugins {
|
||||||
id("java")
|
id("java")
|
||||||
id("com.gradleup.shadow") version "8.3.2"
|
id("com.gradleup.shadow") version "8.3.2"
|
||||||
id("xyz.jpenilla.run-paper") version "2.3.0"
|
id("xyz.jpenilla.run-paper") version "2.3.0"
|
||||||
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
|
id("io.papermc.paperweight.userdev") version "2.0.0-beta.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.ineanto"
|
group = "xyz.ineanto"
|
||||||
|
@ -13,7 +13,6 @@ val invuiVersion: String = "1.44"
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_22
|
sourceCompatibility = JavaVersion.VERSION_22
|
||||||
targetCompatibility = JavaVersion.VERSION_22
|
targetCompatibility = JavaVersion.VERSION_22
|
||||||
|
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion = JavaLanguageVersion.of(22)
|
languageVersion = JavaLanguageVersion.of(22)
|
||||||
}
|
}
|
||||||
|
@ -23,10 +22,10 @@ repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
|
||||||
maven("https://repo.xenondevs.xyz/releases")
|
maven { url = uri("https://repo.xenondevs.xyz/releases") }
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
|
||||||
maven("https://repo.codemc.io/repository/maven-snapshots/")
|
maven { url = uri("https://repo.codemc.io/repository/maven-snapshots/") }
|
||||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -45,7 +44,7 @@ dependencies {
|
||||||
implementation("com.mysql:mysql-connector-j:9.2.0")
|
implementation("com.mysql:mysql-connector-j:9.2.0")
|
||||||
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.2")
|
implementation("org.mariadb.jdbc:mariadb-java-client:3.5.2")
|
||||||
implementation("redis.clients:jedis:5.2.0")
|
implementation("redis.clients:jedis:5.2.0")
|
||||||
implementation("com.google.code.gson:gson:2.13.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package xyz.ineanto.nicko.appearance;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
public record Appearance(
|
|
||||||
@Nullable String name,
|
|
||||||
@Nullable String skin
|
|
||||||
) {}
|
|
|
@ -30,13 +30,13 @@ public class NickoCommand implements BasicCommand {
|
||||||
|
|
||||||
if (args.length >= 1 && args[0].equalsIgnoreCase("about")) {
|
if (args.length >= 1 && args[0].equalsIgnoreCase("about")) {
|
||||||
final Component firstAboutMessage = MiniMessage.miniMessage().deserialize(
|
final Component firstAboutMessage = MiniMessage.miniMessage().deserialize(
|
||||||
"<prefix> <dark_gray>(© Ineanto 2023-2025) </dark_gray><gray>v<version></gray> ",
|
"<prefix> <gray>v<version></gray>",
|
||||||
Placeholder.component("prefix", playerLanguage.getPrefixComponent()),
|
Placeholder.component("prefix", playerLanguage.getPrefixComponent()),
|
||||||
Placeholder.unparsed("version", Nicko.getInstance().getPluginMeta().getVersion())
|
Placeholder.unparsed("version", Nicko.getInstance().getPluginMeta().getVersion())
|
||||||
);
|
);
|
||||||
|
|
||||||
final Component secondAboutMessage = MiniMessage.miniMessage().deserialize(
|
final Component secondAboutMessage = MiniMessage.miniMessage().deserialize(
|
||||||
"<gradient:#01a97c:#8ffd54>Configuration</gradient> <gray>v<configversion></gray>, <gradient:#01a97c:#8ffd54>I18N</gradient> <gray><i18nversion></gray>",
|
"<gradient:#01a97c:#8ffd54>Configuration</gradient> <gray>v<configversion></gray>, <gradient:#01a97c:#8ffd54>I18N</gradient> <gray>v<i18nversion></gray>",
|
||||||
Placeholder.component("prefix", playerLanguage.getPrefixComponent()),
|
Placeholder.component("prefix", playerLanguage.getPrefixComponent()),
|
||||||
Placeholder.unparsed("configversion", Configuration.VERSION.toString()),
|
Placeholder.unparsed("configversion", Configuration.VERSION.toString()),
|
||||||
Placeholder.unparsed("i18nversion", Language.VERSION.toString())
|
Placeholder.unparsed("i18nversion", Language.VERSION.toString())
|
||||||
|
|
|
@ -9,7 +9,7 @@ public enum Language implements Serializable {
|
||||||
FRENCH("fr", "Français"),
|
FRENCH("fr", "Français"),
|
||||||
CUSTOM("cm", "Server Custom");
|
CUSTOM("cm", "Server Custom");
|
||||||
|
|
||||||
public static final Version VERSION = new Version(1, 3, 1);
|
public static final Version VERSION = new Version(1, 3, 0);
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private transient final String name;
|
private transient final String name;
|
||||||
|
|
|
@ -2,36 +2,28 @@ package xyz.ineanto.nicko.profile;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import xyz.ineanto.nicko.Nicko;
|
import xyz.ineanto.nicko.Nicko;
|
||||||
import xyz.ineanto.nicko.appearance.Appearance;
|
|
||||||
import xyz.ineanto.nicko.language.Language;
|
import xyz.ineanto.nicko.language.Language;
|
||||||
import xyz.ineanto.nicko.storage.PlayerDataStore;
|
import xyz.ineanto.nicko.storage.PlayerDataStore;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class NickoProfile implements Cloneable {
|
public class NickoProfile implements Cloneable {
|
||||||
public static final NickoProfile EMPTY_PROFILE = new NickoProfile(
|
public static final NickoProfile EMPTY_PROFILE = new NickoProfile(null, null, Language.ENGLISH, true);
|
||||||
new Appearance(null, null),
|
|
||||||
Language.ENGLISH,
|
|
||||||
true,
|
|
||||||
Collections.emptyList()
|
|
||||||
);
|
|
||||||
|
|
||||||
private static final Nicko instance = Nicko.getInstance();
|
private static final Nicko instance = Nicko.getInstance();
|
||||||
private static final PlayerDataStore dataStore = instance.getDataStore();
|
private static final PlayerDataStore dataStore = instance.getDataStore();
|
||||||
|
|
||||||
private Appearance appearance;
|
private String name;
|
||||||
|
private String skin;
|
||||||
private Language language;
|
private Language language;
|
||||||
private boolean randomSkin;
|
private boolean randomSkin;
|
||||||
private transient List<Appearance> favorites;
|
|
||||||
|
|
||||||
public NickoProfile(Appearance appearance, Language language, boolean randomSkin, List<Appearance> favorites) {
|
public NickoProfile(String name, String skin, Language language, boolean randomSkin) {
|
||||||
this.appearance = appearance;
|
this.name = name;
|
||||||
|
this.skin = skin;
|
||||||
this.language = language;
|
this.language = language;
|
||||||
this.randomSkin = randomSkin;
|
this.randomSkin = randomSkin;
|
||||||
this.favorites = favorites;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Optional<NickoProfile> get(Player player) {
|
public static Optional<NickoProfile> get(Player player) {
|
||||||
|
@ -43,31 +35,23 @@ public class NickoProfile implements Cloneable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasData() {
|
public boolean hasData() {
|
||||||
return appearance.name() != null || appearance.skin() != null;
|
return name != null || skin != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return appearance.name();
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.appearance = new Appearance(name, appearance.skin() == null ? null : appearance.skin());
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSkin() {
|
public String getSkin() {
|
||||||
return appearance.skin();
|
return skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSkin(String skin) {
|
public void setSkin(String skin) {
|
||||||
this.appearance = new Appearance(appearance.name() == null ? null : appearance.name(), skin);
|
this.skin = skin;
|
||||||
}
|
|
||||||
|
|
||||||
public List<Appearance> getFavorites() {
|
|
||||||
return favorites;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFavorites(List<Appearance> favorites) {
|
|
||||||
this.favorites = favorites;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Language getLocale() {
|
public Language getLocale() {
|
||||||
|
@ -86,6 +70,16 @@ public class NickoProfile implements Cloneable {
|
||||||
this.randomSkin = randomSkin;
|
this.randomSkin = randomSkin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NickoProfile{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", skin='" + skin + '\'' +
|
||||||
|
", locale=" + language +
|
||||||
|
", randomSkin=" + randomSkin +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NickoProfile clone() {
|
public NickoProfile clone() {
|
||||||
Object o;
|
Object o;
|
||||||
|
|
|
@ -46,7 +46,6 @@ public class JSONStorage extends Storage {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
logger.warning("Could not create file.");
|
logger.warning("Could not create file.");
|
||||||
e.printStackTrace();
|
|
||||||
return ActionResult.error();
|
return ActionResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,12 +54,14 @@ public class JSONStorage extends Storage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isStored(UUID uuid) {
|
public boolean isStored(UUID uuid) {
|
||||||
|
final File directory = new File(Nicko.getInstance().getDataFolder() + "/players/");
|
||||||
final File file = new File(directory, uuid.toString() + ".json");
|
final File file = new File(directory, uuid.toString() + ".json");
|
||||||
return file.exists();
|
return file.exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<NickoProfile> retrieve(UUID uuid) {
|
public Optional<NickoProfile> retrieve(UUID uuid) {
|
||||||
|
final File directory = new File(Nicko.getInstance().getDataFolder() + "/players/");
|
||||||
final File file = new File(directory, uuid.toString() + ".json");
|
final File file = new File(directory, uuid.toString() + ".json");
|
||||||
try (FileReader fileReader = new FileReader(file)) {
|
try (FileReader fileReader = new FileReader(file)) {
|
||||||
try (BufferedReader reader = new BufferedReader(fileReader)) {
|
try (BufferedReader reader = new BufferedReader(fileReader)) {
|
||||||
|
@ -74,6 +75,7 @@ public class JSONStorage extends Storage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult delete(UUID uuid) {
|
public ActionResult delete(UUID uuid) {
|
||||||
|
final File directory = new File(Nicko.getInstance().getDataFolder() + "/players/");
|
||||||
final File file = new File(directory, uuid.toString() + ".json");
|
final File file = new File(directory, uuid.toString() + ".json");
|
||||||
if (file.delete() || !file.exists()) {
|
if (file.delete() || !file.exists()) {
|
||||||
return ActionResult.ok();
|
return ActionResult.ok();
|
||||||
|
@ -82,11 +84,6 @@ public class JSONStorage extends Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkFileExists(File file) throws IOException {
|
private boolean checkFileExists(File file) throws IOException {
|
||||||
// Additional check if the folder gets deleted while the plugin is running.
|
|
||||||
if (!file.getParentFile().exists()) {
|
|
||||||
file.getParentFile().mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
return file.createNewFile();
|
return file.createNewFile();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,11 @@ public class JSONStorageProvider implements StorageProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean init() {
|
public boolean init()
|
||||||
|
{
|
||||||
return directory.exists() || directory.mkdirs();
|
return directory.exists() || directory.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean close() {
|
public boolean close() { return true; }
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package xyz.ineanto.nicko.storage.mariadb;
|
package xyz.ineanto.nicko.storage.mariadb;
|
||||||
|
|
||||||
import xyz.ineanto.nicko.appearance.ActionResult;
|
import xyz.ineanto.nicko.appearance.ActionResult;
|
||||||
import xyz.ineanto.nicko.appearance.Appearance;
|
|
||||||
import xyz.ineanto.nicko.config.Configuration;
|
import xyz.ineanto.nicko.config.Configuration;
|
||||||
import xyz.ineanto.nicko.language.Language;
|
import xyz.ineanto.nicko.language.Language;
|
||||||
import xyz.ineanto.nicko.profile.NickoProfile;
|
import xyz.ineanto.nicko.profile.NickoProfile;
|
||||||
|
@ -11,7 +10,6 @@ import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
@ -85,16 +83,15 @@ public class MariaDBStorage extends Storage {
|
||||||
String name = "";
|
String name = "";
|
||||||
String skin = "";
|
String skin = "";
|
||||||
String locale = "";
|
String locale = "";
|
||||||
boolean randomSkin = false;
|
boolean bungeecord = false;
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
name = resultSet.getString("name");
|
name = resultSet.getString("name");
|
||||||
skin = resultSet.getString("skin");
|
skin = resultSet.getString("skin");
|
||||||
locale = resultSet.getString("locale");
|
locale = resultSet.getString("locale");
|
||||||
randomSkin = resultSet.getBoolean("randomskin");
|
bungeecord = resultSet.getBoolean("bungeecord");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO (Ineanto, 17/05/2025): Retrieve favorites
|
final NickoProfile profile = new NickoProfile(name, skin, Language.fromCode(locale), bungeecord);
|
||||||
final NickoProfile profile = new NickoProfile(new Appearance(name, skin), Language.fromCode(locale), randomSkin, Collections.emptyList());
|
|
||||||
return Optional.of(profile);
|
return Optional.of(profile);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't fetch profile: " + e.getMessage());
|
logger.warning("Couldn't fetch profile: " + e.getMessage());
|
||||||
|
@ -120,7 +117,7 @@ public class MariaDBStorage extends Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private PreparedStatement getInsertStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
private PreparedStatement getInsertStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
||||||
final String sql = "INSERT IGNORE INTO nicko.DATA (`uuid`, `name`, `skin`, `locale`, `randomskin`) VALUES (?, ?, ?, ?, ?)";
|
final String sql = "INSERT IGNORE INTO nicko.DATA (`uuid`, `name`, `skin`, `locale`, `bungeecord`) VALUES (?, ?, ?, ?, ?)";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, uuid.toString());
|
statement.setString(1, uuid.toString());
|
||||||
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
||||||
|
@ -131,7 +128,7 @@ public class MariaDBStorage extends Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private PreparedStatement getUpdateStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
private PreparedStatement getUpdateStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
||||||
final String sql = "UPDATE nicko.DATA SET name = ?, skin = ?, locale = ?, randomskin = ? WHERE uuid = ?";
|
final String sql = "UPDATE nicko.DATA SET name = ?, skin = ?, locale = ?, bungeecord = ? WHERE uuid = ?";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package xyz.ineanto.nicko.storage.mysql;
|
package xyz.ineanto.nicko.storage.mysql;
|
||||||
|
|
||||||
import xyz.ineanto.nicko.appearance.ActionResult;
|
import xyz.ineanto.nicko.appearance.ActionResult;
|
||||||
import xyz.ineanto.nicko.appearance.Appearance;
|
|
||||||
import xyz.ineanto.nicko.config.Configuration;
|
import xyz.ineanto.nicko.config.Configuration;
|
||||||
import xyz.ineanto.nicko.language.Language;
|
import xyz.ineanto.nicko.language.Language;
|
||||||
import xyz.ineanto.nicko.profile.NickoProfile;
|
import xyz.ineanto.nicko.profile.NickoProfile;
|
||||||
|
@ -11,7 +10,6 @@ import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
@ -85,16 +83,15 @@ public class MySQLStorage extends Storage {
|
||||||
String name = "";
|
String name = "";
|
||||||
String skin = "";
|
String skin = "";
|
||||||
String locale = "";
|
String locale = "";
|
||||||
boolean randomSkin = false;
|
boolean bungeecord = false;
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
name = resultSet.getString("name");
|
name = resultSet.getString("name");
|
||||||
skin = resultSet.getString("skin");
|
skin = resultSet.getString("skin");
|
||||||
locale = resultSet.getString("locale");
|
locale = resultSet.getString("locale");
|
||||||
randomSkin = resultSet.getBoolean("randomskin");
|
bungeecord = resultSet.getBoolean("bungeecord");
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO (Ineanto, 17/05/2025): Retrieve favorites
|
final NickoProfile profile = new NickoProfile(name, skin, Language.fromCode(locale), bungeecord);
|
||||||
final NickoProfile profile = new NickoProfile(new Appearance(name, skin), Language.fromCode(locale), randomSkin, Collections.emptyList());
|
|
||||||
return Optional.of(profile);
|
return Optional.of(profile);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't fetch profile: " + e.getMessage());
|
logger.warning("Couldn't fetch profile: " + e.getMessage());
|
||||||
|
@ -120,7 +117,7 @@ public class MySQLStorage extends Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private PreparedStatement getInsertStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
private PreparedStatement getInsertStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
||||||
final String sql = "INSERT IGNORE INTO nicko.DATA (`uuid`, `name`, `skin`, `locale`, `randomskin`) VALUES (?, ?, ?, ?, ?)";
|
final String sql = "INSERT IGNORE INTO nicko.DATA (`uuid`, `name`, `skin`, `locale`, `bungeecord`) VALUES (?, ?, ?, ?, ?)";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, uuid.toString());
|
statement.setString(1, uuid.toString());
|
||||||
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
statement.setString(2, profile.getName() == null ? null : profile.getName());
|
||||||
|
@ -131,7 +128,7 @@ public class MySQLStorage extends Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private PreparedStatement getUpdateStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
private PreparedStatement getUpdateStatement(Connection connection, UUID uuid, NickoProfile profile) throws SQLException {
|
||||||
final String sql = "UPDATE nicko.DATA SET name = ?, skin = ?, locale = ?, randomskin = ? WHERE uuid = ?";
|
final String sql = "UPDATE nicko.DATA SET name = ?, skin = ?, locale = ?, bungeecord = ? WHERE uuid = ?";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
statement.setString(1, profile.getName() == null ? null : profile.getName());
|
||||||
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
statement.setString(2, profile.getSkin() == null ? null : profile.getSkin());
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Nicko ${version} - Language File:
|
# Nicko ${version} - Language File:
|
||||||
|
|
||||||
# Specifies the configuration version, don't change.
|
# Specifies the configuration version, don't change.
|
||||||
version: "1.3.1"
|
version: "1.3.0"
|
||||||
|
|
||||||
prefix: "<b><gradient:#01a97c:#8ffd54>NICKO</gradient></b>"
|
prefix: "<b><gradient:#01a97c:#8ffd54>NICKO</gradient></b>"
|
||||||
whoosh: "<b><gradient:#01a97c:#8ffd54>WHOOSH!</gradient></b>"
|
whoosh: "<b><gradient:#01a97c:#8ffd54>WHOOSH!</gradient></b>"
|
||||||
|
@ -38,7 +38,7 @@ event:
|
||||||
|
|
||||||
gui:
|
gui:
|
||||||
title:
|
title:
|
||||||
home: "Nicko"
|
home: "Nicko - Home"
|
||||||
settings: "Settings"
|
settings: "Settings"
|
||||||
admin: "Administration"
|
admin: "Administration"
|
||||||
check: "Player Management"
|
check: "Player Management"
|
||||||
|
@ -102,7 +102,7 @@ gui:
|
||||||
- "<gray>Completely remove your disguise.</gray>"
|
- "<gray>Completely remove your disguise.</gray>"
|
||||||
admin:
|
admin:
|
||||||
manage_cache:
|
manage_cache:
|
||||||
name: "Manage the skin cache..."
|
name: "Manage the <gold>skin</gold> cache..."
|
||||||
lore:
|
lore:
|
||||||
- "<gray>View and manage the skin cache.</gray>"
|
- "<gray>View and manage the skin cache.</gray>"
|
||||||
manage_player:
|
manage_player:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Nicko ${version} - Fichier de langue:
|
# Nicko ${version} - Fichier de langue:
|
||||||
|
|
||||||
# Précise la version de la configuration, ne pas changer.
|
# Précise la version de la configuration, ne pas changer.
|
||||||
version: "1.3.1"
|
version: "1.3.0"
|
||||||
|
|
||||||
prefix: "<b><gradient:#01a97c:#8ffd54>NICKO</gradient></b>"
|
prefix: "<b><gradient:#01a97c:#8ffd54>NICKO</gradient></b>"
|
||||||
whoosh: "<b><gradient:#01a97c:#8ffd54>WHOOSH!</gradient></b>"
|
whoosh: "<b><gradient:#01a97c:#8ffd54>WHOOSH!</gradient></b>"
|
||||||
|
@ -38,7 +38,7 @@ event:
|
||||||
|
|
||||||
gui:
|
gui:
|
||||||
title:
|
title:
|
||||||
home: "Nicko"
|
home: "Nicko - Accueil"
|
||||||
settings: "Paramètres"
|
settings: "Paramètres"
|
||||||
admin: "Administration"
|
admin: "Administration"
|
||||||
check: "Gestion des Joueurs"
|
check: "Gestion des Joueurs"
|
||||||
|
@ -103,7 +103,7 @@ gui:
|
||||||
- "<gray>Supprime complètement votre déguisement.</gray>"
|
- "<gray>Supprime complètement votre déguisement.</gray>"
|
||||||
admin:
|
admin:
|
||||||
manage_cache:
|
manage_cache:
|
||||||
name: "Gérer le cache de skin..."
|
name: "Gérer le cache de <gold>skin...</gold>"
|
||||||
lore:
|
lore:
|
||||||
- "<gray>Consultez et gérez le cache de skin.</gray>"
|
- "<gray>Consultez et gérez le cache de skin.</gray>"
|
||||||
manage_player:
|
manage_player:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue