Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023.2 ProcedureCompilation issues #3859

Closed
3 tasks done
smmmadden opened this issue May 5, 2023 · 10 comments · Fixed by #3865
Closed
3 tasks done

2023.2 ProcedureCompilation issues #3859

smmmadden opened this issue May 5, 2023 · 10 comments · Fixed by #3865
Assignees
Labels
bug Something isn't working
Milestone

Comments

@smmmadden
Copy link

Issue description

I've imported my working mod from the 2023.1 version to 2023.2 snapshot and get compilation errors with 1.19.2 and 1.19.4 builds.
C:\MCreator-Releases\MCreator20232\workspaces\gravels\src\main\java\net\mcreator\tmtmcgravels\procedures\CompletedAllGravelsProProcedure.java:51: error: illegal attempt to redefine an existing match binding
&& _plr.getAdvancements().getOrStartProgress(_plr.server.getAdvancements().getAdvancement(new ResourceLocation("tmtmcgravels:gravel_light_gray_ach"))).isDone() && entity instanceof ServerPlayer _plr

C:\MCreator-Releases\MCreator20232\workspaces\gravels\src\main\java\net\mcreator\tmtmcgravels\procedures\CompletedAllGravelsProProcedure.java:53: error: variable _plr is already defined in method execute(Event,Entity)
if (entity instanceof ServerPlayer _plr && _plr.level instanceof ServerLevel

How to reproduce this issue?

Imported the workspace ZIP file from 2023.1 to 2023.2 and after compilation was done, it though errors on the 6 Completion Procedures that check for existing achievements and then grants XP or XP Levels if all are done.
image
image
I've tried moving each group of two to a separate If/do block and that had no change in behavior. I've even tried double clicking on each of the advancement checks and re-selected the same Advancement but no difference in behavior.
Here is example of one of the references:
image

Operating system

Windows

Details

MCreator 2023.2 Snapshot
Forge 1.19.2 and 1.194

Example workspace

No response

Logs

https://pastebin.com/PVWGcFzf

Issue tracker rule checks (please read carefully)

@smmmadden smmmadden added the bug Something isn't working label May 5, 2023
@KlemenDEV
Copy link
Contributor

Thank you for the bug report. Please attach either example workspace or PTPL exported procedure file

@KlemenDEV KlemenDEV added the more information needed The issue opener needs to provide more information label May 5, 2023
@smmmadden
Copy link
Author

I'm not seeing any option to attach a PTPL file here. It isn't one of the supported file types. Do I need to add it as a link to download?

@KlemenDEV
Copy link
Contributor

Yes, or you could zip it and attach zip

@smmmadden
Copy link
Author

@KlemenDEV KlemenDEV removed the more information needed The issue opener needs to provide more information label May 5, 2023
@AlsoSomeoneElse
Copy link
Collaborator

Can confirm the issue, happens with most blocks that return a boolean value and use pattern matching.

This is caused by the parenthesis optimization, removing parentheses even when pattern matching happens.
It wasn't an issue in previous versions because the old code templates used ternary operators.

@KlemenDEV
Copy link
Contributor

KlemenDEV commented May 6, 2023

Could you take a look into this? I think you know the best how the optimization works and how best to approach this

@KlemenDEV
Copy link
Contributor

Another case of this was found here: https://mcreator.net/forum/96782/build-failed-after-new-update

@KlemenDEV KlemenDEV added this to the 2023.2 milestone May 6, 2023
@AlsoSomeoneElse
Copy link
Collaborator

Another case of this was found here: https://mcreator.net/forum/96782/build-failed-after-new-update

This also happen for the same reason

@KlemenDEV
Copy link
Contributor

It wasn't an issue in previous versions

#3863 seems to fail on 1.19.2 in some cases too

@purejosh
Copy link

purejosh commented May 6, 2023

Also having this issue. Please ping me if there's anything I can do to assist with investigating.

@KlemenDEV KlemenDEV changed the title 2023.2 Procedure/Advancement Compilation issues 2023.2 ProcedureCompilation issues May 6, 2023
KlemenDEV added a commit that referenced this issue May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants