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.

Qronicle

Members
  • Joined

  • Last visited

Everything posted by Qronicle

  1. Thx I'm guessing you're talking about setBlockAndNotify and the likes? Those weren't really faster. (If you meant those, but I doubt that.) Editing chunks directly sounds more like it . But googling this stuff doesn't yield much results. I'll try some more later today (I'm at work now). But if you or someone could just point me a bit further in the right direction (like with a link or method name), that would probably help a lot. Most stuff that I find is coded roughly the same way as what I'm doing, so I'm guessing I'm missing an important keyword or something
  2. Those aren't really relevant to the problem (private/protected/package/public keywords only define where the properties can be accessed, and in this case private would be enough, since it's only the owner class accessing them). Stuff like this would also throw an exception when used incorrectly (I guess, long time since I programmed in Java). My problem is just that world.setBlock seems to execute very slowly, possibly because it fires a whole range of things that need to be calculated for it. So the question here is whether there is a better way to do what I'm doing.
  3. Hello all, Today I started to dive into modding Minecraft (with Forge 4). I'm thinking of generating some pretty big structures, so I started messing around with a custom world generator. But one of my tests (simply adding some sort of brick stone roof with glass windows over the complete world) is generating really slow. My IWorldGenerator implementation: public class QWorldGenerator implements IWorldGenerator { protected WorldGenRoof roofGenerator = new WorldGenRoof(); // left out some inherited methods private void generateSurface(World world, Random random, int x, int z) { roofGenerator.generate(world, random, x, 0, z); } } The actual WorldGenerator: public class WorldGenRoof extends WorldGenerator { public boolean generate(World world, Random random, int chunkX, int chunkY, int chunkZ) { int blockId = 0; for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { blockId = Block.stoneBrick.blockID; if (x > 6 && x < 13 && z > 6 && z < 13) { blockId = Block.glass.blockID; } world.setBlock(chunkX + x, 100, chunkZ + z, blockId); } } return true; } } The code works fine, but as I said, really slow. It takes like five minutes instead of the normal couple of seconds to generate a new world. When I remove the world.setBlock(...) there is no real drop in performance. So is there some kind of other process I should use when doing things like this? Or maybe some mode to set while setting blocks in a loop? (I tried world.editingBlocks, but that didn't really help ) Any ideas welcome!

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.