forked from virt-mirrors/Sit
Data -> FileData
This commit is contained in:
parent
e105f36dc8
commit
7d06735b3c
9 changed files with 26 additions and 26 deletions
|
@ -5,7 +5,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
|||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Data {
|
||||
public class FileData {
|
||||
/**
|
||||
* Sit! config file
|
||||
*/
|
|
@ -79,7 +79,7 @@ public class LangReader {
|
|||
public static void loadLanguageFile() {
|
||||
ClassLoader classLoader = Sit.class.getClassLoader();
|
||||
try {
|
||||
InputStream inputStream = classLoader.getResourceAsStream("assets/sit/lang/"+ Data.getServerConfig().getLang() +".json");
|
||||
InputStream inputStream = classLoader.getResourceAsStream("assets/sit/lang/"+ FileData.getServerConfig().getLang() +".json");
|
||||
|
||||
// if the input stream is null, the language file wasn't found
|
||||
if (inputStream == null) {
|
||||
|
|
|
@ -169,7 +169,7 @@ public class ServerConfig {
|
|||
Sit.LOGGER.info(String.format("Creating new `%s`", getFile().getName()));
|
||||
}
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(getFile().toPath(), StandardCharsets.UTF_8)) {
|
||||
writer.write(Utl.getGson().toJson(Data.getServerConfig()));
|
||||
writer.write(Utl.getGson().toJson(FileData.getServerConfig()));
|
||||
} catch (Exception e) {
|
||||
Sit.LOGGER.info(String.format("ERROR SAVING '%s`: %s", getFile().getName(), e.getMessage()));
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class SittingConfig {
|
|||
Sit.LOGGER.info(String.format("Creating new `%s`", getFile().getName()));
|
||||
}
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(getFile().toPath(), StandardCharsets.UTF_8)) {
|
||||
writer.write(Utl.getGson().toJson(Data.getSittingConfig()));
|
||||
writer.write(Utl.getGson().toJson(FileData.getSittingConfig()));
|
||||
} catch (Exception e) {
|
||||
Sit.LOGGER.error(String.format("ERROR SAVING '%s`: %s", getFile().getName(), e.getMessage()));
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Updater {
|
|||
sittingConfig = update(sittingConfig);
|
||||
|
||||
// set the config in the mod data
|
||||
Data.setSittingConfig(sittingConfig);
|
||||
FileData.setSittingConfig(sittingConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +90,7 @@ public class Updater {
|
|||
serverConfig = update(serverConfig);
|
||||
|
||||
// set the config in the mod data
|
||||
Data.setServerConfig(serverConfig);
|
||||
FileData.setServerConfig(serverConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -273,8 +273,8 @@ public class Updater {
|
|||
} catch (JsonSyntaxException ignored) {}
|
||||
}
|
||||
|
||||
Data.setServerConfig(serverConfig);
|
||||
Data.setSittingConfig(sittingConfig);
|
||||
FileData.setServerConfig(serverConfig);
|
||||
FileData.setSittingConfig(sittingConfig);
|
||||
ServerConfig.save();
|
||||
SittingConfig.save();
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue