MCreator Link API: Your workspace contains mod elements that don't comple properly.

Started by r0drunner on

Topic category: Troubleshooting, bugs, and solutions

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MCreator Link API: Your workspace contains mod elements that don't comple properly.
Wed, 03/29/2023 - 11:44 (edited)

MCreator version: 2023.1.10610

I'm following the tutorial "MCreator Link: MCreator procedures"

I want to connect an Arduino uno. I've added a procedure that will set the pin modes (digital pins 12 and 13 in my case as output). I've checked the "Minecraft Link" in the external API settings

The procedure looks like this: 

mcreator procedure pin mode settings

But this procedure causes compilation errors during the build:

 

compilation error

 

And this is the build log. Let me know if you need more details to analyze the procedure or the workspace settings.

Executing Gradle task: runClient
Build info: MCreator 2023.1.10610, forge-1.19.2, 64-bit, 7996 MB, Windows 10, JVM 17.0.5, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk, started on: 2023-03-29-10:47:02
 
> Configure project :
The code of this workspace uses official obfuscation mappings provided by Mojang. These mappings fall under their associated license you should be fully aware of.
(c) 2020 Microsoft Corporation. These mappings are provided "as-is" and you bear the risk of using them. You may copy and use the mappings for development purposes,
but you may not redistribute the mappings complete and unmodified. Microsoft makes no warranties, express or implied, with respect to the mappings provided here.
Use and modification of this document or the source code (in any form) of Minecraft: Java Edition is governed by the Minecraft End User License Agreement available
at https://account.mojang.com/documents/minecraft_eula.
 
> Task :mcreatorLink UP-TO-DATE
> Task :compileJava
C:\Users\docente\MCreatorWorkspaces\rodrigo_mod\src\main\java\net\mcreator\rodrigomod\procedures\ConfigurePinsProcedure.java:19: error: incompatible types: no instance(s) of type variable(s) K,V exist so that Map conforms to Event  execute(Collections.emptyMap());
  ^
 where K,V are type-variables:
 K extends Object declared in method <K,V>emptyMap()
 V extends Object declared in method <K,V>emptyMap()
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
> Task :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 5s
1 actionable task: 1 executed
 
BUILD FAILED
Task completed in 11 seconds

And this is the generated java code for the procedure:


@Mod.EventBusSubscriber
public class ConfigurePinsProcedure {
	@SubscribeEvent
	public static void onLinkDeviceConnected(LinkDeviceConnectedEvent event) {
		execute(Collections.emptyMap());
	}

	public static void execute(LevelAccessor world, double x, double y, double z) {
		execute(null, world, x, y, z);
	}

	private static void execute(@Nullable Event event, LevelAccessor world, double x, double y, double z) {
		CurrentDevice.pinMode((int) 12, PinMode.OUT);
		CurrentDevice.pinMode((int) 13, PinMode.OUT);
	}
}
Edited by r0drunner on Wed, 03/29/2023 - 11:44
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
 I've tried to follow the…
Wed, 03/29/2023 - 18:12

 I've tried to follow the tutorial and seems quite easy, but probably is based on an older version of MCreator. I'll give it a run in another computer where I have 2021.2 and if it doesn't work, I will follow your suggestion and open a bug report in github.

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Glad you found it. Do you…
Wed, 03/29/2023 - 21:01

Glad you found it. Do you know if MCreator 2022.3 would work in the meantime while I wait for the next release?

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I get the same compilation…
Thu, 03/30/2023 - 10:48

I get the same compilation error in 2022.3 

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've tried with MCreator…
Tue, 04/04/2023 - 16:01

I've tried with MCreator 2021.2 and Forge 1.17.1 and indeed I got rid of the compilation error in the procedure that configures the Arduino pins.

However, the launcher fails with the following error:

> Task :runClient FAILED 
Exception in thread "main"  
FAILURE: Build failed with an exception. 
* What went wrong: 
Execution failed for task ':runClient'. 
> Process 'command 'C:\Users\docente\.mcreator\gradle\jdks\jdk8u362-b09\bin\java.exe'' finished with non-zero exit value 1 
* 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 8.0. 
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. 
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings 
BUILD FAILED in 15s 
10 actionable tasks: 3 executed, 7 up-to-date 
BUILD FAILED 
Task completed in 15 seconds

 ¿Is this caused by incompatibility between MCreator 2021.2 and Gradle 8.0 ?  How can I downgrade to an older version of Gradle?