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

crash with CubicChunksCore #365

Open
4 tasks done
anatawa12 opened this issue Nov 14, 2021 · 4 comments
Open
4 tasks done

crash with CubicChunksCore #365

anatawa12 opened this issue Nov 14, 2021 · 4 comments
Assignees
Labels
bug Something isn't working in fixRTM Comp::fixRTM Component: fixRTM compatibility compatibility with other mods

Comments

@anatawa12
Copy link
Member

anatawa12 commented Nov 14, 2021

Before submitting a bug, please make sure following checks.

  • You have finished loading all model packs before login to world/server.
  • You're using the latest stable, snapshot, or daily-snapshot version of fixRTM.
  • You're using correct version of RTM and NGTLib for your fixRTM.
  • You couldn't find same bag in the issues.

Descrive the bug

Original: https://discord.com/channels/749186892733480970/749187907033497601/909110518697042001

Crashes the game with CubicChunksCore.

java.lang.NoClassDefFoundError: net/minecraft/entity/EntityTracker
	at net.minecraft.world.WorldServer.<init>(WorldServer.java:112)
	at net.minecraft.server.integrated.IntegratedServer.func_71247_a(IntegratedServer.java:132)
	at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:233)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: net.minecraft.entity.EntityTracker
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 5 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:208)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:178)
	at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72)
	at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
	at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
	... 7 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [cubicchunks.mixins.core.json:common.MixinEntityTracker] from phase [DEFAULT] in config [cubicchunks.mixins.core.json] FAILED during APPLY
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:642)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinApplyError(MixinProcessor.java:594)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:356)
	... 12 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @Redirect ctor invocation was not found in net/minecraft/entity/EntityTracker::func_72785_a(Lnet/minecraft/entity/Entity;IIZ)V [INJECT Applicator Phase -> cubicchunks.mixins.core.json:common.MixinEntityTracker -> Apply Injections ->  -> Inject -> cubicchunks.mixins.core.json:common.MixinEntityTracker->@Redirect::onCreateEntry(Lnet/minecraft/entity/Entity;IIIZ)Lnet/minecraft/entity/EntityTrackerEntry;]
	at org.spongepowered.asm.mixin.injection.invoke.RedirectInjector.postInject(RedirectInjector.java:368)
	at org.spongepowered.asm.mixin.injection.code.Injector.inject(Injector.java:268)
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.inject(InjectionInfo.java:385)
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1284)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1042)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:395)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:320)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:345)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:569)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:351)
	... 12 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @Redirect ctor invocation was not found in net/minecraft/entity/EntityTracker::func_72785_a(Lnet/minecraft/entity/Entity;IIZ)V
	at org.spongepowered.asm.mixin.injection.invoke.RedirectInjector.injectAtConstructor(RedirectInjector.java:616)
	at org.spongepowered.asm.mixin.injection.invoke.RedirectInjector.inject(RedirectInjector.java:339)
	at org.spongepowered.asm.mixin.injection.code.Injector.inject(Injector.java:264)
	... 20 more

message (2).txt

To Reproduce

Launch the game with CubicChunksCore

Expected Behavior

No Crash

Actual Behavior

Crashes

OS

Windows 8.1 (amd64) version 6.3

Minecraft Forge Version

14.23.5.2855

fixRTM Version

2.0.20

Other Mods

CubicChunksCore

@anatawa12 anatawa12 added bug Something isn't working in fixRTM Comp::fixRTM Component: fixRTM compatibility compatibility with other mods labels Nov 14, 2021
@anatawa12 anatawa12 self-assigned this Nov 14, 2021
@anatawa12
Copy link
Member Author

https://github.com/OpenCubicChunks/CubicChunks/blob/dc16fef38129b86de11cd8a0c94069dd8eab56e4/src/main/java/io/github/opencubicchunks/cubicchunks/core/asm/mixin/core/common/MixinEntityTracker.java#L59-L60
According to this code, OpenCubicChunks depends on the instantiation of EntityTrackerEntry in EntityTracker#track method.

However, the fixRTM replaces all instantiation of EntityTrackerEntry to fixRTM's hook method in the following code.

class NewEntityTrackerVisitor(mv: MethodVisitor) : MethodVisitor(Opcodes.ASM5, mv) {
var afterNew = false
override fun visitTypeInsn(opcode: Int, type: String?) {
if (opcode == Opcodes.NEW && type == "net/minecraft/entity/EntityTrackerEntry")
afterNew = true
super.visitTypeInsn(opcode, type)
}
override fun visitMethodInsn(opcode: Int, owner: String?, name: String?, desc: String?, itf: Boolean) {
if (afterNew
&& opcode == Opcodes.INVOKESPECIAL
&& owner == "net/minecraft/entity/EntityTrackerEntry"
&& name == "<init>"
&& desc == "(Lnet/minecraft/entity/Entity;IIIZ)V"
) {
afterNew = false
super.visitMethodInsn(Opcodes.INVOKESTATIC,
"com/anatawa12/fixRtm/rtm/entity/vehicle/VehicleTrackerEntryKt",
"newEntityTrackerEntry",
"(Lnet/minecraft/entity/Entity;IIIZ)Lnet/minecraft/entity/EntityTrackerEntry;",
false)
super.visitInsn(Opcodes.SWAP)
super.visitInsn(Opcodes.POP)
super.visitInsn(Opcodes.SWAP)
super.visitInsn(Opcodes.POP)
return
}
super.visitMethodInsn(opcode, owner, name, desc, itf)
}
}

This makes incompatibility.

@anatawa12
Copy link
Member Author

If OpenCubicChunks provide us the way to detect if OpenCubicChunks is installed, if OpenCubicChunks is installed, It's possible to suppress replacing instantiation of EntityTrackerEntry in EntityTracker#track method and replace instantiation in OpenCubicChunks's hook instead.

@anatawa12
Copy link
Member Author

RTM is compatible with OCC so I'll fix this

@anatawa12
Copy link
Member Author

OpenCubicChunks/CubicChunks#741 (comment)

Leaving it open for now because i would like to attempt to fix it. I should be able to do it in about 2 weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in fixRTM Comp::fixRTM Component: fixRTM compatibility compatibility with other mods
Projects
None yet
Development

No branches or pull requests

1 participant