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

Endless Loop in ModelBackery if model errors exist #38

Closed
ichttt opened this issue Jul 13, 2019 · 2 comments
Closed

Endless Loop in ModelBackery if model errors exist #38

ichttt opened this issue Jul 13, 2019 · 2 comments

Comments

@ichttt
Copy link
Member

ichttt commented Jul 13, 2019

[First reported in forge discord by Gegy)
It seems due to a decompiler bug, that ModelBakery spins indefinitly if there are any model errors (which is really bad for modders). Decompiled using ForgeFlower:

                  if (flag) {
                     Iterator iterator = map.entrySet().iterator();

                     while(true) {
                        if (!iterator.hasNext()) {
                           ;
                        } else {
                           Entry<ModelResourceLocation, BlockState> entry = (Entry)iterator.next();
                           IUnbakedModel iunbakedmodel1 = map1.get(entry.getValue());
                           if (iunbakedmodel1 == null) {
                              LOGGER.warn("Exception loading blockstate definition: '{}' missing model for variant: '{}'", resourcelocation1, entry.getKey());
                              iunbakedmodel1 = this.field_217849_F.get(MODEL_MISSING);
                           }

                           this.putModel(entry.getKey(), iunbakedmodel1);
                        }
                     }
                  }

Using idea to decompile it shows another code:

                    } finally {
                        if (var24) {
                            if (flag) {
                                Iterator iterator = map.entrySet().iterator();
                                while(true) {
                                    while(true) {
                                        if (iterator.hasNext()) {
                                            Entry<ModelResourceLocation, BlockState> entry = (Entry)iterator.next();
                                            IUnbakedModel iunbakedmodel1 = (IUnbakedModel)map1.get(entry.getValue());
                                            if (iunbakedmodel1 == null) {
                                                field_177603_c.warn("Exception loading blockstate definition: '{}' missing model for variant: '{}'", resourcelocation1, entry.getKey());
                                                iunbakedmodel1 = (IUnbakedModel)this.field_217849_F.get(field_177604_a);
                                            }
                                            this.func_209593_a((ResourceLocation)entry.getKey(), iunbakedmodel1);
                                        }
                                    }
                                }
                            }
                        }
                    }

Maybe MinecraftForge/ForgeFlower#38 can fix this issue.

@LexManos
Copy link
Member

Interesting, there may be a few more places like this. Thus is the issue with decompiled code.
ForgeFlower#38 has come conflicts and needs to address bs's comment.

@ichttt
Copy link
Member Author

ichttt commented Jul 16, 2019

It would be nice if we could get a patch at least, as it is somewhat frustrating for modders that the game freezes when loading of blockstates fails...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants