Jump to content

[1.8] Cannot find my custom biome!


Arionas_MC

Recommended Posts

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)

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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));

    }

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Just now, Arionas_MC said:

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

Post your Biome code again.

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.

Link to comment
Share on other sites

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'

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • !warudo.isClientSide() still not a gui not an error just a simple message [06:44:39] [Render thread/WARN] [minecraft/MenuScreens]: Failed to create screen for menu type: mercmod:gem_polishing_menu Not a hint of what the problem is  this silent simple error dont tell much about the problem the code i made don't show errors highlighted   in mi old code 1.19.4 i launch the menu part from client side  but now i recheck the video and kapenjoe does it server side         
    • Hey, for getting your model to show up in Forge, double-check the way you've set up your model registration. Sometimes, it's just a tiny mix-up with where you've put your model file or maybe missing the right event to hook it up. Also, peek at your @Mod.EventBusSubscriber setup; it's gotta be listening in the right place. And don't forget to place your model file in the exact right spot with the correct naming. If in doubt, the Forge docs or forum threads can be super helpful.
    • Since flying mobs like bees and flies aren't affected, the problem likely lies with how ground mob AI interacts with the server environment. Checking the server logs, as you've done, is a good step. You might want to look for errors related to mob AI or pathfinding. Consider removing or updating mods one at a time to isolate the issue. Additionally, ensure your server's performance isn't being overly taxed by the modpack, as this can sometimes lead to unusual behavior with entity AI.
    • I'm having the same issue rn. Hostile mobs wont move until attacked but peaceful land mobs wont move at all. If it swims or flies its unaffected until it touches blocks.
    • Im trying to register model for my item but it doesn't works. First I Created a class where i declared all my items.   public class ModItems { public static final List<Item> ITEMS = new ArrayList<Item>(); public static final Item MY_ITEM = new MyItemClass(); } Then I created the MyItemClass where i describe my item. public class MyItemClass extends Item { public MyItemClass() { this.setRegistryName("my_item"); this.setUnlocalizedName("my_item"); this.setCreativeTab(CreativeTabs.COMBAT); ModItems.ITEMS.add(this); } } And The i created a class where i was trying register the model and where i registered my item @Mod.EventBusSubscriber public class EventsHandler { @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().register(new MyItemClass()); } @SubscribeEvent @SideOnly(Side.CLIENT) public static void onRegistryModel(ModelRegistryEvent event) { registryModel(new MyItemClass()); } @SideOnly(Side.CLIENT) private static void registryModel(Item item) { final ResourceLocation regName = item.getRegistryName(); final ModelResourceLocation mr1 = new ModelResourceLocation(regName, "inventory"); ModelBakery.registerItemVariants(item, mr1); ModelLoader.setCustomModelResourceLocation(item, 0, mr1); } } The registerItems method just registers my items. Then im catching ModelRegistryEvent to register my model. And in the last private method im registering models. In The game iitem still has purple-black cube instead of texture. I dont forgot to create the models\item folder and my_item.json file im sorry if this text has a grammatical errors. My english is very low  
  • Topics

×
×
  • Create New...

Important Information

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