diff --git a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java index e94344a4..1380cf07 100644 --- a/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java +++ b/src/main/java/com/nomiceu/nomilabs/config/LabsConfig.java @@ -202,15 +202,14 @@ public static class Advanced { @Config.LangKey("config.nomilabs.advanced.disable_xp_scaling") public boolean disableXpScaling = false; - @Config.Comment({"Whether to enable data fixes.", + @Config.Comment({"Whether to enable Nomi-CEu data fixes.", "This is used for Nomi-CEu, for players coming from before core-mod.", "If this mod is being used in other scenarios, leave this at false, as this may break worlds!", "If this is in a Nomi-CEu environment, make sure it is true, and do not change it, or items/blocks may be lost!", - "This may be used in the future as well, and your world will not be fixed if it is up-to-date.", "[default: false]"}) - @Config.LangKey("config.nomilabs.advanced.enable_data_fixes") + @Config.LangKey("config.nomilabs.advanced.enable_nomi_ceu_data_fixes") @Config.RequiresMcRestart - public boolean enableDataFixes = false; + public boolean enableNomiCEuDataFixes = false; @Config.Comment({"List of Regex Patterns to ignore if they are included in the ITEM missing registry list.", "Do not change unless you know what you are doing!", diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java index f4ae5687..fe64d395 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/DataFixerHandler.java @@ -2,7 +2,6 @@ import com.nomiceu.nomilabs.LabsValues; import com.nomiceu.nomilabs.NomiLabs; -import com.nomiceu.nomilabs.config.LabsConfig; import com.nomiceu.nomilabs.remap.LabsRemapHelper; import com.nomiceu.nomilabs.remap.datafixer.fixes.BlockFixer; import com.nomiceu.nomilabs.remap.datafixer.fixes.TileEntityFixer; @@ -53,8 +52,6 @@ public class DataFixerHandler { public static Map blockIdToRlMap; public static void preInit() { - if (!LabsConfig.advanced.enableDataFixes) return; - CompoundDataFixer fmlFixer = FMLCommonHandler.instance().getDataFixer(); var itemWalker = new ItemStackWalker(); @@ -74,13 +71,6 @@ public static void preInit() { } public static void onWorldLoad(SaveHandler save) { - if (!LabsConfig.advanced.enableDataFixes) { - checked = true; - modeNeeded = false; - worldSavedData = null; - NomiLabs.LOGGER.info("Skipping Data Fixers, due to config..."); - return; - } checked = false; modeNeeded = false; NomiLabs.LOGGER.info("Checking Data Fixers..."); diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java index 53cb32a0..98d1bb14 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsFixes.java @@ -54,10 +54,14 @@ public class LabsFixes { public static final int PRE_MATERIAL_REWORK_VERSION = 1; /** - * Default version, used if save doesn't have a fix version, or if something goes wrong + * Default version, used if save doesn't have a fix version, or if something goes wrong. */ public static final int DEFAULT_VERSION = 0; + /** + * Default Nomi-CEu version, used if save doesn't have a fix version, or if something goes wrong, and Nomi-CEu Specific Data Fixes are enabled. + */ + public static final int DEFAULT_NOMI_CEU_VERSION = -1; public static List itemFixes; @@ -139,7 +143,7 @@ public static void init() { new DataFix.ItemFix("Old Multiblock Metadata Remap", "Remaps old Multiblock Metadata to the new format.", true, - (version) -> version <= DEFAULT_VERSION, + (version) -> version <= DEFAULT_NOMI_CEU_VERSION, (modList) -> true, (stack) -> stack.rl.equals(new ResourceLocation(GREGTECH_MODID,"machine")) && multiblockMetaRemap.containsKey(stack.meta), (stack) -> stack.setMeta(multiblockMetaRemap.get(stack.meta))) @@ -246,7 +250,7 @@ public static void init() { new DataFix.TileEntityFix("Multiblock Tile Entity MetaId Remap", "Remaps old Multiblock Tile Entity Names to the new format.", false, - (version) -> version <= DEFAULT_VERSION, + (version) -> version <= DEFAULT_NOMI_CEU_VERSION, (modList) -> true, (compound) -> compound.hasKey("MetaId", Constants.NBT.TAG_STRING) && compound.hasKey("id", Constants.NBT.TAG_STRING) && compound.getString("id").equals(new ResourceLocation(LabsValues.GREGTECH_MODID, "machine").toString()) && diff --git a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsWorldFixData.java b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsWorldFixData.java index 71fb05c4..798ff06b 100644 --- a/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsWorldFixData.java +++ b/src/main/java/com/nomiceu/nomilabs/remap/datafixer/LabsWorldFixData.java @@ -1,6 +1,7 @@ package com.nomiceu.nomilabs.remap.datafixer; import com.nomiceu.nomilabs.NomiLabs; +import com.nomiceu.nomilabs.config.LabsConfig; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.storage.WorldSavedData; @@ -14,7 +15,7 @@ public class LabsWorldFixData extends WorldSavedData { // Fix Version stored in this world. - public int savedVersion = LabsFixes.DEFAULT_VERSION; + public int savedVersion; // Base Data Key public static final String BASE_DATA_KEY = "data"; @@ -24,6 +25,8 @@ public class LabsWorldFixData extends WorldSavedData { public LabsWorldFixData() { super(LabsFixes.DATA_NAME); + if (LabsConfig.advanced.enableNomiCEuDataFixes) savedVersion = LabsFixes.DEFAULT_NOMI_CEU_VERSION; + else savedVersion = LabsFixes.DEFAULT_VERSION; } @Override diff --git a/src/main/resources/assets/nomilabs/lang/en_us.lang b/src/main/resources/assets/nomilabs/lang/en_us.lang index f0de3f85..3dc2e0c4 100644 --- a/src/main/resources/assets/nomilabs/lang/en_us.lang +++ b/src/main/resources/assets/nomilabs/lang/en_us.lang @@ -41,7 +41,7 @@ config.nomilabs.mod_integration.draconicevolution.auto_destructor_speed=Auto Des config.nomilabs.advanced=Advanced Settings config.nomilabs.advanced.allow_other_modes=Allow Other Modes config.nomilabs.advanced.disable_xp_scaling=Disable Anvil XP Scaling -config.nomilabs.advanced.enable_data_fixes=Enable Data Fixes +config.nomilabs.advanced.enable_nomi_ceu_data_fixes=Enable Nomi-CEu Specific Data Fixes config.nomilabs.advanced.ignore_items=ITEM Missing Registry Ignore List config.nomilabs.advanced.ignore_blocks=BLOCK Missing Registry Ignore List config.nomilabs.advanced.ignore_entities=ENTITY Missing Registry Ignore List