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.

Forge keeps crashing because of an innocent piece of code and won't tell me why

Featured Replies

Posted

Hey everyone, I've been working on a block that basically shares its liquid level by averaging with adjacent blocks. This is done with a LiquidMetalMix object that keeps track of all this. This isn't the important part though, the problem is that forge is constantly crashing because of one line of code that is just like anything else and the error it's giving me says it is not recoverable.

 

Heres the error

2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue
2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] 
mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Geology [Geology] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-05-14 18:32:42 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-05-14 18:32:42 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-05-14 18:32:42 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:799)
2013-05-14 18:32:42 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:470)
2013-05-14 18:32:42 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530)
2013-05-14 18:32:42 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

I've been toying around with it for about half an hour now and can't come up with anything. If you guys have any idea what the issue even is then please tell me. Thanks! Heres the code that's causing problems, if you need anything else just tell me.

 

// set this and all adjacent vats liquid level to the average
public void balanceLiquids(){

	int numOfAdjacentVats = 1;
	List<LiquidMetalMix> mixtures = new ArrayList<LiquidMetalMix>();
	List<Integer> xCoords = new ArrayList<Integer>();
	List<Integer> zCoords = new ArrayList<Integer>();

	mixtures.add(mixture);

	// loop through surrounding blocks
	for (int xx = -1; xx < 2; xx++){
		for (int zz = -1; zz < 2; zz++){

			// if its checking itself or a corner
			if (Math.abs(xx) == Math.abs(zz)){
				//continue;
			}
			else {
				// coordinates currently being checked
				int x = xCoord + xx;
				int y = yCoord;
				int z = zCoord + zz;

				// if a vat is adjacent
				if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenVat.blockID ||
					worldObj.getBlockId(x, y, z) == Geology.blockIngotMold.blockID){
					// get the TE at that location
					TileEntityMoltenVat te = (TileEntityMoltenVat)worldObj.getBlockTileEntity(x, y, z);
					mixtures.add(te.mixture);
					numOfAdjacentVats++;
					xCoords.add(xx);
					zCoords.add(zz);
				} else if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenValve.blockID){ // a valve instead
					// get the TE at that location
					TileEntityMoltenValve te = (TileEntityMoltenValve)worldObj.getBlockTileEntity(x, y, z);
					if (te.canFlow){
						mixtures.add(te.mixture);
						numOfAdjacentVats++;
						xCoords.add(xx);
						zCoords.add(zz);
					}
				}
			}
		}
	}
	// average out the new mixtures
	// set this mixture to the new mix
	// the static method returns a new LiquidMetalMix object that averaged all the mixture together
	LiquidMetalMix newMix = LiquidMetalMix.combineMixtures(mixtures, numOfAdjacentVats);
	// I have no problems setting the new mixture to this objects mixture
	mixture = newMix;
	// distribute the new mix
	for (int xx = -1; xx < 2; xx++){
		for (int zz = -1; zz < 2; zz++){

			// if its checking itself or a corner
			if (Math.abs(xx) == Math.abs(zz)){
				//continue;
			}
			else {
				// coordinates currently being checked
				int x = xCoord + xx;
				int y = yCoord;
				int z = zCoord + zz;

				// if a vat is adjacent
				if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenVat.blockID ||
					worldObj.getBlockId(x, y, z) == Geology.blockIngotMold.blockID){
					// get the TE at that location
					TileEntityMoltenVat te = (TileEntityMoltenVat)worldObj.getBlockTileEntity(x, y, z);
					// but as soon as i try to set another molten vat to the new mixture, i get the wierd error
					te.mixture = newMix; // commenting this one line out makes minecraft run fine
				} else if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenValve.blockID){ // a valve instead
					// get the TE at that location
					TileEntityMoltenValve te = (TileEntityMoltenValve)worldObj.getBlockTileEntity(x, y, z);
					if (te.canFlow){
						//te.mixture = new LiquidMetalMix(8000);
					}
				}
			}
		}
	} 
}

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.