Stop flying your vehicle

This commit is contained in:
simibubi 2023-01-15 15:07:45 +01:00
parent 405b7cbc36
commit 85200fe48f
3 changed files with 4 additions and 2 deletions

View file

@ -340,8 +340,8 @@ public class ContraptionCollider {
contraptionEntity.registerColliding(entity);
entity.fallDistance = 0;
for (Entity rider : entity.getIndirectPassengers())
if (rider instanceof ServerPlayer playerRider)
playerRider.connection.aboveGroundTickCount = 0;
if (getPlayerType(rider) == PlayerType.CLIENT)
AllPackets.channel.sendToServer(new ClientMotionPacket(rider.getDeltaMovement(), true, 0));
boolean canWalk = bounce != 0 || slide == 0;
if (canWalk || !rotation.hasVerticalRotation()) {
if (canWalk)

View file

@ -53,6 +53,7 @@ public class ClientMotionPacket extends SimplePacketBase {
sender.causeFallDamage(sender.fallDistance, 1, DamageSource.FALL);
sender.fallDistance = 0;
sender.connection.aboveGroundTickCount = 0;
sender.connection.aboveGroundVehicleTickCount = 0;
}
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> sender),
new LimbSwingUpdatePacket(sender.getId(), sender.position(), limbSwing));

View file

@ -11,6 +11,7 @@ public-f net.minecraft.network.protocol.game.ClientboundPlayerAbilitiesPacket f_
public net.minecraft.server.MinecraftServer f_129744_ # storageSource
public net.minecraft.server.network.ServerGamePacketListenerImpl f_9737_ # aboveGroundTickCount
public net.minecraft.server.network.ServerGamePacketListenerImpl f_9739_ # aboveGroundVehicleTickCount
public net.minecraft.world.entity.Entity f_146795_ # removalReason
protected net.minecraft.world.entity.Entity m_19956_(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity$MoveFunction;)V # positionRider