Error: code too large

Started by kovalscky on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 15:54, 11. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Error: code too large
Mon, 09/25/2023 - 18:21 (edited)

MCreator version 2023.3

My mod have a 3,870 mod elements (it is a huge decorative mod with massive amount of building blocks). After creating a 3,871 one the gradle stops with this error:

Executing Gradle task: build
Build info: MCreator 2023.3.36712, forge-1.19.4, 64-bit, 16306 MB, Windows 10, JVM 17.0.7, JAVA_HOME: C:\Utilities\MCreator\jdk, started on: 2023-09-25-21:09:54


BUILD FAILED
Task completed in 1 minute and 56 seconds

> 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 :compileJava
A:\Urbanoid\The Urbanoid Mod\Urbanoid Mod Workspace\src\main\java\urbanoid\init\UrbModBlocks.java:3872: error: code too large public static final DeferredRegister<Block> REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCKS, UrbMod.MODID);
^
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 43s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 56 seconds

My assumption is that there is a limit on the number of mod elements that can be handled in the MCreator.

So, does MCreator have a limited number of mod elements? If yes, what the number? And what I have to do if I want to continue developing my mod, make the second mod as a child of the first one?

Edited by kovalscky on Mon, 09/25/2023 - 18:21
Unfortunately Java has a…
Tue, 09/26/2023 - 15:21

Unfortunately Java has a limit how large files can be.

It would be best to split this into smaller specific mods and declare dependency in workspace settings

Last seen on 15:54, 11. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, understandable  
Tue, 09/26/2023 - 16:25

Okay, understandable