Interface IMinecartCollisionHandler


public interface IMinecartCollisionHandler
This class defines a replacement for the default minecart collision code. Only one handler can be registered at a time. It it registered with AbstractMinecartEntity.registerCollisionHandler(). If you use this, make it a configuration option.
  • Method Details

    • onEntityCollision

      void onEntityCollision(AbstractMinecart cart, Entity other)
      This basically replaces the function of the same name in EntityMinecart. Code in IMinecartHooks.applyEntityCollisionHook is still run.
      Parameters:
      cart - The cart that called the collision.
      other - The object it collided with.
    • getCollisionBox

      AABB getCollisionBox(AbstractMinecart cart, Entity other)
      This function replaced the function of the same name in EntityMinecart. It is used to define whether minecarts collide with specific entities, for example items.
      Parameters:
      cart - The cart for which the collision box was requested.
      other - The entity requesting the collision box.
      Returns:
      The collision box or null.
    • getMinecartCollisionBox

      AABB getMinecartCollisionBox(AbstractMinecart cart)
      This function is used to define the box used for detecting minecart collisions. It is generally bigger that the normal collision box.
      Parameters:
      cart - The cart for which the collision box was requested.
      Returns:
      The collision box, cannot be null.
    • getBoundingBox

      AABB getBoundingBox(AbstractMinecart cart)
      This function replaces the function of the same name in EntityMinecart. It defines whether minecarts are solid to the player.
      Parameters:
      cart - The cart for which the bounding box was requested.
      Returns:
      The bounding box or null.