Jump to content

Recommended Posts

Posted

Hello guys! I am currently coding a mod with a lot of new biomes, but I cannot find them! I register every biome like this:

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    
    BiomeDictionary.registerBiomeType(exampleForest, Type.FOREST);
    BiomeManager.addSpawnBiome(exampleForest);
    	
}

Do I register them correctly?

(I am using MinecraftForge 1.8-11.14.2.1427)

Posted

That brings back memories...

 

I used BiomeManager.addBiome() in 1.8

I THINK that addSpawnBiome only means that it is possible that the world spawn is inside the specified Biome.

  • Like 1

Here could be your advertisement!

Posted
3 minutes ago, Jacky2611 said:

That brings back memories...

 

I used BiomeManager.addBiome() in 1.8

I THINK that addSpawnBiome only means that it is possible that the world spawn is inside the specified Biome.

Is there any way to see if my biome has been spawned?

Posted

It might be WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random)

 

BiomeProvider might be a renamed WorldChunkManager in 1.9.

  • Like 1

Here could be your advertisement!

Posted
Just now, Jacky2611 said:

It might be WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random)

 

BiomeProvider might be a renamed WorldChunkManager in 1.9.

Hey, whenever I register my biome with BiomeManager.addBiome, the Minecraft world doesn't start!

Posted

When I start a new world with that line of code it prints this:

[18:53:16] [Server thread/INFO]: Starting integrated minecraft server version 1.8
[18:53:16] [Server thread/INFO]: Generating keypair
[18:53:16] [Server thread/INFO]: Converting map!
[18:53:16] [Server thread/INFO]: Scanning folders...
[18:53:16] [Server thread/INFO]: Total conversion count is 0
[18:53:16] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[18:53:16] [Server thread/INFO] [FML]: Applying holder lookups
[18:53:16] [Server thread/INFO] [FML]: Holder lookups applied
[18:53:16] [Server thread/INFO] [FML]: Loading dimension 0 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f)
[18:53:17] [Server thread/INFO] [FML]: Loading dimension 1 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f)
[18:53:17] [Server thread/INFO] [FML]: Loading dimension -1 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f)
[18:53:17] [Server thread/INFO]: Preparing start region for level 0
[18:53:18] [Server thread/INFO]: Preparing spawn area: 6%
[18:53:19] [Server thread/INFO]: Preparing spawn area: 10%
[18:53:20] [Server thread/INFO]: Preparing spawn area: 14%
[18:53:21] [Server thread/INFO]: Preparing spawn area: 20%
[18:53:22] [Server thread/INFO]: Preparing spawn area: 27%
[18:53:23] [Server thread/INFO]: Preparing spawn area: 35%
[18:53:24] [Server thread/INFO]: Preparing spawn area: 44%
[18:53:25] [Server thread/INFO]: Preparing spawn area: 54%
[18:53:26] [Server thread/INFO]: Preparing spawn area: 64%
[18:53:27] [Server thread/INFO]: Preparing spawn area: 75%

And it stops at 75%

 

My Code:

Biome Class:

Spoiler

public class BiomeGenWoods extends BiomeGenBase {

	public BiomeGenWoods(int par1)
	{
		super(par1);
		this.spawnableCreatureList.clear();
		this.topBlock = Blocks.grass.getDefaultState();
		this.fillerBlock = Blocks.dirt.getDefaultState();
		this.spawnableCreatureList.clear();
		this.spawnableMonsterList.clear();
		this.spawnableWaterCreatureList.clear();
		
		
		this.setHeight(height_LowPlains);
		
		
		
	}

	@Override
	public void decorate(World par1World, Random par2Random, BlockPos pos)
	{
		super.decorate(par1World, par2Random, pos);

		for(int i = 0; i < par2Random.nextInt(30); i++) {
			int x = par2Random.nextInt(16) + 8;
			int z = par2Random.nextInt(16) + 8;
			int y = par2Random.nextInt(par1World.getHorizon(pos.add(x, 0, z)).getY() + 32);
			
			WorldGenDiamondTree worldGenDiamondTree = new WorldGenDiamondTree();
			worldGenDiamondTree.generate(par1World, par2Random, pos.add(x,y,z));
			
		
		}
	}

	
	
}

 

