Fixed compact with baritone

This commit is contained in:
FlorianMichael 2023-11-20 23:05:25 +01:00
parent 7c79145bc8
commit 10b4633a50
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 9 additions and 9 deletions

View File

@ -183,15 +183,6 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
return instance.hasVehicle();
}
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;checkFallFlying()Z"))
public boolean makeElytraMovementServerside(ClientPlayerEntity instance) {
// Elytra movement was serverside in <= 1.14.4 and got moved to the client in 1.15
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) {
return !this.isOnGround() && this.getVelocity().y < 0.0 && !isFallFlying();
}
return instance.checkFallFlying();
}
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isClimbing()Z"))
public boolean removeLadderCheck(ClientPlayerEntity instance) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_1)) {

View File

@ -17,6 +17,7 @@
*/
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.*;
import net.minecraft.util.Hand;
import net.raphimc.vialoader.util.VersionEnum;
@ -133,4 +134,12 @@ public abstract class MixinPlayerEntity extends LivingEntity {
}
return instance.isSprinting();
}
@Inject(method = "checkFallFlying", at = @At("HEAD"), cancellable = true)
public void makeElytraMovementServerside(CallbackInfoReturnable<Boolean> cir) {
// Elytra movement was serverside in <= 1.14.4 and got moved to the client in 1.15
if ((Object) this instanceof ClientPlayerEntity && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) {
cir.setReturnValue(!this.isOnGround() && this.getVelocity().y < 0.0 && !isFallFlying());
}
}
}