Jump to content

[1.11]Making Ore gen causes freeze on world loading {FIXED}


Vitro Static

Recommended Posts

Okay so when I start my game everything loads good with FML, the only problem is when I create a world to see if the ore gen is working, there is no crash it just freezes and the console says:

 

 

"The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded."

 

 

This is where I register the world (inside my main mod file)

 

 

@EventHandler

public void preInit(FMLPreInitializationEvent event)

{

proxy.preInit(event);

logger = event.getModLog();

GameRegistry.registerWorldGenerator(new UtopiaWorldGenerator(), 3);

}

 

 

 

 

Here is the UtopiaWorldGenerator file:

 

 

package com.utopia.world;

 

import java.util.Random;

 

import com.utopia.init.UtopiaBlocks;

 

import net.minecraft.block.state.IBlockState;

import net.minecraft.util.math.BlockPos;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkGenerator;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

import net.minecraftforge.fml.common.IWorldGenerator;

 

public class UtopiaWorldGenerator implements IWorldGenerator

{

 

@Override

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)

{

if (world.provider.getDimension() == 0)

 

{ // Overworld

generateOverworld(random, chunkX, chunkZ, world, chunkGenerator, chunkProvider);

}

}

 

private void generateOverworld(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)

{

generateOre(UtopiaBlocks.obsidian_ore.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, 1, 16, 4 + random.nextInt(4), 1);

}

 

 

private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances)

{

int deltaY = maxY - minY;

 

for (int i = 0; i < chances; i++)

{

BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));

 

WorldGenMinable generator = new WorldGenMinable(ore, size);

generator.generate(world, random, pos);

}

}

}

 

 

Link to comment
Share on other sites

"The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded."

 

We need that said error, look in your run folder>crashreports.

 

That was the problem tho there where no crash reports being made, I have since fixed the issue and I am closing this post now, thank you for the offer to help tho!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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