mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-25 12:25:22 +01:00
Fixed bad packet checks
This commit is contained in:
parent
9453d26b81
commit
c61605775f
@ -19,7 +19,6 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import de.florianmichael.viafabricplus.base.settings.groups.DebugSettings;
|
||||
import de.florianmichael.viafabricplus.definition.v1_8.ArmorPointCalculation;
|
||||
import de.florianmichael.viafabricplus.injection.access.IClientPlayerEntity;
|
||||
@ -167,6 +166,14 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isClimbing()Z"))
|
||||
public boolean alwaysSendPacket(ClientPlayerEntity instance) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) {
|
||||
return false;
|
||||
}
|
||||
return isClimbing();
|
||||
}
|
||||
|
||||
@Redirect(method = "autoJump", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;inverseSqrt(F)F"))
|
||||
public float useFastInverse(float x) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) {
|
||||
|
@ -17,8 +17,8 @@
|
||||
*/
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity;
|
||||
|
||||
import net.minecraft.util.Hand;
|
||||
import net.raphimc.vialoader.util.VersionEnum;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings;
|
||||
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
|
||||
import net.minecraft.entity.EntityDimensions;
|
||||
@ -31,7 +31,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.world.World;
|
||||
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@ -115,6 +114,13 @@ public abstract class MixinPlayerEntity extends LivingEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "dropItem(Lnet/minecraft/item/ItemStack;ZZ)Lnet/minecraft/entity/ItemEntity;", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;swingHand(Lnet/minecraft/util/Hand;)V"))
|
||||
public void dontSwingHand(PlayerEntity instance, Hand hand) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_15_2)) return;
|
||||
|
||||
instance.swingHand(hand);
|
||||
}
|
||||
|
||||
@Unique
|
||||
public boolean viafabricplus_isSprinting;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user