當前位置: 首頁>>代碼示例>>Java>>正文


Java AxisAlignedBB.intersectsWith方法代碼示例

本文整理匯總了Java中net.minecraft.util.AxisAlignedBB.intersectsWith方法的典型用法代碼示例。如果您正苦於以下問題:Java AxisAlignedBB.intersectsWith方法的具體用法?Java AxisAlignedBB.intersectsWith怎麽用?Java AxisAlignedBB.intersectsWith使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.AxisAlignedBB的用法示例。


在下文中一共展示了AxisAlignedBB.intersectsWith方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addCollisionBoxesToList

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
/**
 * Add all collision boxes of this Block to the list that intersect with the given mask.
 */
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity)
{
    AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state);

    if (axisalignedbb != null && mask.intersectsWith(axisalignedbb))
    {
        list.add(axisalignedbb);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:13,代碼來源:Block.java

示例2: addCollisionBoxesToList

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
/**
 * Add all collision boxes of this Block to the list that intersect with the
 * given mask.
 */
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask,
		List<AxisAlignedBB> list, Entity collidingEntity) {
	AxisAlignedBB axisalignedbb = this.getCollisionBoundingBox(worldIn, pos, state);

	if (axisalignedbb != null && mask.intersectsWith(axisalignedbb)) {
		list.add(axisalignedbb);
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:13,代碼來源:Block.java

示例3: addCollisionBoxesToList

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
@Overwrite
public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) {
    AxisAlignedBB boundingBox = this.getCollisionBoundingBox(worldIn, pos, state);

    if (collidingEntity instanceof EntityPlayerSP)
        boundingBox = EventManager.post(new BlockBB((Block) (Object) this, state, pos.getX(), pos.getY(), pos.getZ(), boundingBox)).getBoundingBox();

    if (boundingBox != null && mask.intersectsWith(boundingBox)) {
        list.add(boundingBox);
    }
}
 
開發者ID:SerenityEnterprises,項目名稱:SerenityCE,代碼行數:12,代碼來源:MixinBlock.java

示例4: getCollidingBoundingBoxes

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
public List<AxisAlignedBB> getCollidingBoundingBoxes(Entity entityIn, AxisAlignedBB bb)
{
    List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList();
    int i = MathHelper.floor_double(bb.minX);
    int j = MathHelper.floor_double(bb.maxX + 1.0D);
    int k = MathHelper.floor_double(bb.minY);
    int l = MathHelper.floor_double(bb.maxY + 1.0D);
    int i1 = MathHelper.floor_double(bb.minZ);
    int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);
    WorldBorder worldborder = this.getWorldBorder();
    boolean flag = entityIn.isOutsideBorder();
    boolean flag1 = this.isInsideBorder(worldborder, entityIn);
    IBlockState iblockstate = Blocks.stone.getDefaultState();
    BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

    for (int k1 = i; k1 < j; ++k1)
    {
        for (int l1 = i1; l1 < j1; ++l1)
        {
            if (this.isBlockLoaded(blockpos$mutableblockpos.func_181079_c(k1, 64, l1)))
            {
                for (int i2 = k - 1; i2 < l; ++i2)
                {
                    blockpos$mutableblockpos.func_181079_c(k1, i2, l1);

                    if (flag && flag1)
                    {
                        entityIn.setOutsideBorder(false);
                    }
                    else if (!flag && !flag1)
                    {
                        entityIn.setOutsideBorder(true);
                    }

                    IBlockState iblockstate1 = iblockstate;

                    if (worldborder.contains(blockpos$mutableblockpos) || !flag1)
                    {
                        iblockstate1 = this.getBlockState(blockpos$mutableblockpos);
                    }

                    iblockstate1.getBlock().addCollisionBoxesToList(this, blockpos$mutableblockpos, iblockstate1, bb, list, entityIn);
                }
            }
        }
    }

    double d0 = 0.25D;
    List<Entity> list1 = this.getEntitiesWithinAABBExcludingEntity(entityIn, bb.expand(d0, d0, d0));

    for (int j2 = 0; j2 < list1.size(); ++j2)
    {
        if (entityIn.riddenByEntity != list1 && entityIn.ridingEntity != list1)
        {
            AxisAlignedBB axisalignedbb = ((Entity)list1.get(j2)).getCollisionBoundingBox();

            if (axisalignedbb != null && axisalignedbb.intersectsWith(bb))
            {
                list.add(axisalignedbb);
            }

            axisalignedbb = entityIn.getCollisionBox((Entity)list1.get(j2));

            if (axisalignedbb != null && axisalignedbb.intersectsWith(bb))
            {
                list.add(axisalignedbb);
            }
        }
    }

    return list;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:73,代碼來源:World.java


注:本文中的net.minecraft.util.AxisAlignedBB.intersectsWith方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。