mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-02-17 01:52:28 +01:00
Fixed compact with baritone
This commit is contained in:
parent
7c79145bc8
commit
10b4633a50
@ -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)) {
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user