PaperMC / paperweight

Gradle build system plugin for Paper and Paper forks
232 stars 48 forks source link

Paper's reobf mappings patch doesn't apply to forks #45

Closed PaulBGD closed 2 years ago

PaulBGD commented 3 years ago

This can be repro'd by byof: https://github.com/clrxbl/byof/

Just compile a reobfuscated JAR, and none of the things from the mappings patch get remapped.

PaulBGD commented 3 years ago

Looks like it should be fixed, feel free to close this unless you want it as a tracking issue for other reobf things.

DenWav commented 3 years ago

I still need to do some work on this so this issue works fine to remind me I need to do that.

bergerkiller commented 3 years ago

A possibly related issue is that special fields added by the compiler for anonymous inner classes don't get remapped on spigot/paper, but are on forks of paper. In my case I'm running into this with the PlayerChunkMap$EntityTracker.this$0 field, which is "this$0" on spigot/paper and "a" on forks of paper.

I use it to know of a given EntityTracker what PlayerChunkMap/World is related to it. (event handling)

MrPowerGamerBR commented 3 years ago

I'm also facing a similar issue (maybe? I'm not really sure), but with BlockPositions

[13:29:03 FATAL]: Failed to schedule load callback for chunk [1, -11]
java.util.concurrent.CompletionException: java.lang.IncompatibleClassChangeError: Expected non-static field net.minecraft.core.BlockPosition$MutableBlockPosition.c
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1155) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
        at net.minecraft.server.level.ChunkTaskPriorityQueueSorter.lambda$message$1(ChunkTaskPriorityQueueSorter.java:58) ~[?:?]
        at net.minecraft.util.thread.ProcessorMailbox.pollTask(ProcessorMailbox.java:87) ~[?:?]
        at net.minecraft.util.thread.ProcessorMailbox.pollUntil(ProcessorMailbox.java:129) ~[?:?]
        at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:96) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.IncompatibleClassChangeError: Expected non-static field net.minecraft.core.BlockPosition$MutableBlockPosition.c
        at net.minecraft.core.BlockPos$MutableBlockPos.set(BlockPos.java:483) ~[?:?]
        at net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator.buildSurfaceAndBedrock(NoiseBasedChunkGenerator.java:260) ~[?:?]
        at net.minecraft.world.level.chunk.ChunkStatus.lambda$static$7(ChunkStatus.java:77) ~[SparklyPaper-Server-reobf.jar:git-SparklyPaper-"67c742e"]
        at net.minecraft.world.level.chunk.ChunkStatus$SimpleGenerationTask.doWork(ChunkStatus.java:276) ~[?:?]
        at net.minecraft.world.level.chunk.ChunkStatus.generate(ChunkStatus.java:212) ~[SparklyPaper-Server-reobf.jar:git-SparklyPaper-"67c742e"]
        at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$37(ChunkMap.java:1354) ~[SparklyPaper-Server-reobf.jar:git-SparklyPaper-"67c742e"]
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[SparklyPaper-Server-reobf.jar:git-SparklyPaper-"67c742e"]
        at net.minecraft.server.level.ChunkMap.lambda$scheduleChunkGeneration$39(ChunkMap.java:1352) ~[SparklyPaper-Server-reobf.jar:git-SparklyPaper-"67c742e"]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?]
        ... 8 more

The non-reobfuscated mappings works fine so it isn't a issue in the server code, using Paperweight 1.1.6

Update: This seems to be worked around in Airplane so this is an already known issue, whoops, sorry! 😭