Jump to content

[1.13.2] FMLCommonSetupEvent listener not always called if more than 1 mod is installed


Recommended Posts

Posted

When I play using more than 1 of my mods in either the live game or the dev environment, there's a significant chance that the function registered as a listener to FMLCommonSetupEvent by one or more of my mods will not get called at all during the initialization of the game. As you can imagine, this breaks a lot of functionality of my mods.


I know it's that these events aren't firing instead of some other bug in my code because I put println statements in both the constructor and the setup of my mods. The constructor print statement always fires, while the setup print statement sometimes fires and sometimes doesn't, if there is more than 1 mod installed.

 

One of my mod's main class:

Spoiler

package com.videogamesrock.darty.simpleEnchancements;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.simple.SimpleChannel;

import com.videogamesrock.darty.simpleEnchancements.network.PlayerBottleXPMessage;
import com.videogamesrock.darty.simpleEnchancements.network.PlayerUnBottleXPMessage;

@Mod(SimpleEnchancements.MODID)
public class SimpleEnchancements
{
    public static final String MODID = "simple_enchancements";
    public static final String NAME = "Simple Enchancements";
    public static final String VERSION = "1.1";
    public static Block ExperienceStand;
    public static Block ExperienceHopper;
    public static Item GoldBook;
    public static Item EnchantedGoldBook;
    public static SimpleEnchancements instance;
    public static SimpleChannel XPStandChannel;
    public static ResourceLocation DungeonLoot;
    public static ResourceLocation JungleLoot;
    public static ResourceLocation DesertLoot;
	private static final String PROTOCOL_VERSION = "xpstand";
    public static CommonProxy proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> CommonProxy::new);
    
    public SimpleEnchancements() {
    	instance = this;
    	FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
    	System.out.println("Setup registered");
    	
    	// Register the enqueueIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
        // Register the processIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
        // Register the doClientStuff method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);
        
        FMLJavaModLoadingContext.get().getModEventBus().register(new LoadingEvents());
		MinecraftForge.EVENT_BUS.register(new NormalEvents());
		
    	ExperienceStand = new BlockExperinceStand(Block.Properties.create(Material.IRON).hardnessAndResistance(0.5F).lightValue(1)).setRegistryName(MODID, "experience_stand");
    	GoldBook = new ItemGoldBook(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(MODID, "gold_book");
    	EnchantedGoldBook = new ItemEnchantedGoldBook(new Item.Properties()).setRegistryName(MODID, "enchanted_gold_book");
    	ExperienceHopper =new BlockExperinceHopper(Block.Properties.create(Material.IRON, MaterialColor.GOLD).hardnessAndResistance(3.0F, 4.8F).sound(SoundType.METAL)).setRegistryName(MODID,"experience_hopper");

    }
    
    private void setup(final FMLCommonSetupEvent event)
    {
    	System.out.println("Setup Called");
    	ResourceLocation l = new ResourceLocation(MODID, "xp_stand_buttons");
    	proxy.doSidedRegistry();
    	
    	XPStandChannel=NetworkRegistry.newSimpleChannel(l, () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals ,PROTOCOL_VERSION::equals);
    	XPStandChannel.registerMessage(0, PlayerBottleXPMessage.class, PlayerBottleXPMessage::encode, PlayerBottleXPMessage::decode,PlayerBottleXPMessage.Handler::handle);
    	XPStandChannel.registerMessage(1, PlayerUnBottleXPMessage.class, PlayerUnBottleXPMessage::encode, PlayerUnBottleXPMessage::decode,PlayerUnBottleXPMessage.Handler::handle);
    	    	
    	DungeonLoot=LootTableList.register(new ResourceLocation(MODID,"inject/simple_dungeon"));
    	JungleLoot=LootTableList.register(new ResourceLocation(MODID,"inject/jungle_temple"));
    	DesertLoot=LootTableList.register(new ResourceLocation(MODID,"inject/desert_temple"));
    	    	
    	//NetworkRegistry.INSTANCE.registerGuiHandler(this, new GUIHandler());
    }

    
    private void doClientStuff(final FMLClientSetupEvent event) {
       
       
    }

    private void enqueueIMC(final InterModEnqueueEvent event)
    {
       
    }

    private void processIMC(final InterModProcessEvent event)
    {
                
    }
}

 

The (non-debug) log from a session where both mod's didn't fire their setup event:

Spoiler

