Add support for teleportation of entities connected through a lead #4

Closed
opened 2021-10-11 01:42:32 +02:00 by EpicKnarvik97 · 3 comments

While entities can be transported through minecarts/boats, creatures like llamas would be easiest to be able to teleport as long as the player is teleporting and holding them in a lead. As it's not directly vehicle teleportation, it should probably have its own setting.

To make this work properly, we probably need to recursively get all lead entities, teleport the last one and re-lead once the parent is teleported. Placing might be a problem for a lot of entities, but it can probably be solved.

It must be accounted for that a player may be riding a horse or donkey while leading llamas, so checking must happen before any teleportation, and regardless if the player is riding a vehicle or not. Must check if it's possible to lead entities while riding in a minecart or boat too.

While entities can be transported through minecarts/boats, creatures like llamas would be easiest to be able to teleport as long as the player is teleporting and holding them in a lead. As it's not directly vehicle teleportation, it should probably have its own setting. To make this work properly, we probably need to recursively get all lead entities, teleport the last one and re-lead once the parent is teleported. Placing might be a problem for a lot of entities, but it can probably be solved. It must be accounted for that a player may be riding a horse or donkey while leading llamas, so checking must happen before any teleportation, and regardless if the player is riding a vehicle or not. Must check if it's possible to lead entities while riding in a minecart or boat too.
EpicKnarvik97 added the
enhancement
label 2021-10-11 01:42:32 +02:00
Author
Owner

For Llamas, even if only one llama is led, they make a caravan. We must make sure all llamas in the caravan is included in the teleportation.

I don't really know how to decide exactly where to teleport the entities to. Perhaps just try to teleport all to the same location and hope for the best?

For Llamas, even if only one llama is led, they make a caravan. We must make sure all llamas in the caravan is included in the teleportation. I don't really know how to decide exactly where to teleport the entities to. Perhaps just try to teleport all to the same location and hope for the best?
EpicKnarvik97 added this to the Better stargates project 2021-10-22 15:47:38 +02:00
Author
Owner

The teleportation is a bit buggy. Might need to unleash and then re-leash. Might also need to keep chunks loaded. Maybe use getWorld().getNearbyEntities(event.getFrom(), radius, radius, radius) on the location the player teleported from to make sure the player has not already teleported?

The teleportation is a bit buggy. Might need to unleash and then re-leash. Might also need to keep chunks loaded. Maybe use getWorld().getNearbyEntities(event.getFrom(), radius, radius, radius) on the location the player teleported from to make sure the player has not already teleported?
Author
Owner

Teleportation of leashed entities seems to work in 20c3c93c06. It doesn't seem like caravans are a concept in the Spigot API, so this feature probably needs to be delayed until the API supports it.

Teleportation of leashed entities seems to work in 20c3c93c06. It doesn't seem like caravans are a concept in the Spigot API, so this feature probably needs to be delayed until the API supports it.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: EpicKnarvik97/Stargate#4
No description provided.