Jump to content

[1.12.2] stop snow falling on custom block


Xenoamor

Recommended Posts

Snow settling happens in WorldServer#updateBlocks() - look for the profiler section marked "iceandsnow".  Looking at that code, there are no specific snow-formation events fired, so your options are:

  • Override neighborChanged() in your custom block's class (the method is deprecated, but overriding it is OK).  In the override, you can check if the block above your block has become a snow layer, and if so, remove it.  (note: that's extra block update work, which might become a performance issue if you plan to have a lot of your custom block in the world)
  • Have your custom block emit enough light to prevent snow formation (light level of 10, I believe).  Might not be practical.
  • Enhancement request or PR to Forge to have a custom snow formation event fired.  Not sure if that would fly.

 

Edited by desht
Link to comment
Share on other sites

28 minutes ago, V0idWa1k3r said:

As far as I am aware snow doesn't fall on blocks that are not full cubes(return false in Block#isFullCube)

Yes, you're right (although the method to use is Block#getBlockFaceShape, as diesieben07 pointed out).  If it's not SOLID, snow won't settle.

 

Of course, changing that can have other effects (e.g. torch/button placement), so might not be appropriate.

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.

Announcements



×
×
  • Create New...

Important Information

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