From 83f06b602d6b4f14954eaeffca42a8b2d1ef457f Mon Sep 17 00:00:00 2001 From: cech12 Date: Sun, 14 Jul 2024 21:52:19 +0200 Subject: [PATCH] updated NeoForge to 21.0.94-beta - usage of NeoForge's config directory for default config - fix startup crash #26 --- CHANGELOG.md | 8 ++++++++ gradle.properties | 6 +++--- .../solarcooker/platform/NeoForgeConfigHelper.java | 11 ----------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23ff22c..1824f55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/). +## [1.21-4.1.0.0] - 2024-07-14 +### Changed +- updated NeoForge to 21.0.94-beta +- the `config` directory is used for the default configuration (NeoForge) + +### Fixed +- crashed on startup with NeoForge (caused by a breaking change in 21.0.82-beta) (thanks to unspunreality for the report) #26 + ## [1.21-4.0.0.1] - 2024-07-08 ### Fixed - removed unknown recipe warning from log (all loaders) diff --git a/gradle.properties b/gradle.properties index 7655d47..1ec14dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ # Project group=de.cech12.solarcooker -mod_version=4.0.0.1 +mod_version=4.1.0.0 mod_id=solarcooker mod_name=Solar Cooker mod_author=Cech12 @@ -30,8 +30,8 @@ forge_version_range=[51.0.18,) forge_loader_version_range=[50,) # NeoForge -neoforge_version=21.0.42-beta -neoforge_version_range=[21.0.42-beta,) +neoforge_version=21.0.94-beta +neoforge_version_range=[21.0.94-beta,) neoforge_loader_version_range=[2,) # jei diff --git a/neoforge/src/main/java/de/cech12/solarcooker/platform/NeoForgeConfigHelper.java b/neoforge/src/main/java/de/cech12/solarcooker/platform/NeoForgeConfigHelper.java index 5bdb779..7e2109b 100644 --- a/neoforge/src/main/java/de/cech12/solarcooker/platform/NeoForgeConfigHelper.java +++ b/neoforge/src/main/java/de/cech12/solarcooker/platform/NeoForgeConfigHelper.java @@ -1,20 +1,13 @@ package de.cech12.solarcooker.platform; -import com.electronwill.nightconfig.core.file.CommentedFileConfig; -import com.electronwill.nightconfig.core.io.WritingMode; -import de.cech12.solarcooker.Constants; import de.cech12.solarcooker.platform.services.IConfigHelper; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.crafting.AbstractCookingRecipe; import net.minecraft.world.item.crafting.RecipeType; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.config.ModConfig; -import net.neoforged.fml.loading.FMLConfig; -import net.neoforged.fml.loading.FMLPaths; import net.neoforged.neoforge.common.ModConfigSpec; -import java.nio.file.Path; - /** * The config service implementation for Forge. */ @@ -57,10 +50,6 @@ public class NeoForgeConfigHelper implements IConfigHelper { @Override public void init() { ModLoadingContext.get().getActiveContainer().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG); - Path path = FMLPaths.GAMEDIR.get().resolve(FMLConfig.defaultConfigPath()).resolve(Constants.MOD_ID + "-server.toml"); - final CommentedFileConfig configData = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build(); - configData.load(); - SERVER_CONFIG.setConfig(configData); } @Override