Code inside locked duplicated elements are not changed

Published by Goldorion on
Status
Works as designed
Issue description

Hi,

I continued a little bit farm Adventure II and I duplicated a mod element that is locked. However, I checked the code because I got an error, and I discover that all the code was the same that the original mod element So, to resume, when you duplicate a locked mod element, its code is not changed with the name of it. For example, in this case, I duplicated the locked mod element LindenForest (a biome). I renamed it WesternCedarForest, but everything in the code that contains the name of the element (e.g. the class name and the registry name) is still with the name of the Linden Forest, instead to have the name of the Western Cedar Forest. I tested with an unlocked mod element without open it, and it doesn't happen.

The workspace is attached to the workspace. I don't think the error is needed as it only says the name of the class is not good, but here it is.

C:\Users\\MCreatorWorkspaces\farm_adventure\src\main\java\goldorion\farm_adventure\world\biome\WesternCedarForestBiome.java:28: error: class LindenForestBiome is public, should be declared in a file named LindenForestBiome.java public class LindenForestBiome extends FarmAdventureIiModElements.ModElement {
^
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.10.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 7135 milliseconds

 

Issue comments

This is normal. Once you lock the code, MCreator will not touch the code.

There is no refactoring mechanisms implemented that would refactor your code, this is a bit out of scope, I believe you can imagine :D