Adds a config option to disable leashed creatures from teleporting with a player

This commit is contained in:
2021-11-01 18:44:10 +01:00
parent 20c3c93c06
commit aff0082906
3 changed files with 18 additions and 1 deletions

View File

@ -256,6 +256,11 @@ public abstract class Teleporter {
* @param origin <p>The portal the player is teleporting from</p>
*/
protected void teleportLeashedCreatures(Player player, Portal origin) {
//If this feature is disabled, just return
if (!Stargate.getGateConfig().handleLeashedCreatures()) {
return;
}
//Find any nearby leashed entities to teleport with the player
List<Creature> nearbyEntities = getLeashedCreatures(player);
//Teleport all creatures leashed by the player to the portal the player is to exit from