Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7075

Permit players to get teleported while being on a vehicle

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.19
    • Yes

      As it wasn't possible to teleport a player in the past without him leaving the vehicle he is in, Spigot is automatically dismounting the player to keep the client and the server synchronized. However, with the newer versions of Minecraft, there's a new parameter within the PacketPlayOutPosition packet (the packet that gets sent to the player when he is teleporting).

      My suggestion is to remove the following from CraftPlayer#teleport(Location location, PlayerTeleportEvent.TeleportCause cause):

      entity.stopRiding();

      and to adapt the methods that finally call

      PlayerConnection#internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set, boolean flag);

      The "flag" parameter is deciding whether the player shall be dismounted or not. As of now, Spigot is passing true to that method whenever Player#teleport is being called.

       

      It is not possible to properly teleport riding players without accessing NMS. My suggestion would change that.

            DiamondDagger590 Cynthia Yantis
            Marcel Marcel
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: