diff --git a/Forge/src/main/java/at/petrak/hexcasting/forge/mixin/ForgeMixinDatagenModLoader.java b/Forge/src/main/java/at/petrak/hexcasting/forge/mixin/ForgeMixinDatagenModLoader.java deleted file mode 100644 index b3cfea1a09..0000000000 --- a/Forge/src/main/java/at/petrak/hexcasting/forge/mixin/ForgeMixinDatagenModLoader.java +++ /dev/null @@ -1,61 +0,0 @@ -package at.petrak.hexcasting.forge.mixin; - -import net.minecraft.Util; -import net.minecraft.core.HolderLookup; -import net.minecraft.data.registries.VanillaRegistries; -import net.minecraft.server.Bootstrap; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.data.event.GatherDataEvent; -import net.minecraftforge.data.loading.DatagenModLoader; -import net.minecraftforge.fml.ModLoader; -import net.minecraftforge.fml.ModWorkManager; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -import java.io.File; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -@Mixin(DatagenModLoader.class) -public abstract class ForgeMixinDatagenModLoader { - @Shadow(remap = false) @Final - private static Logger LOGGER; - - @Shadow(remap = false) - private static GatherDataEvent.DataGeneratorConfig dataGeneratorConfig; - @Shadow(remap = false) - private static ExistingFileHelper existingFileHelper; - @Shadow(remap = false) - private static boolean runningDataGen; - - /** - * Make it so non-vanilla registries can actually be tagged. - */ - @Overwrite(remap = false) - public static void begin(final Set mods, final Path path, final Collection inputs, Collection existingPacks, - Set existingMods, final boolean serverGenerators, final boolean clientGenerators, final boolean devToolGenerators, final boolean reportsGenerator, - final boolean structureValidator, final boolean flat, final String assetIndex, final File assetsDir) { - if (mods.contains("minecraft") && mods.size() == 1) - return; - LOGGER.info("Initializing Data Gatherer for mods {}", mods); - runningDataGen = true; - Bootstrap.bootStrap(); - ModLoader.get().gatherAndInitializeMods(ModWorkManager.syncExecutor(), ModWorkManager.parallelExecutor(), ()->{}); - if (!mods.contains("forge")) { - // If we aren't generating data for forge, automatically add forge as an existing so mods can access forge's data - existingMods.add("forge"); - } - CompletableFuture lookupProvider = CompletableFuture.supplyAsync(VanillaRegistries::createLookup, Util.backgroundExecutor()); - dataGeneratorConfig = new GatherDataEvent.DataGeneratorConfig(mods, path, inputs, lookupProvider, serverGenerators, - clientGenerators, devToolGenerators, reportsGenerator, structureValidator, flat); - existingFileHelper = new ExistingFileHelper(existingPacks, existingMods, structureValidator, assetIndex, assetsDir); - ModLoader.get().runEventGenerator(mc -> new GatherDataEvent(mc, dataGeneratorConfig.makeGenerator(p -> dataGeneratorConfig.isFlat() ? p : p.resolve(mc.getModId()), - dataGeneratorConfig.getMods().contains(mc.getModId())), dataGeneratorConfig, existingFileHelper)); - dataGeneratorConfig.runAll(); - } -} diff --git a/Forge/src/main/resources/hexcasting_forge.mixins.json b/Forge/src/main/resources/hexcasting_forge.mixins.json index fec29c0762..3a50c75493 100644 --- a/Forge/src/main/resources/hexcasting_forge.mixins.json +++ b/Forge/src/main/resources/hexcasting_forge.mixins.json @@ -7,7 +7,6 @@ "mixins": [ "ForgeAccessorBuiltInRegistries", "ForgeMixinCursedRecipeSerializerBase", - "ForgeMixinDatagenModLoader", "ForgeMixinTagsProvider" ], "client": [