mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-07 09:42:03 +01:00
Implemented sprinting condition changes in 1.19.x protocols
This commit is contained in:
parent
9878f247bd
commit
aa7191801d
@ -17,12 +17,8 @@
|
||||
*/
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.WrapWithCondition;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import de.florianmichael.viafabricplus.definition.ClientsideFixes;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.world.GameMode;
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
import de.florianmichael.viafabricplus.settings.impl.DebugSettings;
|
||||
@ -220,6 +216,22 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
return value;
|
||||
}
|
||||
|
||||
@Redirect(method = "canStartSprinting", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isFallFlying()Z"))
|
||||
public boolean removeElytraMovementCheck(ClientPlayerEntity instance) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
|
||||
return false;
|
||||
}
|
||||
return instance.isFallFlying();
|
||||
}
|
||||
|
||||
@Redirect(method = "canSprint", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;hasVehicle()Z"))
|
||||
public boolean removeVehicleCondition(ClientPlayerEntity instance) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) {
|
||||
return false;
|
||||
}
|
||||
return instance.hasVehicle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCreative() {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) {
|
||||
|
Loading…
Reference in New Issue
Block a user