[25May2019 17:03:05.061] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Darty11, --version, 1.13.2-forge-25.0.214, --gameDir, C:\Users\TheChickenator\AppData\Roaming\.minecraft, --assetsDir, C:\Users\TheChickenator\AppData\Roaming\.minecraft/assets, --assetIndex, 1.13.1, --uuid, 79cd56e82263469a99c112a1d8775e69, --accessToken, ????????, --userType, mojang, --versionType, release, --launchTarget, fmlclient, --fml.forgeVersion, 25.0.214, --fml.mcVersion, 1.13.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20190213.203750]
[25May2019 17:03:05.065] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher starting: java version 1.8.0_51
[25May2019 17:03:05.461] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[25May2019 17:03:05.989] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmlclient' with arguments [--version, 1.13.2-forge-25.0.214, --gameDir, C:\Users\TheChickenator\AppData\Roaming\.minecraft, --assetsDir, C:\Users\TheChickenator\AppData\Roaming\.minecraft\assets, --username, Darty11, --assetIndex, 1.13.1, --uuid, 79cd56e82263469a99c112a1d8775e69, --accessToken, ????????, --userType, mojang, --versionType, release]
[25May2019 17:03:07.916] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Darty11
[25May2019 17:03:14.858] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[25May2019 17:03:14.876] [Client thread/INFO] [net.minecraft.client.Minecraft/]: LWJGL Version: 3.1.6 build 14
[25May2019 17:03:17.135] [Client thread/INFO] [net.minecraftforge.fml.ModLoader/CORE]: Loading Network data for FML net version: FML2
[25May2019 17:03:17.223] [modloading-worker-11/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 25.0.214, for MC 1.13.2 with MCP 20190213.203750
[25May2019 17:03:17.224] [modloading-worker-11/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v25.0.214 Initialized
[25May2019 17:03:17.233] [modloading-worker-4/INFO] [STDOUT/]: [com.videogamesrock.darty.automatic_crafting_table_darty.AutomaticCraftingTableBase:<init>:56]: Setup registered
[25May2019 17:03:17.233] [modloading-worker-9/INFO] [STDOUT/]: [com.videogamesrock.darty.simpleEnchancements.SimpleEnchancements:<init>:46]: Setup registered
[25May2019 17:03:17.444] [Client thread/INFO] [STDOUT/]: [com.videogamesrock.darty.automatic_crafting_table_darty.LoadingEvents:registerBlocks:27]: Registered Blocks
[25May2019 17:03:17.446] [Client thread/INFO] [STDOUT/]: [com.videogamesrock.darty.automatic_crafting_table_darty.LoadingEvents:registerItems:37]: Registered Items
[25May2019 17:03:17.455] [Client thread/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity nether_sentinel
[25May2019 17:03:17.458] [Client thread/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity arrow_golem
[25May2019 17:03:17.503] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[25May2019 17:03:17.865] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[25May2019 17:03:17.882] [Client thread/INFO] [STDOUT/]: [com.videogamesrock.darty.automatic_crafting_table_darty.LoadingEvents:registerRenders:66]: Registered Models
[25May2019 17:03:17.955] [Client thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: automatic_crafting_table_darty-3.0.jar, enhanced_loot-1.0.jar, forge-1.13.2-25.0.214-universal.jar, simple_enchancements-1.1.jar, Default
[25May2019 17:03:18.815] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: BETA_OUTDATED Current: 25.0.214 Target: 25.0.215
[25May2019 17:03:28.992] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/]: Starting up SoundSystem version 201809301515...
[25May2019 17:03:29.198] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: Initializing No Sound
[25May2019 17:03:29.198] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: (Silent Mode)
[25May2019 17:03:29.429] [Thread-5/INFO] [net.minecraft.client.audio.SoundManager/]: OpenAL initialized.
[25May2019 17:03:29.595] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Preloading sound minecraft:sounds/ambient/underwater/underwater_ambience.ogg
[25May2019 17:03:29.598] [Sound Library Loader/INFO] [net.minecraft.client.audio.SoundManager/SOUNDS]: Sound engine started
[25May2019 17:03:33.264] [Client thread/WARN] [net.minecraft.client.renderer.model.ModelBakery/]: Exception loading blockstate definition: 'automatic_crafting_table_darty:blockstates/auto_crafting_table.json' in resourcepack: 'automatic_crafting_table_darty-3.0.jar' for variant: 'inventory': Unknown blockstate property: 'inventory'
[25May2019 17:03:33.264] [Client thread/WARN] [net.minecraft.client.renderer.model.ModelBakery/]: Exception loading blockstate definition: 'automatic_crafting_table_darty:blockstates/auto_crafting_table.json' in resourcepack: 'automatic_crafting_table_darty-3.0.jar' for variant: 'normal': Unknown blockstate property: 'normal'
[25May2019 17:03:34.543] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Max texture size: 16384
[25May2019 17:03:36.732] [Client thread/INFO] [net.minecraft.client.renderer.texture.TextureMap/]: Created: 512x512 textures-atlas
[25May2019 17:03:38.290] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[25May2019 17:03:38.357] [Client thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
[25May2019 17:03:46.426] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[25May2019 17:03:46.428] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[25May2019 17:03:46.430] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[25May2019 17:03:46.431] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[25May2019 17:03:46.432] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[25May2019 17:03:46.534] [Client thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 0 recipes
[25May2019 17:03:46.539] [Client thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 0 advancements
[25May2019 17:03:46.569] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Starting integrated minecraft server version 1.13.2
[25May2019 17:03:46.570] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Generating keypair
[25May2019 17:03:46.662] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[25May2019 17:03:46.690] [Server thread/INFO] [net.minecraftforge.registries.GameData/REGISTRIES]: Injecting existing registry data into this SERVER instance
[25May2019 17:03:46.874] [Server thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: simple_enchancements-1.1.jar, forge-1.13.2-25.0.214-universal.jar, enhanced_loot-1.0.jar, automatic_crafting_table_darty-3.0.jar, Default
[25May2019 17:03:47.700] [Server thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 531 recipes
[25May2019 17:03:48.580] [Server thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 574 advancements
[25May2019 17:03:48.771] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld
[25May2019 17:03:48.987] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 4%
[25May2019 17:03:49.019] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 8%
[25May2019 17:03:49.034] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 12%
[25May2019 17:03:49.055] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 16%
[25May2019 17:03:49.081] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 20%
[25May2019 17:03:49.099] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 24%
[25May2019 17:03:49.114] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 28%
[25May2019 17:03:49.163] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 32%
[25May2019 17:03:49.180] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 36%
[25May2019 17:03:49.204] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 40%
[25May2019 17:03:49.269] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 44%
[25May2019 17:03:49.326] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 48%
[25May2019 17:03:49.458] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 52%
[25May2019 17:03:49.491] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 56%
[25May2019 17:03:49.513] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 60%
[25May2019 17:03:49.548] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 64%
[25May2019 17:03:49.630] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 68%
[25May2019 17:03:49.653] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 72%
[25May2019 17:03:49.674] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 76%
[25May2019 17:03:49.699] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 80%
[25May2019 17:03:49.724] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 84%
[25May2019 17:03:49.748] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 88%
[25May2019 17:03:49.767] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 92%
[25May2019 17:03:49.793] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 96%
[25May2019 17:03:49.809] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing spawn area: 100%
[25May2019 17:03:49.810] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Time elapsed: 1038 ms
[25May2019 17:03:50.448] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Changing view distance to 29, from 10
[25May2019 17:03:52.996] [Netty Local Client IO #0/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server.
[25May2019 17:03:53.221] [Server thread/INFO] [net.minecraft.server.management.PlayerList/]: Darty11[local:E:de0e5332] logged in with entity id 169 at (73.66202496644591, 59.489259791894575, 10.873142408569095)
[25May2019 17:03:53.251] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Darty11 joined the game
[25May2019 17:03:58.275] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 5250ms or 105 ticks behind
[25May2019 17:03:58.275] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[25May2019 17:03:58.307] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'New World'/minecraft:overworld
[25May2019 17:04:00.797] [Client thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 175 advancements
[25May2019 17:05:51.925] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[25May2019 17:05:51.960] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'New World'/minecraft:overworld
[25May2019 17:05:52.552] [Server thread/INFO] [net.minecraft.network.NetHandlerPlayServer/]: Darty11 lost connection: Disconnected
[25May2019 17:05:52.553] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Darty11 left the game
[25May2019 17:05:54.013] [Server thread/INFO] [net.minecraft.network.NetHandlerPlayServer/]: Stopping singleplayer server as player logged out
[25May2019 17:05:54.020] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server
[25May2019 17:05:54.020] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving players
[25May2019 17:05:54.020] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds
[25May2019 17:05:54.021] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'New World'/minecraft:overworld
[25May2019 17:05:54.285] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Stopping!
[25May2019 17:05:55.156] [Client thread/INFO] [net.minecraft.client.audio.SoundManager/]: SoundSystem shutting down...
[25May2019 17:05:55.371] [Client thread/INFO] [net.minecraft.client.audio.SoundManager/]: SoundSystem Author: Paul Lamb, www.paulscode.com

 

The debug log is attached below.

debug.zip

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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