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

Hi, I'm having some problems with the ore generation: the block isn't generated. I did everything I know needed for it to work, but it isn't generated at all, even if I fly far away, or teleport, or set high numbers, like vein size and chance to spawn, none of my blocks are generated. I don't know what I missed or did wrong. There are no errors. I compared my code with the ones people with working ore generation posted, but it's basically exactly the same, and still no ore generation, either in Eclipse or if I compile it and run it from mods folder in normal Minecraft. I also putted printlns all over the code to check if it's being run, but yes, it is, but no blocks are generated, even if I change to vanilla blocks.

 

Does the block have to be of a specific type to be generated? Or something needs to be added in the block class, or something?

 

 

Here's the the main class: http://pastebin.com/eKAdzfja

 

and the world generation class: http://pastebin.com/TkRMMe5f

For starters, I am leery of "new WorldGenMinable" appearing inside a loop in which its arguments do not change value. I'd hoist this up to a higher level, assigning its result to an object var that you use in its place inside the loop.

 

However, I don't think that's the problem. Set a breakpoint at or inside addOreSpawn and then step through it. Step into the generate call. Examine variables as you go. Something should jump out at you. Maybe something wasn't initialized somewhere else. The debugger can reveal that real quick.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

  • Author

For starters, I am leery of "new WorldGenMinable" appearing inside a loop in which its arguments do not change value. I'd hoist this up to a higher level, assigning its result to an object var that you use in its place inside the loop.

 

However, I don't think that's the problem. Set a breakpoint at or inside addOreSpawn and then step through it. Step into the generate call. Examine variables as you go. Something should jump out at you. Maybe something wasn't initialized somewhere else. The debugger can reveal that real quick.

 

Well, I already fixed it, and it's generating normally now, as can be seen here. But thanks anyway. =)

Guest
This topic is now closed to further replies.

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.