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.

TheSmiler

Members
  • Joined

  • Last visited

Everything posted by TheSmiler

  1. Hello, am just beginning modding and I am trying to generate new mushrooms with the GeneratorBushFeature(BlockBush) class. The game is starting but chash when I try to generate a world. My mushroom block extends the BlockMushroom class and my generator class is registered with GameRegistry.registerWorldGenerator(new WorldGenMushrooms(),0); here is the generator's cod: package fr.thesmiler.mushroomsmod.world.gen.feature; import java.util.Random; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.GeneratorBushFeature; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import fr.thesmiler.mushroomsmod.init.MushroomsBlocks; public class WorldGenMushrooms implements IWorldGenerator{ public WorldGenerator mushroomYellowGen; public Random randomGenerator; public BlockPos bp; public WorldGenMushrooms(){ this.mushroomYellowGen = new GeneratorBushFeature(MushroomsBlocks.yellow_mushroom); System.out.println("TEST"); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){ generateSurfaceMush(world, random, chunkX*16, chunkZ*16); if(world.provider.getDimensionId()==0){ generateSurfaceMush(world, random, chunkX*16, chunkZ*16); } } public void generateSurfaceMush(World world, Random rand, int chunkX, int chunkZ){ for (int i = 0; i < 50; i++){ if (this.randomGenerator.nextInt(4) == 0){ int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(48); int randPosZ = chunkZ + rand.nextInt(16); BlockPos blockpos2 = world.getHorizon(bp.add(randPosX, randPosY, randPosZ)); mushroomYellowGen.generate(world, rand,blockpos2); System.out.println("test"); } } } } I did removed the comments because they were in Frensh, sorry. Please help me!

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.