/*------------------------------------------------------------------------------
 Copyright (c) CovertJaguar, 2011-2016

 This work (the API) is licensed under the "MIT" License,
 see LICENSE.md for details.
 -----------------------------------------------------------------------------*/

package mods.railcraft.api.carts;

import net.minecraft.entity.item.EntityMinecart;

import javax.annotation.Nullable;
import java.util.UUID;

/**
 * The LinkageManager contains all the functions needed to link and interact
 * with linked carts.
 * <p/>
 * To obtain an instance of this interface, call CartTools.getLinkageManager().
 * <p/>
 * Each cart can up to two links. They are called Link A and Link B. Some carts
 * will have only Link A, for example the Tunnel Bore.
 *
 * @author CovertJaguar <http://www.railcraft.info>
 * @see CartToolsAPI , ILinkableCart
 */
public interface ILinkageManager {

    /**
     * The default max distance at which carts can be linked, divided by 2.
     */
    float LINKAGE_DISTANCE = 1.25f;
    /**
     * The default distance at which linked carts are maintained, divided by 2.
     */
    float OPTIMAL_DISTANCE = 0.78f;

    boolean setAutoLink(EntityMinecart cart, boolean autoLink);

    boolean hasAutoLink(EntityMinecart cart);

    boolean tryAutoLink(EntityMinecart cart1, EntityMinecart cart2);

    /**
     * Creates a link between two carts, but only if there is nothing preventing
     * such a link.
     *
     * @return True if the link succeeded.
     */
    boolean createLink(EntityMinecart cart1, EntityMinecart cart2);

    boolean hasFreeLink(EntityMinecart cart);

    /**
     * Returns the cart linked to Link A or null if nothing is currently
     * occupying Link A.
     *
     * @param cart The cart for which to get the link
     * @return The linked cart or null
     */
    @Nullable
    EntityMinecart getLinkedCartA(EntityMinecart cart);

    /**
     * Returns the cart linked to Link B or null if nothing is currently
     * occupying Link B.
     *
     * @param cart The cart for which to get the link
     * @return The linked cart or null
     */
    @Nullable
    EntityMinecart getLinkedCartB(EntityMinecart cart);

    /**
     * Returns true if the two carts are linked to each other.
     *
     * @return True if linked
     */
    boolean areLinked(EntityMinecart cart1, EntityMinecart cart2);

    /**
     * Breaks a link between two carts, if any link exists.
     */
    void breakLink(EntityMinecart cart1, EntityMinecart cart2);

    /**
     * Breaks all links the cart has.
     */
    void breakLinks(EntityMinecart cart);

    /**
     * Break only link A.
     */
    void breakLinkA(EntityMinecart cart);

    /**
     * Break only link B.
     */
    void breakLinkB(EntityMinecart cart);

    /**
     * Counts how many carts are in the train.
     *
     * @param cart Any cart in the train
     * @return The number of carts in the train
     */
    @SuppressWarnings("unused")
    int countCartsInTrain(EntityMinecart cart);

    /**
     * Returns an iterator which will iterate over every cart in the provided cart's train.
     *
     * There is no guarantee of order.
     */
    Iterable<EntityMinecart> trainIterator(EntityMinecart cart);

    /**
     * Given a persistent Entity UUID, it will return a matching minecart,
     * assuming one is loaded in the world.
     * <p/>
     * The Mapping is stored in a Map<UUID, EntityMinecart> so its fairly fast.
     * <p/>
     * This would probably be better in CartTools, but
     * Railcraft really only uses it for linking and this was the
     * easiest way to expose it.
     *
     * @param id Persistent Entity UUID
     * @return A Minecart
     */
    @Nullable
    EntityMinecart getCartFromUUID(UUID id);

}

@@ -115,9 +115,9 @@
 -201
-6
+7
 %0A%0A T
@@ -3259,472 +3259,90 @@
   * 
-Given a persistent Entity UUID, it will return a matching minecart,%0A     * assuming one is loaded in the world.%0A     * %3Cp/%3E%0A     * The Mapping is stored in a Map%3CUUID, EntityMinecart%3E so its fairly fast.%0A     * %3Cp/%3E%0A     * This would probably be better in CartTools, but%0A     * Railcraft really only uses it for linking and this was the%0A     * easiest way to expose it.%0A     *%0A     * @param id Persistent Entity UUID%0A     * @return A Minecart%0A     */%0A    @Nullable
+Replaced with WorldServer#getEntityFromUuid.%0A     */%0A    @Nullable%0A    @Deprecated
 %0A   

Add Shunting Aura to Goggles and look at debug command