Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with ReplayMod #112

Closed
Johni0702 opened this issue Dec 14, 2018 · 5 comments
Closed

Incompatibility with ReplayMod #112

Johni0702 opened this issue Dec 14, 2018 · 5 comments
Assignees

Comments

@Johni0702
Copy link

When opening a replay in the ReplayMod with the 4.0.3.3-mc1.12.2 LiteLoader version of WDL installed (probably all other MC versions as well), the game crashes with:

java.lang.RuntimeException: WorldDownloader: Couldn't find any Field of type "interface io.netty.channel.Channel" from class "class com.replaymod.replay.ReplayHandler$1" !
	at wdl.ReflectionUtils.findField(ReflectionUtils.java:91) ~[ReflectionUtils.class:?]
	at wdl.ReflectionUtils.findAndGetPrivateField(ReflectionUtils.java:118) ~[ReflectionUtils.class:?]
	at net.minecraft.client.network.NetHandlerPlayClient.handler$init$zzd000(NetHandlerPlayClient.java:2266) ~[brz.class:?]
	at net.minecraft.client.network.NetHandlerPlayClient.<init>(NetHandlerPlayClient.java:287) ~[brz.class:?]
	at com.replaymod.replay.ReplayHandler.setup(ReplayHandler.java:179) ~[ReplayHandler.class:?]
	at com.replaymod.replay.ReplayHandler.<init>(ReplayHandler.java:105) ~[ReplayHandler.class:?]

Channel channel = ReflectionUtils.findAndGetPrivateField(networkManagerIn, Channel.class);

which is to be expected considering the ReplayMod uses an extended NetworkManager class during replay.
If I'm not mistaken, the fix for this should be as simple as replacing the call to findAndGetPrivateField(networkManagerIn, Channel.class) with findAndGetPrivateField(networkManagerIn, NetworkManager.class, Channel.class)

@Pokechu22 Pokechu22 self-assigned this Dec 14, 2018
@Pokechu22 Pokechu22 added the bug label Dec 14, 2018
@Pokechu22
Copy link
Owner

Is this crash specifically only when playing back replays, or does it also happen during normal gameplay/saving replays? I haven't messed with replaymod much though I do understand the basic idea of how it works.

The fix you've included looks like it would be correct in terms of fixing the crash, but I'm not 100% sure I even want to be running that code if it only applies during playback (though, also, I don't know how I'd sanely detect that case; checking if the network manager class doesn't match exactly seem correct and I don't think there's any harm to running the code).

Pokechu22 added a commit that referenced this issue Dec 15, 2018
@Pokechu22
Copy link
Owner

I've applied the fix you wrote. I haven't tested how it works with replaymod yet (though I did confirm that it doesn't break code in normal cases via my unit tests). Thanks for the report!

@NPCtom
Copy link

NPCtom commented Jan 5, 2019

Also why does this have the "litemod-only" tag. Doesn't WDL REQUIRE LiteLoader and not Forge.

@Pokechu22
Copy link
Owner

It's as opposed to the base edit version (which is incompatible with everything, so this issue wouldn't apply to it). Probably not a super useful label, but I set the labels up a long time ago and now I'm just using them :P

@Pokechu22
Copy link
Owner

This should be fixed as of v4.0.4.0. Let me know if it's still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants