otterlib 0.2 changes

This commit is contained in:
Oth3r 2025-06-16 15:07:37 -05:00
commit c9cc006245
5 changed files with 9 additions and 16 deletions

View file

@ -99,8 +99,8 @@ public class LangReader {
Reader defaultReader = new InputStreamReader(getInputStream(true), StandardCharsets.UTF_8);
defaultLangMap.putAll(new Gson().fromJson(defaultReader, tToken));
} catch (Exception e) {
Data.LOGGER.info("ERROR WITH LANGUAGE FILE - PLEASE REPORT WITH THE ERROR LOG");
Data.LOGGER.info(e.getMessage());
Data.LOGGER.error("ERROR WITH LANGUAGE FILE - PLEASE REPORT WITH THE ERROR LOG");
Data.LOGGER.error(e.getMessage());
}
}

View file

@ -1,7 +1,6 @@
package one.oth3r.sit.file;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonSyntaxException;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
@ -264,13 +263,8 @@ public class ServerConfig implements CustomFile<ServerConfig> {
this.interactionBlocks = newFile.interactionBlocks.stream().map(CustomBlock::new).collect(Collectors.toCollection(ArrayList::new));
}
/**
* updates the file based on the version number of the current instance
*
* @param json
*/
@Override
public void update(JsonElement json) {
public void updateInstance() {
/// update to 2.1, just a new list, nothing to change
/// update to 2.2, new settings, no changes
if (version >= 2.0 && version <= 2.1) {
@ -341,7 +335,7 @@ public class ServerConfig implements CustomFile<ServerConfig> {
loadVersion(properties,Double.parseDouble(ver));
} catch (Exception e) {
Data.LOGGER.error("Error loading legacy config file: {}", e.getMessage());
Data.LOGGER.error("Error loading legacy config file: %s", e.getMessage());
}
// delete the old file
@ -503,7 +497,7 @@ public class ServerConfig implements CustomFile<ServerConfig> {
serverConfig.save();
sittingConfig.save();
} catch (Exception e) {
Data.LOGGER.error("Error loading legacy config: {}", e.getMessage());
Data.LOGGER.error("Error loading legacy config: %s", e.getMessage());
}
}
}

View file

@ -101,7 +101,7 @@ public class SittingConfig implements CustomFile<SittingConfig> {
}
@Override
public void update(JsonElement jsonElement) {
public void updateInstance() {
}