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.

Featured Replies

Posted

Hello,

 

I wanted to add a new biome, after a few tries and hours of flying around (I even added an Item for increasing the flying speed just to find it), I found my biome, but the top and filler blocks don't generate, but when I choose vanilla blocks, it works. Now, I guess this is because my custom block's ID exceeds 256, as it was in 1.6.4, but since GameRegistry.registerBlock(); automatically registers an ID, I don't know how to go about this problem.

 

Anyone know what to do?

 

Thanks in advance.

Could you show us the code of your Biome and Main class? It's hard troubleshooting your problem if we can't see what you are doing.

  • Author

I have left out anything unrelated

 

MainClass:

package com.nignog.mymod;

@Mod(modid = MainClass.MODID, name = MainClass.NAME, version = MainClass.VERSION)
public class MainClass {
@SidedProxy(clientSide = "com.nignog.mymod.ClientProxy", serverSide = "com.nignog.mymod.CommonProxy")
public static CommonProxy proxy;

public static final String MODID = "mymod";
public static final String VERSION = "3.14159";
public static final String NAME = "My Mod";

public static BiomeGenBase biomeAustralia = new BiomeAustralia(42);

// Blocks
public static Block australiumDust = new AustraliumDust(Material.ground);
public static Block diamondOreDisguise = new DiamondOreDisguise(
		Material.ground);

@EventHandler
public void preinit(FMLPreInitializationEvent e) {

	// Biome Registry
	ModBiomeRegistry.init();

	// Block Registry
	ModBlockRegistry.init();
}

@EventHandler
public void load(FMLInitializationEvent event) {

}

@EventHandler
public void init(FMLPostInitializationEvent event) {

}
}

 

BiomeAustralia:

package com.nignog.mymod.biomes;

import net.minecraft.world.biome.BiomeGenBase;

import com.nignog.mymod.MainClass;

public class BiomeAustralia extends BiomeGenBase {

public BiomeAustralia(int id) {
	super(id);
	setBiomeName("Australia");
	fillerBlock = MainClass.diamondOreDisguise;
	topBlock = MainClass.australiumDust;
	setDisableRain();
	setHeight(height_MidPlains);
	theBiomeDecorator.treesPerChunk = -999;
	theBiomeDecorator.generateLakes = true;
}
}

 

ModBiomeRegistry:

package com.nignog.mymod;

import net.minecraftforge.common.BiomeManager;

public class ModBiomeRegistry {
public static void init() {
	BiomeManager.warmBiomes.add(new BiomeManager.BiomeEntry(
			MainClass.biomeAustralia, 420));
	BiomeManager.addSpawnBiome(MainClass.biomeAustralia);
}
}

First of all: Don't create any game elements (Biomes, Blocks, Items, etc.) in a static initializer. You must do it in preInit.

And then: You need to create your Biome after your Blocks are created.

 

For Blocks and Items, it doesn't do any harm when you instanciate them in the static initializer anymore (since the removal of the block / item IDs). All the super constructor of a block / item does is setting some internal variables.

For everything else, yes, do it in preInit (since it usually has an ID in its constructor, like for biomes)

Registering them is another story, this should always go into the preInit.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.