本文整理汇总了Java中net.minecraft.entity.Entity.applyEntityCollision方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.applyEntityCollision方法的具体用法?Java Entity.applyEntityCollision怎么用?Java Entity.applyEntityCollision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.Entity
的用法示例。
在下文中一共展示了Entity.applyEntityCollision方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collideWithNearbyEntities
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
protected void collideWithNearbyEntities()
{
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox());
if (list != null && !list.isEmpty())
{
for (int i = 0; i < list.size(); ++i)
{
Entity entity = (Entity)list.get(i);
if (entity instanceof EntityMinecart && ((EntityMinecart)entity).getMinecartType() == EntityMinecart.EnumMinecartType.RIDEABLE && this.getDistanceSqToEntity(entity) <= 0.2D)
{
entity.applyEntityCollision(this);
}
}
}
}
示例2: collideWithNearbyEntities
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected void collideWithNearbyEntities() {
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.2, 0, 0.2));
if (list != null && !list.isEmpty())
for (int i = 0; i < list.size(); i++) {
Entity entity = list.get(i);
if (entity instanceof EntityMinecart && ((EntityMinecart) entity).getMinecartType() == 0)
entity.applyEntityCollision(this);
}
}
示例3: collideWithNearbyEntities
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
protected void collideWithNearbyEntities()
{
List<Entity> list = this.world.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_RIDEABLE_MINECART);
for (int i = 0; i < list.size(); ++i)
{
Entity entity = (Entity)list.get(i);
if (this.getDistanceSqToEntity(entity) <= 0.2D)
{
entity.applyEntityCollision(this);
}
}
}
示例4: collideWithNearbyEntities
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
protected void collideWithNearbyEntities()
{
List<Entity> list = this.worldObj.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_RIDEABLE_MINECART);
for (int i = 0; i < list.size(); ++i)
{
Entity entity = (Entity)list.get(i);
if (this.getDistanceSqToEntity(entity) <= 0.2D)
{
entity.applyEntityCollision(this);
}
}
}