Diamond Tree Class:

Spoiler

public class WorldGenDiamondTree extends WorldGenerator{
	
	int height;
	IBlockState wood = Blocks.diamond_block.getDefaultState();
	IBlockState leaf = Blocks.emerald_block.getDefaultState();

	public boolean generate(World world, Random random, BlockPos pos)
	{
	
			while (world.isAirBlock(pos.down()) && pos.getY() > 55)
			{
				pos.subtract(new Vec3i(0, 1, 0));
			}
			if (!world.isAirBlock(pos))
				return false;

			height = 5 + random.nextInt(5);

			for (int i = 0; i < height; i++)
			{
				world.setBlockState(pos.up(i), wood);
			}

			int top = 1 + random.nextInt(3);

			int left = 2 + random.nextInt(3);
			int right = 2 + random.nextInt(3);
			int front = 2 + random.nextInt(3);
			int back = 2 + random.nextInt(3);

			for (int i = 0; i < top; i++)
			{
				setBlock(world, pos.getX(), pos.getY() + i, pos.getZ(), wood);

				if (i > 0)
				{
					setBlock(world, pos.getX() + 1, pos.getY() + i, pos.getZ(), leaf);
					setBlock(world, pos.getX() - 1, pos.getY() + i, pos.getZ(), leaf);
					setBlock(world, pos.getX(), pos.getY() + i, pos.getZ() + 1, leaf);
					setBlock(world, pos.getX(), pos.getY() + i, pos.getZ() - 1, leaf);
					setBlock(world, pos.getX(), pos.getY() + i + 1, pos.getZ(), leaf);
				}
			}

			for (int i = 0; i < left; i++)
			{
				setBlock(world, pos.getX() + i, pos.getY(), pos.getZ(), wood);
				setBlock(world, pos.getX() + i, pos.getY() + 1, pos.getZ(), leaf);
				if (i > 0)
				{
					setBlock(world, pos.getX() + i, pos.getY(), pos.getZ() + 1, leaf);
					setBlock(world, pos.getX() + i, pos.getY(), pos.getZ() - 1, leaf);
				}
			}
			for (int i = 0; i < right; i++)
			{
				setBlock(world, pos.getX() - i, pos.getY(), pos.getZ(), wood);
				setBlock(world, pos.getX() - i, pos.getY() + 1, pos.getZ(), leaf);
				if (i > 0)
				{
					setBlock(world, pos.getX() - i, pos.getY(), pos.getZ() + 1, leaf);
					setBlock(world, pos.getX() - i, pos.getY(), pos.getZ() - 1, leaf);
				}
			}
			for (int i = 0; i < front; i++)
			{
				setBlock(world, pos.getX(), pos.getY(), pos.getZ() + i, wood);
				setBlock(world, pos.getX(), pos.getY() + 1, pos.getZ() + i, leaf);
				if (i > 0)
				{
					setBlock(world, pos.getX() - 1, pos.getY(), pos.getZ() + i, leaf);
					setBlock(world, pos.getX() + 1, pos.getY(), pos.getZ() + i, leaf);
				}
			}
			for (int i = 0; i < back; i++)
			{
				setBlock(world, pos.getX(), pos.getY(), pos.getZ() - i, wood);
				setBlock(world, pos.getX(), pos.getY() + 1, pos.getZ() - i, leaf);
				if (i > 0)
				{
					setBlock(world, pos.getX() - 1, pos.getY(), pos.getZ() - i, leaf);
					setBlock(world, pos.getX() + 1, pos.getY(), pos.getZ() - i, leaf);
				}
			}

			setBlock(world, pos.getX() + left, pos.getY(), pos.getZ(), leaf);
			setBlock(world, pos.getX() - right, pos.getY(), pos.getZ(), leaf);
			setBlock(world, pos.getX(), pos.getY(), pos.getZ() + front, leaf);
			setBlock(world, pos.getX(), pos.getY(), pos.getZ() - back, leaf);

			return true;
	
	}

