2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2019-02-10 22:57:03 +00:00
|
|
|
* Copyright (c) 2016-2019.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2012-08-07 23:54:14 +00:00
|
|
|
package net.minecraftforge.common;
|
2012-02-25 06:07:58 +00:00
|
|
|
|
2016-03-02 09:44:41 +00:00
|
|
|
import net.minecraft.util.math.AxisAlignedBB;
|
2012-12-13 05:58:35 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
2019-05-23 23:02:15 +00:00
|
|
|
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
2012-02-25 06:07:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This class defines a replacement for the default minecart collision code.
|
|
|
|
* Only one handler can be registered at a time. It it registered with EntityMinecart.registerCollisionHandler().
|
|
|
|
* If you use this, make it a configuration option.
|
|
|
|
* @author CovertJaguar
|
|
|
|
*/
|
|
|
|
public interface IMinecartCollisionHandler
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2016-03-23 14:34:48 +00:00
|
|
|
* This basically replaces the function of the same name in EntityMinecart.
|
2012-02-25 06:07:58 +00:00
|
|
|
* Code in IMinecartHooks.applyEntityCollisionHook is still run.
|
|
|
|
* @param cart The cart that called the collision.
|
|
|
|
* @param other The object it collided with.
|
|
|
|
*/
|
2019-05-23 23:02:15 +00:00
|
|
|
void onEntityCollision(AbstractMinecartEntity cart, Entity other);
|
2012-02-25 06:07:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
* @param cart The cart for which the collision box was requested.
|
|
|
|
* @param other The entity requesting the collision box.
|
|
|
|
* @return The collision box or null.
|
|
|
|
*/
|
2019-05-23 23:02:15 +00:00
|
|
|
AxisAlignedBB getCollisionBox(AbstractMinecartEntity cart, Entity other);
|
2012-02-25 06:07:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used to define the box used for detecting minecart collisions.
|
|
|
|
* It is generally bigger that the normal collision box.
|
|
|
|
* @param cart The cart for which the collision box was requested.
|
|
|
|
* @return The collision box, cannot be null.
|
|
|
|
*/
|
2019-05-23 23:02:15 +00:00
|
|
|
AxisAlignedBB getMinecartCollisionBox(AbstractMinecartEntity cart);
|
2012-02-25 06:07:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function replaces the function of the same name in EntityMinecart.
|
|
|
|
* It defines whether minecarts are solid to the player.
|
|
|
|
* @param cart The cart for which the bounding box was requested.
|
|
|
|
* @return The bounding box or null.
|
|
|
|
*/
|
2019-05-23 23:02:15 +00:00
|
|
|
AxisAlignedBB getBoundingBox(AbstractMinecartEntity cart);
|
2012-02-25 06:07:58 +00:00
|
|
|
}
|
|
|
|
|