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.

[1.7.10] Nevermind (DecorateBiomeEvent.Post called recursively?)

Featured Replies

Posted

EDIT: Nevermind, doesn't seem to be doing it anymore, even though I'm pretty sure I haven't changed anything. If I happen across this again, I'll update this thread.

 

While messing around, I found something very interesting and somewhat alarming:

Decorating at -1600/0, << shift: -25600/0
// note that the new x/z values are the previous ones bit-shifted!!!
Decorating at -25600/0, << shift: -409600/0
// and again!!!
Decorating at -409600/0, << shift: -6553600/0
Decorating at -1600/-64, << shift: -25600/-1024
Decorating at -25600/-1024, << shift: -409600/-16384
Decorating at -1600/-80, << shift: -25600/-1280
Decorating at -25600/-1280, << shift: -409600/-20480
Decorating at -409600/-20480, << shift: -6553600/-327680

 

I was checking if DecorateBiomeEvent.Post's chunkX/chunkZ fields were block positions, or chunk positions; the above output was generated by this code:

@SubscribeEvent
public void onDecorate(DecorateBiomeEvent.Post event) {
if (event.world.provider.isSurfaceWorld()) {
	logger.info(String.format("Decorating at %d/%d, << shift: %d/%d",
		event.chunkX, event.chunkZ, (event.chunkX << 4), (event.chunkZ << 4)));
}
}

 

What's especially interesting is that the output clearly shows that the decorator is called once with block coordinates, but then those exact same block coordinates are << 4 as though they were chunk coordinates and apparently RE-POSTED to the event bus!

 

Any ideas on why this is? The only places that this event gets posted is from BiomeDecorator#genDecorations and, for the Nether, from ChunkProviderHell#populate, neither of which look like they should be causing this kind of behavior.

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.