	public void setBlock(World world, int x, int y, int z, IBlockState block)
	{
		world.setBlockState(new BlockPos(x, y + height, z), block);
	}
}

 

Main Class(register code):

Spoiler

public static BiomeGenBase diamondWoods = new BiomeGenWoods(52).setBiomeName("DiamondWoods");

@EventHandler
    public void preInit(FMLPreInitializationEvent event) {

    //	BiomeDictionary.registerBiomeType(diamondWoods, Type.FOREST);
    //	BiomeManager.addSpawnBiome(diamondWoods);
    
    	BiomeManager.addBiome(BiomeType.COOL, new BiomeEntry(diamondWoods, 10));

    }

 

 

Posted
1 minute ago, Arionas_MC said:

When I start a new world with that line of code it prints this:

Good news your Biome is generating. Bad news you are generating to many trees.

 

2 minutes ago, Arionas_MC said:

for(int i = 0; i < par2Random.nextInt(30); i++) {

30 possible trees per chunk is a little to much.

  • Like 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
2 minutes ago, Animefan8888 said:

Good news your Biome is generating. Bad news you are generating to many trees.

 

30 possible trees per chunk is a little to much.

Thanks, the world starts now! But I cannot find my biome again!:(

Posted
1 minute ago, Arionas_MC said:

Thanks, the world starts now! But I cannot find my biome again!:(

In your decorate method print out the BlockPos argument to find the position.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
Just now, Arionas_MC said:

When does it print the position?

What do you mean? If you do System.out.println(pos) it will print out the BlockPos and you will have coordinates for where your Biome is being decorated.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

It will print the position whenever your biome get decorated.

 

However, that would require your biome to be generated first. I would instead somehow (e.g. on item right click) run WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random) and print the result. If this really is the findBiome function it should work even if your biome hasn't been generated yet. Just make sure that the range is big enough.

Edited by Jacky2611
  • Like 1

Here could be your advertisement!

Posted
1 minute ago, Animefan8888 said:

What do you mean? If you do System.out.println(pos) it will print out the BlockPos and you will have coordinates for where your Biome is being decorated.

Well after 5 minutes of exploring the world, it printed the position but Minecraft stopped responding!

Posted (edited)

Your biome might still be taking up too many resources. How much power does your device have and how much are you generating?

Can you give us a github link?

Edited by Jacky2611
  • Like 1

Here could be your advertisement!

Posted
3 minutes ago, Jacky2611 said:

Your biome might still be taking up too many resources. How much power does your device have and how much are you generating?

[19:14:25] [Client thread/INFO] [STDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 7/18/17 7:14 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.8
	Operating System: Windows 7 (amd64) version 6.1
	Java Version: 1.8.0_77, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 719523512 bytes (686 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 361.43' Renderer: 'GeForce GTS 450/PCIe/SSE2'

 

Posted (edited)
4 minutes ago, Arionas_MC said:

I changed the number of trees which are being generated from random.nextInt(30) to random.nextInt(7)+1

How big are your trees? If they are near vanilla size you shouldn't be generating much more than 3-4 per chunk, also there is Runaway Chunk Generation. Which is a huge problem in world gen. If your generation passes over into another chunk then that chunk will be forced to generate and so on and so forth if it is your Biome it will call your decorate method and lead to more chunks being loaded.

 

Edit: You will want to apply an offset to your generation so it doesn't load other chunks.

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
1 minute ago, Animefan8888 said:

How big are your trees? If they are near vanilla size you shouldn't be generating much more than 3-4 per chunk, also there is Runaway Chunk Generation. Which is a huge problem in world gen. If your generation passes over into another chunk then that chunk will be forced to generate and so on and so forth if it is your Biome it will call your decorate method and lead to more chunks being loaded.

Their height is 5+random.nextInt(5)

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.