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] Create Steam n' Rails [BUG] #40

Open
Cartrigger opened this issue Sep 3, 2023 · 7 comments
Open

[Crash] Create Steam n' Rails [BUG] #40

Cartrigger opened this issue Sep 3, 2023 · 7 comments
Labels
crash Nothing is working

Comments

@Cartrigger
Copy link

Cartrigger commented Sep 3, 2023

What were you doing when the crash occured?

I was trying to start my game with Create Steam n' Rails, and it crashes.

Did the crash occur client-side or server-side?

Client

Version

sync-mc1.19.1-4.3

Minecraft Version

1.19.2

Fabric API Version

fabric-api-0.76.1+1.19.2

Installation Source

Modrinth

Logs

https://mclo.gs/Hng9Uhn

Other Mods

Create, Sodium, Indium, Create Steam n Rails (the issue.)

Additional Information

Using PrismLauncher

The issue says its standalone Create, but when SNR is not loaded, it starts with this log.

@Cartrigger Cartrigger added the crash Nothing is working label Sep 3, 2023
@Kir-Antipov
Copy link
Owner

org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector getFocusedEntity(Lnet/minecraft/class_4184;)Lnet/minecraft/class_1297; in sync.mixins.json:WorldRendererMixin from mod sync failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap sync-mc1.19.1-refmap.json

Yeah, that's kinda on me. This is the conflicting mixin:

/**
* This method forces renderer to render the player when they aren't a camera entity.
*/
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;getFocusedEntity()Lnet/minecraft/entity/Entity;", ordinal = 3), require = 1)
private Entity getFocusedEntity(Camera camera) {
ClientPlayerEntity player = this.client.player;
if (player != null && player != this.client.getCameraEntity() && !player.isSpectator()) {
return player;
}
return camera.getFocusedEntity();
}

Basically, we should never use Redirects and other intrusive mixins, but this the only way I could make a shell to be rendered whenever the camera leaves player's body.

I will think about how I can fix that.

@IThundxr
Copy link

org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector getFocusedEntity(Lnet/minecraft/class_4184;)Lnet/minecraft/class_1297; in sync.mixins.json:WorldRendererMixin from mod sync failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap sync-mc1.19.1-refmap.json

Yeah, that's kinda on me. This is the conflicting mixin:

/**
* This method forces renderer to render the player when they aren't a camera entity.
*/
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;getFocusedEntity()Lnet/minecraft/entity/Entity;", ordinal = 3), require = 1)
private Entity getFocusedEntity(Camera camera) {
ClientPlayerEntity player = this.client.player;
if (player != null && player != this.client.getCameraEntity() && !player.isSpectator()) {
return player;
}
return camera.getFocusedEntity();
}

Basically, we should never use Redirects and other intrusive mixins, but this the only way I could make a shell to be rendered whenever the camera leaves player's body.

I will think about how I can fix that.

Use https://github.com/LlamaLad7/MixinExtras/wiki/WrapOperation

@Kir-Antipov
Copy link
Owner

Yep, thankfully this is the solution now, since MixinExtras are bundled with Fabric, Quilt, and NeoForge. However, this issue was opened long before this became a reality ;)

@IThundxr
Copy link

IThundxr commented Apr 3, 2024

Yep, thankfully this is the solution now, since MixinExtras are bundled with Fabric, Quilt, and NeoForge. However, this issue was opened long before this became a reality ;)

You were always able to JiJ Mixin extras.

@Kir-Antipov
Copy link
Owner

Not really. Please, never use third-party mixins unless they are widely accepted by the community as a whole. Even if they seem super-duper cool and make your life easier, for somebody else this will turn out as a huge headache and a wasted weekend spent trying to catch an esoteric problem that had nothing to do with this particular someone's code in the first place.

@IThundxr
Copy link

IThundxr commented Apr 3, 2024

Not really. Please, never use third-party mixins unless they are widely accepted by the community as a whole. Even if they seem super-duper cool and make your life easier, for somebody else this will turn out as a huge headache and a wasted weekend spent trying to catch an esoteric problem that had nothing to do with this particular someone's code in the first place.

Yep this is the general rule I use however Mixin extras has been widely used for quite a while now and not really a random thing, hence why they are being included in neoforge and fabric now, they are also more stackable making it much easier for people to write mixins into the same place.

@Kir-Antipov
Copy link
Owner

they are also more stackable making it much easier for people to write mixins into the same place

Yup-yup, I already happily use them in my other projects, so I'm very glad that they are an official part of the modding scene now :)

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

No branches or pull requests

3 participants