Ignore expired player public keys during replay
These would otherwise fail to be initialized and cause the game to disconnect itself on the first chat message from the corresponding player.
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
// 1.19+ only
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
"world_border.Mixin_UseReplayTime_ForMovement",
|
"world_border.Mixin_UseReplayTime_ForMovement",
|
||||||
"world_border.Mixin_UseReplayTime_ForTexture",
|
"world_border.Mixin_UseReplayTime_ForTexture",
|
||||||
"Mixin_FixNPCSkinCaching",
|
"Mixin_FixNPCSkinCaching",
|
||||||
|
//#if MC>=11900
|
||||||
|
//$$ "Mixin_AllowExpiredPlayerKeys",
|
||||||
|
//#endif
|
||||||
//#if MC>=11800
|
//#if MC>=11800
|
||||||
//$$ "Mixin_FixEntityNotTracking",
|
//$$ "Mixin_FixEntityNotTracking",
|
||||||
//#endif
|
//#endif
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.replaymod.replay.mixin;
|
||||||
|
|
||||||
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
|
import net.minecraft.network.encryption.PlayerPublicKey;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(PlayerPublicKey.PublicKeyData.class)
|
||||||
|
public abstract class Mixin_AllowExpiredPlayerKeys {
|
||||||
|
@Inject(method = "isExpired", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void neverExpireWhenInReplay(CallbackInfoReturnable<Boolean> ci) {
|
||||||
|
if (ReplayModReplay.instance.getReplayHandler() != null) {
|
||||||
|
ci.setReturnValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user