Posted July 27, 201411 yr 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.
July 28, 201411 yr 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.
July 28, 201411 yr 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); } }
July 29, 201411 yr 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.