PatchworkMC / patchwork-api

An attempt to reimplement the Minecraft Forge API on Fabric
GNU Lesser General Public License v2.1
282 stars 48 forks source link

Crash when switching the perspective back to first person #188

Closed rikka0w0 closed 4 years ago

rikka0w0 commented 4 years ago

Reproduce procedure: Hit F5 four-times Cause:

java.lang.NoSuchMethodError:
net.minecraftforge.fml.client.registry.ClientRegistry.getEntityShader(Ljava/lang/Class;)Lnet/minecraft/class_2960;
    at net.minecraft.class_757.handler$zll000$onCameraEntitySet(class_757.java:2923)

https://github.com/PatchworkMC/patchwork-api/blob/5ad67b2324240f78f2455939a54bcc1c09bf9701/patchwork-registries/src/main/java/net/patchworkmc/mixin/registries/MixinGameRenderer.java#L52

I just confirmed we have ClientRegistry.getEntityShader, but why this still happen in reobf env? Dev env does not have this problem. Even I just have Fabric API and Patchwork API installed, I can still reproduce this problem.

Crash report:

---- Minecraft Crash Report ----

// There are four lights!

Time: 9/7/20 3:18 AM

Description: Unexpected error

java.lang.NoSuchMethodError: net.minecraftforge.fml.client.registry.ClientRegistry.getEntityShader(Ljava/lang/Class;)Lnet/minecraft/class_2960;

    at net.minecraft.class_757.handler$zll000$onCameraEntitySet(class_757.java:2923)

    at net.minecraft.class_757.method_3167(class_757.java:251)

    at net.minecraft.class_310.method_1508(class_310.java:1489)

    at net.minecraft.class_310.method_1574(class_310.java:1411)

    at net.minecraft.class_310.method_1523(class_310.java:925)

    at net.minecraft.class_310.method_1514(class_310.java:410)

    at net.minecraft.client.main.Main.main(Main.java:155)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:192)

    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:140)

    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

-- Head --

Thread: Client thread

Stacktrace:

    at net.minecraft.class_757.handler$zll000$onCameraEntitySet(class_757.java:2923)

    at net.minecraft.class_757.method_3167(class_757.java:251)

    at net.minecraft.class_310.method_1508(class_310.java:1489)

-- Affected level --

Details:

    All players: 1 total; [class_746['Rikka0_0'/267, l='MpServer', x=-8.25, y=123.41, z=-225.72]]

    Chunk stats: Client Chunk Cache: 729, 484

    Level dimension: minecraft:overworld

    Level name: MpServer

    Level seed: 0

    Level generator: ID 00 - default, ver 1. Features enabled: false

    Level generator options: {}

    Level spawn location: World: (-48,68,-254), Chunk: (at 0,4,2 in -3,-16; contains blocks -48,0,-256 to -33,255,-241), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)

    Level time: 688 game time, 688 day time

    Level storage version: 0x00000 - Unknown?

    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

    Server brand: fabric

    Server type: Integrated singleplayer server

Stacktrace:

    at net.minecraft.class_638.method_8538(class_638.java:421)

    at net.minecraft.class_310.method_1587(class_310.java:1923)

    at net.minecraft.class_310.method_1514(class_310.java:430)

    at net.minecraft.client.main.Main.main(Main.java:155)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:192)

    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:140)

    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26)

-- System Details --

