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

Rebase onto latest upstream #90

Closed zml2008 closed 3 years ago

zml2008 commented 3 years ago

This is a fairly straightforward rebase based on what jetbrains has changed.

Some key points:

These seem to have reordered one local variable declaration -- not sure why (output of MCPConfig's testDecompileJoinedHotspot8 on 1.16.5):

diff --git a/net/minecraft/client/resources/PackResourcesAdapterV4.java b/net/minecraft/client/resources/PackResourcesAdapterV4.java
index a5c3444..80b06dd 100644
--- a/net/minecraft/client/resources/PackResourcesAdapterV4.java
+++ b/net/minecraft/client/resources/PackResourcesAdapterV4.java
@@ -148,8 +148,8 @@ public class PackResourcesAdapterV4 implements PackResources {
    public static InputStream m_118773_(InputStream p_118774_, InputStream p_118775_, int p_118776_, int p_118777_, int p_118778_, int p_118779_, int p_118780_) throws IOException {
       ByteArrayInputStream bytearrayinputstream;
       try (
-         NativeImage nativeimage1 = NativeImage.m_85058_(p_118775_);
          NativeImage nativeimage = NativeImage.m_85058_(p_118774_);
+         NativeImage nativeimage1 = NativeImage.m_85058_(p_118775_);
       ) {
          int i = nativeimage.m_84982_();
          int j = nativeimage.m_85084_();

I've confirmed with Sponge's toolchain that the package-info files added in 21w13a decompile correctly as well.

LexManos commented 3 years ago

it may want to be renamed?

Feel free. They are commit messages so being descriptive is nice.

These seem to have reordered one local variable declaration

Ya, I've seen this one change before, I don't remember ever being able to figure out why... Is that the only diff between the full decompile? Also, anyone run this through the JVM tests in MCPConfig yet?

zml2008 commented 3 years ago

updated -- that's the only diff in a full decompile, yeah.

i ran through the testDecompileJoined task in MCPConfig and nothing seemed to blow up, but only did the full diff on the J8 decompile.

JDLogic commented 3 years ago

These seem to have reordered one local variable declaration

The current FF version used in MCPConfig does not include this commit (9c8685efbd72dc38a945b60f4cc899d1a3d99054) which is causing the diff.

zml2008 commented 3 years ago

ah, that'd do it -- thanks!

LexManos commented 3 years ago

Just a note, the main point of this bump is to update to a version of FF that support package-info classes properly. Which changes the decompiled package infos that now exist in 21w13a from:

package net.minecraft;

import javax.annotation.ParametersAreNonnullByDefault;

// $FF: synthetic class
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@FieldsAreNonnullByDefault
interface package-info {
}

To the proper:

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
@FieldsAreNonnullByDefault
package net.minecraft;

import javax.annotation.ParametersAreNonnullByDefault;

Ran it through the decompiler tests on MCPConfig {Adopt HotSpot 8/11/15} and it seems to work fine. Gunna pull this locally, so I can tag it correctly before publishing.