From 0a079a1a908d0d6ed3ae1266a96a0ec21423e7b0 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Wed, 4 Dec 2024 15:54:08 +0100 Subject: [PATCH] Always load player in <= 1.21.3 --- .../de/florianmichael/viafabricplus/ViaFabricPlus.java | 1 - .../mixin/fixes/minecraft/entity/MixinPlayerEntity.java | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index 2c490c46..c4603f7b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -60,7 +60,6 @@ import java.util.concurrent.CompletableFuture; * - OXYGEN_BONUS 1.21 -> 1.20.5 handling is missing (only visual) * * TODO | Movement - * - Blip-jumping is not supported in <= 1.13.2 (https://github.com/ViaVersion/ViaFabricPlus/issues/225) * - 1.8 lava movement * - 1.13.2 water movement */ diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java index 8168775f..4f2dbc2d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java @@ -82,6 +82,13 @@ public abstract class MixinPlayerEntity extends LivingEntity { super(entityType, world); } + @Inject(method = "isLoaded", at = @At("HEAD"), cancellable = true) + public void alwaysLoadPlayer(CallbackInfoReturnable cir) { + if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { + cir.setReturnValue(true); + } + } + @ModifyConstant(method = "isSpaceAroundPlayerEmpty", constant = @Constant(doubleValue = 9.999999747378752E-6 /* 1.0E-5F */)) private double removeOffsetWhenCheckingSneakingCollision(double constant) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {