Skip to content

Commit

Permalink
Fix crash x3
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Aug 21, 2024
1 parent 7350a04 commit 0108ffc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ 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,19 @@
package dev.ithundxr.railwaystweaks.mixin.compat.appleskin;

import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import squeek.appleskin.network.SyncHandler;

@Pseudo
@Mixin(SyncHandler.class)
public class SyncHandlerMixin {
@Inject(method = "onPlayerUpdate", at = @At("HEAD"), cancellable = true)
private static void railwaysTweaks$fixAppleSkinCrash(ServerPlayer player, CallbackInfo ci) {
if (player.connection == null)
ci.cancel();
}
}
5 changes: 3 additions & 2 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"package": "dev.ithundxr.railwaystweaks.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ServerPlayerMixin",
"LivingEntityMixin",
"ServerStatusPacketListenerImplMixin"
"ServerPlayerMixin",
"ServerStatusPacketListenerImplMixin",
"compat.appleskin.SyncHandlerMixin"
],
"client": [
"client.HttpTextureMixin",
Expand Down

0 comments on commit 0108ffc

Please sign in to comment.