Skip to content

Commit

Permalink
Fix crash again
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Aug 21, 2024
1 parent dbd2627 commit a8f7265
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 0 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ dependencies {
modImplementation("dev.ithundxr.createnumismatics:CreateNumismatics-fabric-1.20.1:1.0.6+fabric-mc1.20.1")

modCompileOnly("maven.modrinth:copycats:fabric.1.20.1-1.3.2")

modCompileOnly("maven.modrinth:appleskin:2.5.1+mc1.20")
}

tasks.processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dev.ithundxr.railwaystweaks.mixin;

import net.fabricmc.fabric.impl.event.interaction.FakePlayerNetworkHandler;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ServerPlayer.class)
public class ServerPlayerMixin {
@Shadow public ServerGamePacketListenerImpl connection;

@Inject(method = "tick", at = @At("HEAD"))
private void railwaysTweaks$preventNullNetworkHandlerCrash(CallbackInfo ci) {
if (connection == null)
connection = new FakePlayerNetworkHandler((ServerPlayer) (Object) this);
}
}

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"package": "dev.ithundxr.railwaystweaks.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ServerPlayerMixin",
"LivingEntityMixin",
"ServerStatusPacketListenerImplMixin",
"compat.appleskin.SyncHandlerMixin"
"ServerStatusPacketListenerImplMixin"
],
"client": [
"client.HttpTextureMixin",
Expand Down

0 comments on commit a8f7265

Please sign in to comment.