001package net.minecraftforge.common;
002
003import net.minecraft.util.AxisAlignedBB;
004import net.minecraft.entity.Entity;
005import net.minecraft.entity.item.EntityMinecart;
006
007/**
008 * This class defines a replacement for the default minecart collision code.
009 * Only one handler can be registered at a time. It it registered with EntityMinecart.registerCollisionHandler().
010 * If you use this, make it a configuration option.
011 * @author CovertJaguar
012 */
013public interface IMinecartCollisionHandler
014{
015
016    /**
017     * This basically replaces the function of the same name in EnityMinecart.
018     * Code in IMinecartHooks.applyEntityCollisionHook is still run.
019     * @param cart The cart that called the collision.
020     * @param other The object it collided with.
021     */
022    public void onEntityCollision(EntityMinecart cart, Entity other);
023
024    /**
025     * This function replaced the function of the same name in EntityMinecart.
026     * It is used to define whether minecarts collide with specific entities,
027     * for example items.
028     * @param cart The cart for which the collision box was requested.
029     * @param other The entity requesting the collision box.
030     * @return The collision box or null.
031     */
032    public AxisAlignedBB getCollisionBox(EntityMinecart cart, Entity other);
033
034    /**
035     * This function is used to define the box used for detecting minecart collisions.
036     * It is generally bigger that the normal collision box.
037     * @param cart The cart for which the collision box was requested.
038     * @return The collision box, cannot be null.
039     */
040    public AxisAlignedBB getMinecartCollisionBox(EntityMinecart cart);
041
042    /**
043     * This function replaces the function of the same name in EntityMinecart.
044     * It defines whether minecarts are solid to the player.
045     * @param cart The cart for which the bounding box was requested.
046     * @return The bounding box or null.
047     */
048    public AxisAlignedBB getBoundingBox(EntityMinecart cart);
049}
050