Add ModMenu "integration"
This commit is contained in:
parent
306d9d4a76
commit
93e149be13
8 changed files with 49 additions and 11 deletions
|
@ -3,10 +3,11 @@ package su.a71.new_soviet;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import su.a71.new_soviet.config.Config;
|
||||
import su.a71.new_soviet.registration.NSE_Blocks;
|
||||
import su.a71.new_soviet.registration.NSE_Custom;
|
||||
import su.a71.new_soviet.registration.NSE_Items;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
package su.a71.new_soviet;
|
||||
package su.a71.new_soviet.config;
|
||||
|
||||
import net.minecraft.util.Util;
|
||||
import su.a71.new_soviet.NewSoviet;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
@ -22,8 +25,8 @@ public class Config {
|
|||
private static void generateDefault() {
|
||||
INSTANCE = new Config();
|
||||
|
||||
NewSoviet.LOG.info("Generated config file at config/new_soviet.json");
|
||||
File file = new File("config/new_soviet.json");
|
||||
NewSoviet.LOG.info("Generated config file at config/" + NewSoviet.MOD_ID + ".json");
|
||||
File file = new File("config/" + NewSoviet.MOD_ID + ".json");
|
||||
if(!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
|
||||
NewSoviet.LOG.error("Error making dir, using default config");
|
||||
INSTANCE = new Config();
|
||||
|
@ -40,7 +43,7 @@ public class Config {
|
|||
|
||||
public static void load() {
|
||||
// Generate config if it doesn't exist
|
||||
File file = new File("config/new_soviet.json");
|
||||
File file = new File("config/" + NewSoviet.MOD_ID + ".json");
|
||||
if(!file.exists()) {
|
||||
generateDefault();
|
||||
}
|
||||
|
@ -59,4 +62,9 @@ public class Config {
|
|||
INSTANCE = new Config();
|
||||
}
|
||||
}
|
||||
|
||||
public static void openConfigFile() {
|
||||
String configPath = "config/" + NewSoviet.MOD_ID + ".json";
|
||||
Util.getOperatingSystem().open(new File(configPath));
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ import net.minecraft.world.World;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import su.a71.new_soviet.Config;
|
||||
import su.a71.new_soviet.config.Config;
|
||||
import su.a71.new_soviet.NewSoviet;
|
||||
import su.a71.new_soviet.registration.NSE_Sounds;
|
||||
import su.a71.new_soviet.registration.NSE_Stats;
|
||||
|
|
|
@ -477,5 +477,5 @@
|
|||
"advancement.new_soviet.sickle_kill.name": "Боевой колхозник",
|
||||
"advancement.new_soviet.sickle_kill.desc": "Убейте кого-то серпом",
|
||||
|
||||
"modmenu.descriptionTranslation.modmenu": "Мод для minecraft который вернёт вас в старые добрые времена\nNSE добавляет строительные блоки, мебель, предметы и много всего другого в стиле СССР"
|
||||
"modmenu.descriptionTranslation.new_soviet": "Мод для minecraft который вернёт вас в старые добрые времена\nNSE добавляет строительные блоки, мебель, предметы и много всего другого в стиле СССР"
|
||||
}
|
|
@ -23,6 +23,9 @@
|
|||
],
|
||||
"fabric-datagen": [
|
||||
"su.a71.new_soviet.DataGeneration"
|
||||
],
|
||||
"modmenu": [
|
||||
"su.a71.new_soviet.config.ModMenuCompat"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue