Always load player in <= 1.21.3

This commit is contained in:
FlorianMichael 2024-12-04 15:54:08 +01:00
parent a77937670e
commit 0a079a1a90
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 7 additions and 1 deletions

View File

@ -60,7 +60,6 @@ import java.util.concurrent.CompletableFuture;
* - OXYGEN_BONUS 1.21 -> 1.20.5 handling is missing (only visual) * - OXYGEN_BONUS 1.21 -> 1.20.5 handling is missing (only visual)
* *
* TODO | Movement * TODO | Movement
* - Blip-jumping is not supported in <= 1.13.2 (https://github.com/ViaVersion/ViaFabricPlus/issues/225)
* - 1.8 lava movement * - 1.8 lava movement
* - 1.13.2 water movement * - 1.13.2 water movement
*/ */

View File

@ -82,6 +82,13 @@ public abstract class MixinPlayerEntity extends LivingEntity {
super(entityType, world); super(entityType, world);
} }
@Inject(method = "isLoaded", at = @At("HEAD"), cancellable = true)
public void alwaysLoadPlayer(CallbackInfoReturnable<Boolean> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) {
cir.setReturnValue(true);
}
}
@ModifyConstant(method = "isSpaceAroundPlayerEmpty", constant = @Constant(doubleValue = 9.999999747378752E-6 /* 1.0E-5F */)) @ModifyConstant(method = "isSpaceAroundPlayerEmpty", constant = @Constant(doubleValue = 9.999999747378752E-6 /* 1.0E-5F */))
private double removeOffsetWhenCheckingSneakingCollision(double constant) { private double removeOffsetWhenCheckingSneakingCollision(double constant) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {