Compilation error when using block type to item/gem type converter and number varibles

Published by bum on Tue, 04/07/2020 - 14:32
Status
Fixed
Type
Product/platform
MCreator/Linux
Priority
Normal
Issue description

I have managed to isolate the bug and create a new workspace to demonstrate it. I have attached the exported workspace zip to this report. I also left some comments inside the procedure where said bug takes place in order to give some context.

Here is the console output:

Executing Gradle task: build

Build info: MCreator 2020.2.13719, 1.14.4, 64-bit, 16030 MB, Linux, JVM 1.8.0_232, JAVA_HOME: /home/awesome/Desktop/MCreator20202/jdk/jre

> Configure project :

New Dep: net.minecraftforge:forge:1.14.4-28.2.3_mapped_snapshot_20190719-1.14.3

> Task :compileJava FAILED

/home/awesome/MCreatorWorkspaces/bugdemo/src/main/java/net/mcreator/bugdemo/procedures/HereisthebugProcedure.java:51: error: local variables referenced from an inner class must be final or effectively final 
    

/home/awesome/MCreatorWorkspaces/bugdemo/src/main/java/net/mcreator/bugdemo/procedures/HereisthebugProcedure.java:51: error: local variables referenced from an inner class must be final or effectively final 
    

            ItemStack retval = ((new ItemStack((world.getBlockState(new BlockPos((int) (verible), (int) y, (int) z))).getBlock()))).copy();

                                                                                        ^

1 error

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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.

Use '--warning-mode all' to show the individual deprecation warnings.

See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s

1 actionable task: 1 executed

BUILD FAILED

Task completed in 4390 milliseconds

Also sorry about my username, i was in a bad mood when i created this account 2 years ago.

Attachment Size
bug demo14.1 KB 14.1 KB
just the prodedure where the error takes place1.01 KB 1.01 KB

Issue comments



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.