Posted June 2, 20178 yr 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 June 2, 20178 yr by blahblahbal
June 2, 20178 yr 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.
June 2, 20178 yr 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.
June 2, 20178 yr 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.
June 3, 20178 yr 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.