MinecraftForge / ForgeFlower

Forge's modifications to FernFlower. Fixing various bugs/inconsistencies. Main Repo: https://github.com/MinecraftForge/FernFlower
Apache License 2.0
80 stars 44 forks source link

Fix some field initializers not being extracted or incorrectly extracted #39

Closed JDLogic closed 5 years ago

JDLogic commented 6 years ago

Should resolve #32. 1.13.1 Diff

kashike commented 6 years ago

What about cases like in World? Seems like

        this.eventListeners = Lists.newArrayList(this.pathListener);
        this.calendar = Calendar.getInstance();
        this.worldScoreboard = new Scoreboard();
        this.spawnHostileMobs = true;
        this.spawnPeacefulMobs = true;
        this.lightUpdateBlockList = new int[32768];

should be extracted too?

JDLogic commented 6 years ago

You are correct, and those cases should be fixed now as well. Also, while taking a closer look, I did notice that some initializers that should have not been extracted. Like field_195842_d in LibraryLWJGL3. This should be fixed now too, and the diff has been updated to reflect the changes.

bs2609 commented 6 years ago

Having a look through the current diff, are IntHashMap and FoodStats correct?

JDLogic commented 6 years ago

Yes. I may be doing something wrong, but from what I can tell, extracting those initializers produces different bytecode. Comparing to the original indicates that they should not be extracted.

Original vs FF before ihm-before Original vs FF after ihm-after