Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey, I'm new to the forge data generators and was trying to get them up and running. At the moments they aren't crashing or anything but they also don't seem to be generating any data, as far as I can tell they're set up correctly and I've tried both runClient and runData and as far as I can tell they neither loaded the models correctly into the game nor output them in any files I can see. I have no real idea what I'm doing though.

so I have my main data generator class that looks a bit like this:

@Mod.EventBusSubscriber(modid = GaiaTerrainMod.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class GaiaDataManager {

	@SubscribeEvent public static void gatherData(final GatherDataEvent event) {
		GaiaTerrainMod.LOGGER.info("gathering data!");
		DataGenerator generate = event.getGenerator();
		ExistingFileHelper existingFileHelper = event.getExistingFileHelper();

		generate.addProvider(new GaiaBlockStateGenerator(generate,existingFileHelper));
		generate.addProvider(new GaiaItemModelGenerator(generate, existingFileHelper));

		GaiaBlockTagGenerator blockTags = new GaiaBlockTagGenerator(generate, existingFileHelper);
		generate.addProvider(blockTags);
		generate.addProvider(new GaiaItemTagGenerator(generate, blockTags, existingFileHelper));

		generate.addProvider(new GaiaLootTableGenerator(generate));
		generate.addProvider(new GaiaRecipeGenerator(generate));
		GaiaTerrainMod.LOGGER.info("gathered data!");
	}
}

originally it didn't have the "@Mod.EventBusSubscriber(modid = GaiaTerrainM..." line at the top and instead was only invoked through a line in the GaiaTerrainMod constructor that looked like this:

public GaiaTerrainMod() {
    IEventBus registry_bus = FMLJavaModLoadingContext.get().getModEventBus();
    registry_bus.addListener(this::setup);

    MinecraftForge.EVENT_BUS.register(this);
    MinecraftForge.EVENT_BUS.register(GaiaDataManager.class);

    ModWoodTypes.init();

    ModBlocks.BLOCKS.register(registry_bus);
    ModItems.ITEMS.register(registry_bus);
    GaiaBiomeSelector.initBiomeMappings();
}

as you can see at the start and end of my gatherData function I have logs and when I hit "runData" they fired and I could see them as the last 2 things outputted by the console, however in GaiaBlockStateGenerator, the first data provider added to my data generator, I also put 2 logs at the start and end of the overriden registerStatesAndModels() function. These never fired, I assume they should after my gatherData logs fired. Not sure though,

as far as i can tell the issue should be somewhere in these files (unless it's somewhere weird), again I'm not getting any crashes or errors just a plain old, doesn't do the thing I want it to which clearly indicates I've done something dumb somewhere.

Did you remember to change all instances of examplemod to your mod id within build.gradle? There is an argument within the data run configuration that specifies the mods to generate data for. If your mod id is not specified there, then no data will be generated.

When you do your data run do you see "Initializing Data Gatherer for mods [examplemod]" in the logs, rather than [yourmodid]? If so, your run configurations are still wrong. Check to see if you have "--mod examplemod" in your IDE's run configs menu, and if you can't get it to update with gradle you can always change the --mod argument manually in your IDE.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.