Details:

    Minecraft Version: 1.14.4

    Minecraft Version ID: 1.14.4

    Operating System: Windows 10 (amd64) version 10.0

    Java Version: 1.8.0_151, Oracle Corporation

    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation

    Memory: 3685246792 bytes (3514 MB) / 4294967296 bytes (4096 MB) up to 4294967296 bytes (4096 MB)

    CPUs: 4

    JVM Flags: 11 total; -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmn128m -Xmx4096m -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump

    Fabric Mods: 

        com_electronwill_night-config_core: core 3.6.2

        com_electronwill_night-config_toml: toml 3.6.2

        fabric: Fabric API 0.16.2+build.261-1.14

        fabric-api-base: Fabric API Base 0.1.2+28f8190f42

        fabric-biomes-v1: Fabric Biomes (v1) 0.1.1+28f8190f42

        fabric-command-api-v1: Fabric Command API (v1) 1.0.1+b534aa0c42

        fabric-commands-v0: Fabric Commands (v0) 0.2.0+bfd4c99d42

        fabric-containers-v0: Fabric Containers (v0) 0.1.3+28f8190f42

        fabric-content-registries-v0: Fabric Content Registries (v0) 0.1.2+28f8190f42

        fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.2+28f8190f42

        fabric-dimensions-v1: fabric-dimensions-v1 0.1.1+e15ff88642

        fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.3.0+6e76156542

        fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.0+12fccc5b42

        fabric-item-api-v1: Fabric Item API (v1) 1.0.0+c6bdeeaa42

        fabric-item-groups-v0: Fabric Item Groups (v0) 0.2.0+7ce6c57742

        fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.1+253decf242

        fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.0+85811ffb42

        fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.2.0+12fccc5b42

        fabric-loot-tables-v1: Fabric Loot Tables (v1) 0.1.1+28f8190f42

        fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.1+28f8190f42

        fabric-models-v0: Fabric Models (v0) 0.1.0+933c24c242

        fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.1+28f8190f42

        fabric-networking-v0: Fabric Networking (v0) 0.1.10+e7757afe42

        fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.0.0+002fcb6542

        fabric-object-builders-v0: Fabric Object Builders (v0) 0.2.0+002fcb6542

        fabric-particles-v1: fabric-particles-v1 0.2.1+e9056b2242

        fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.2.3+28f8190f42

        fabric-renderer-api-v1: Fabric Renderer API (v1) 0.1.1+933c24c242

        fabric-renderer-indigo: Fabric Renderer - Indigo 0.1.14+e15ff88642

        fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.2+28f8190f42

        fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.3+28f8190f42

        fabric-rendering-v0: Fabric Rendering (v0) 0.1.2+28f8190f42

        fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.1.4+28f8190f42

        fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 0.1.3+d423005742

        fabric-textures-v0: Fabric Textures (v0) 0.1.4+933c24c242

        fabricloader: Fabric Loader 0.8.7+build.201

        lanserverproperties: Lan Server Properties ${file.jarVersion}

        minecraft: Minecraft 1.14.4

        modmenu: Mod Menu 1.7.16.1.14.4+build.128

        patchwork: Patchwork 0.9.1

        patchwork-api-base: Patchwork API Base 0.1.0+nogit

        patchwork-biomes: Patchwork Biomes 0.3.0+nogit

        patchwork-capabilities: Patchwork Capabilities 0.4.0+nogit

        patchwork-data-generators: Patchwork Data Generators 0.3.0+nogit

        patchwork-dispatcher: Patchwork Dispatcher 0.4.1+nogit

        patchwork-enum-hacks: Patchwork Enum Hacks 0.3.0+nogit

        patchwork-eventbus: Patchwork EventBus 0.2.0

        patchwork-events-entity: Patchwork Entity Events 0.6.0+nogit

        patchwork-events-input: Patchwork Input Events 0.3.0+nogit

        patchwork-events-lifecycle: Patchwork Lifecycle Events 0.3.1+nogit

        patchwork-events-rendering: Patchwork Rendering Events 0.3.1+nogit

        patchwork-events-world: Patchwork World Events 0.4.0+nogit

        patchwork-extensions: Patchwork Extensions 0.3.0+nogit

        patchwork-extensions-bakedmodel: Patchwork Model Data 0.1.0+nogit

        patchwork-extensions-block: Patchwork Extensions Block 0.4.0+nogit

        patchwork-extensions-blockentity: Patchwork Extensions Block 0.1.0+nogit

        patchwork-extensions-item: Patchwork Item Extensions 0.4.0+nogit

        patchwork-extensions-shearing: Patchwork Extensions Shearing 0.3.0+nogit

        patchwork-fake-players: Patchwork Fake Players 0.1.0+nogit

        patchwork-fml: Patchwork FML Interface 0.4.0+nogit

        patchwork-god-classes: Patchwork God Classes 0.3.0+nogit

        patchwork-gui: Patchwork GUI 0.3.0+nogit

        patchwork-items: Patchwork Items 0.1.0+nogit

        patchwork-key-bindings: Patchwork Keybindings 0.2.0+nogit

        patchwork-level-generators: Patchwork Level Generators 0.3.0+nogit

        patchwork-loot: Patchwork Loot 0.3.0+nogit

        patchwork-model-loader: Patchwork Model Loader 0.2.1+nogit

        patchwork-networking: Patchwork Networking 0.4.0+nogit

        patchwork-networking-messages: Patchwork Networking Messages 0.3.1+nogit

        patchwork-recipes: Patchwork Recipes 0.3.0+nogit

        patchwork-registries: Patchwork Registries 0.4.0+nogit

        patchwork-resource: Patchwork Resource Loader 0.2.0+nogit

        patchwork-tags: Patchwork Tags 0.1.0+nogit

        patchwork-tooltype: Patchwork ToolType 0.3.0+nogit

        patchwork-vanilla-patches: Patchwork Vanilla Patches 0.3.0+nogit

    Launched Version: HMCL 3.2.143

    LWJGL: 3.2.2 build 10

    OpenGL: GeForce GTX 970/PCIe/SSE2 GL version 4.6.0 NVIDIA 432.00, NVIDIA Corporation

    GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes

    Is Modded: Definitely; Client brand changed to 'fabric'

    Type: Client (map_client.txt)

    Resource Packs: 

    Current Language: English (US)

    CPU: 4x Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
kitlith commented 4 years ago

It looks like there's two copies of ClientRegistry, and the game happens to be using the copy in god-classes instead.

Why is there a copy in god-classes? I'm not sure.

rikka0w0 commented 4 years ago

Just fixed.