[Snapshot] Leaf block base error [1.12.2]

Published by FireBlox on Mon, 03/09/2020 - 23:12
Status
Resolved
Type
Product/platform
Not applicable
Priority
Normal
Issue description

I tried out the leaf block base in the new snapshot and it seems that it is incomplete [which makes sense considering it's a snapshot]. But anyways, the leaves on all my custom trees are going away naturally without having destroyed the logs. I already mentioned this on the 2020.2 snapshot news page, but I must ask if the solution provided works on 1.12.2, and if not, would it perhaps be possible to instead of checking for the tag to check for the oreDict entry "treeLeaves"?

Issue comments

Implementation for 1.12.2 is different and can not work with tags. Add this code snippet to your block for this to work:

@Override public boolean canSustainLeaves(IBlockState state, net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }
    @Override public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos){ return true; }

As this parameter only exists in 1.12.2 which is legacy we won't be adding a checkbox for this.

I understand that you are dropping support for 1.12.2, but I feel like someone should implement a function for MCreator that enables/disables features based on the MC version the user is developing for. It would help eliminate a ton of confusion [like that incident with the repair items] for so many users [including myself], and it probably wouldn't be too hard. And I really think that there should, in fact, be a checkbox for this in 1.12.2, because of what I said above. I would make a donation to support this, but my funds are limited.

We do plan to add better display of supported features on the generator selector screen in the future updates.

I tried to add the code but kept getting this error

 

Executing Gradle task: build
Build info: MCreator 2020.2.09617 EAP (09617), 1.12.2, 64-bit, 24566 MB, Windows 10, JVM 1.8.0_232, JAVA_HOME: J:\Downloads\MCreator EAP 2020.2 b09617 Windows 64bit\MCreatorEAP20202b09617\jdk
This mapping 'snapshot_20171003' was designed for MC 1.12! Use at your own peril.
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava UP-TO-DATE
:compileApiJava NO-SOURCE
:processApiResources NO-SOURCE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Users\[name]\MCreatorWorkspaces\ChaoticaWorkspace\build\sources\main\java\net\mcreator\chaotica\MCreatorFrostWoodLeaves.java:51: error: BlockCustom is not abstract and does not override abstract method getWoodType(int) in BlockLeaves 
      
   public static class BlockCustom extends BlockLeaves {
                 ^
1 error
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
5 actionable tasks: 4 executed, 1 up-to-date
BUILD FAILED
Task completed in 10785 milliseconds

Scrap that; I got it working, except now I'm having the opposite problem: the leaves won't decay at all. even with a high randomTickSpeed.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.