mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-25 12:25:22 +01:00
Add entity movement changes in <= 1.21.1
This commit is contained in:
parent
3195eeb5a0
commit
5d7dd8b247
@ -34,10 +34,12 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/*
|
||||
* TODO | Port 1.21.3
|
||||
* - VehicleMovePacket handling now has distance check
|
||||
* - Game options are now only send if they changed
|
||||
* - Illusioner/Sniffer doesn't override visibility bounding box anymore
|
||||
* - AbstractFireabll#shouldRender new
|
||||
* - VehicleMovePacket handling now has distance check in ClientPlayNetworkHandler
|
||||
* - Illusioner/Sniffer don't override visibility bounding box anymore
|
||||
* - AbstractFireabll/EyeOfEnder#shouldRender new
|
||||
* - Entity#baseTick doesn't set prev rotation anymore at top
|
||||
* - LivingEntity movement code got refactored completely
|
||||
* - BundleItem#use, ConsumableComponent behaviour in use functions
|
||||
*
|
||||
* TODO | Port 1.20.6
|
||||
* - ClientPlayerInteractionManager#interactBlockInternal added new condition
|
||||
|
@ -86,6 +86,24 @@ public abstract class MixinEntity implements IEntity {
|
||||
@Unique
|
||||
private boolean viaFabricPlus$isInLoadedChunkAndShouldTick;
|
||||
|
||||
@Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/Vec3d;lengthSquared()D"))
|
||||
private double allowSmallValues(Vec3d instance) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
|
||||
return 0;
|
||||
} else {
|
||||
return instance.lengthSquared();
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "setPitch", at = @At(value = "INVOKE", target = "Ljava/lang/Math;clamp(FFF)F", remap = false))
|
||||
private float dontClampPitch(float value, float min, float max) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21)) {
|
||||
return value;
|
||||
} else {
|
||||
return Math.clamp(value, min, max);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "adjustMovementForCollisions(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;", at = @At("HEAD"), cancellable = true)
|
||||
private void use1_20_6StepCollisionCalculation(Vec3d movement, CallbackInfoReturnable<Vec3d> cir) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_5)) {
|
||||
|
Loading…
Reference in New Issue
Block a user