Jump to content

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


coolAlias

Recommended Posts

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.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.