本文整理匯總了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}