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

I'm having another issue (actually this issue has been occurring for quite some time), this time with leaf decay. I've been looking at other mods' code for clues on how to get leaves to decay once the logs are mined away, but nothing has caught my eye. Is there something I'm missing?

 

Currently, I have the leaves set to not decay at all, so my custom trees don't go nude over time.

 

Here is the code for the leaves:  https://github.com/blahblahbal/Blah-s-Minecraft-Mod/blob/Structure-fix/src/main/java/blahblahbal/blahmod/blocks/ModBlockLeaves.java

Here is the code for the logs:  https://github.com/blahblahbal/Blah-s-Minecraft-Mod/blob/Structure-fix/src/main/java/blahblahbal/blahmod/blocks/ModBlockLog.java

 

EDIT: I just noticed that the indentation is all messed up. Please ignore that, I'll fix it.

EDIT2: Fixed the indentation.

Edited by blahblahbal

Just let default implementation of BlockLeaves do the checks for you. If you want your wood blocks to "support" leaves, preventing them from decaying there is a convinient Block::canSustainLeaves method that does exactly that. For some reason you are not overriding it in your log class thus the default implementation returns false and the leaves just decay as there is nothing to support them.

  • Author

Oh, that's... simple. I didn't even realize that was a thing. For some reason my eyes glossed over that in the mods I've looked at.

  • Author

Is there a way to extend the range of the 'sustaining' function? My palm tree's foliage is too large to stay 'alive' with the default leaf code, and it'd look weird if I added wood to the foliage.

Something something copy the existing code into your leaf class as an override and change the values?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.