p0t4t0sandwich / ModPacketFix

A plugin that fixes some of the too big/too small packet errors that occur when connecting to a Vanilla server with a Forge client
GNU General Public License v3.0
8 stars 2 forks source link

ATM9 - Blue Skies missing ResourceKey #3

Open blakepdev opened 1 year ago

blakepdev commented 1 year ago

image

p0t4t0sandwich commented 1 year ago

Alrighty, I have it narrowed down to Blue Skies Gonna load that onto an empty client and see what I can turn up in terms of a server-side fix

p0t4t0sandwich commented 1 year ago

Just tossing this here so I don't lose it:

[10Oct2023 03:13:43.418] [Server Connector #9/DEBUG] [net.minecraftforge.network.DualStackUtils/]: Detected IPv4 address: "0.0.0.0"
[10Oct2023 03:13:43.419] [Netty Epoll Client IO #8/DEBUG] [net.minecraftforge.network.HandshakeHandler/FMLHANDSHAKE]: Starting new vanilla impl connection.
[10Oct2023 03:13:43.846] [Netty Epoll Client IO #8/DEBUG] [net.minecraftforge.network.LoginWrapper/FMLHANDSHAKE]: Recieved login wrapper packet event for channel fml:handshake with index 98
[10Oct2023 03:13:43.846] [Netty Epoll Client IO #8/ERROR] [net.minecraftforge.network.simple.IndexedMessageCodec/SIMPLENET]: Received invalid discriminator byte 98 on channel fml:handshake
[10Oct2023 03:13:43.848] [Netty Epoll Client IO #8/INFO] [net.minecraftforge.network.NetworkHooks/]: Connected to a vanilla server. Catching up missing behaviour.
[10Oct2023 03:13:43.849] [Netty Epoll Client IO #8/DEBUG] [net.minecraftforge.common.ForgeConfig/FORGEMOD]: Loaded forge config file forge-server.toml
[10Oct2023 03:13:43.891] [Render thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: Missing key in ResourceKey[minecraft:root / minecraft:damage_type]: ResourceKey[minecraft:damage_type / blue_skies:summon]
    Index: 1
    Listeners:
        0: NORMAL
        1: ASM: class com.legacy.blue_skies.events.SkiesEvents onLevelLoad(Lnet/minecraftforge/event/level/LevelEvent$Load;)V
java.lang.IllegalStateException: Missing key in ResourceKey[minecraft:root / minecraft:damage_type]: ResourceKey[minecraft:damage_type / blue_skies:summon]
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.core.Registry.m_257106_(Registry.java:151)
    at java.base/java.util.Optional.orElseThrow(Optional.java:403)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.core.Registry.m_246971_(Registry.java:151)
    at TRANSFORMER/blue_skies@1.3.29/com.legacy.blue_skies.registries.SkiesDamageSources.source(SkiesDamageSources.java:53)
    at TRANSFORMER/blue_skies@1.3.29/com.legacy.blue_skies.registries.SkiesDamageSources.<init>(SkiesDamageSources.java:33)
    at TRANSFORMER/blue_skies@1.3.29/com.legacy.blue_skies.registries.SkiesDamageSources.create(SkiesDamageSources.java:48)
    at TRANSFORMER/blue_skies@1.3.29/com.legacy.blue_skies.events.SkiesEvents.onLevelLoad(SkiesEvents.java:108)
    at TRANSFORMER/blue_skies@1.3.29/com.legacy.blue_skies.events.__SkiesEvents_onLevelLoad_Load.invoke(.dynamic)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.client.multiplayer.ClientLevel.<init>(ClientLevel.java:182)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.client.multiplayer.ClientPacketListener.m_5998_(ClientPacketListener.java:403)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.network.protocol.game.ClientboundLoginPacket.m_5797_(ClientboundLoginPacket.java:95)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.network.protocol.game.ClientboundLoginPacket.m_5797_(ClientboundLoginPacket.java:25)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.network.protocol.PacketUtils.m_263899_(PacketUtils.java:22)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1106)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.client.main.Main.main(Main.java:218)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at MC-BOOTSTRAP/fmlloader@1.20.1-47.2.0/net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111)
    at MC-BOOTSTRAP/fmlloader@1.20.1-47.2.0/net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99)
    at MC-BOOTSTRAP/fmlloader@1.20.1-47.2.0/net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.run(Launcher.java:108)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.main(Launcher.java:78)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
    at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:57)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:243)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:278)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)
p0t4t0sandwich commented 1 year ago

There we go! I was able to fake the registries with a datapack, so now I just need to figure a nice and easy way of including this into the plugin. (only took recompiling their mod and some trial and error) I should be able to put a proper solution together tomorrow, but in the meantime here's the datapack: mod_packet_fix.zip

This should work with v1.0.1, you'll just need to reconnect after the initial error. (currently it's how it temporarily flags users as Forge, hoping to fix that when I finish #1 )

I wonder if there's a way to automagically collect the resource keys sent from the client (assuming the client does send them)