当前位置: 首页>>代码示例>>Java>>正文


Java Entity.isOutsideBorder方法代码示例

本文整理汇总了Java中net.minecraft.entity.Entity.isOutsideBorder方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.isOutsideBorder方法的具体用法?Java Entity.isOutsideBorder怎么用?Java Entity.isOutsideBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.isOutsideBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isInsideBorder

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public boolean isInsideBorder(WorldBorder worldBorderIn, Entity entityIn)
{
    double d0 = worldBorderIn.minX();
    double d1 = worldBorderIn.minZ();
    double d2 = worldBorderIn.maxX();
    double d3 = worldBorderIn.maxZ();

    if (entityIn.isOutsideBorder())
    {
        ++d0;
        ++d1;
        --d2;
        --d3;
    }
    else
    {
        --d0;
        --d1;
        ++d2;
        ++d3;
    }

    return entityIn.posX > d0 && entityIn.posX < d2 && entityIn.posZ > d1 && entityIn.posZ < d3;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:World.java

示例2: func_191503_g

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public boolean func_191503_g(Entity p_191503_1_)
{
    double d0 = this.worldBorder.minX();
    double d1 = this.worldBorder.minZ();
    double d2 = this.worldBorder.maxX();
    double d3 = this.worldBorder.maxZ();

    if (p_191503_1_.isOutsideBorder())
    {
        ++d0;
        ++d1;
        --d2;
        --d3;
    }
    else
    {
        --d0;
        --d1;
        ++d2;
        ++d3;
    }

    return p_191503_1_.posX > d0 && p_191503_1_.posX < d2 && p_191503_1_.posZ > d1 && p_191503_1_.posZ < d3;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:World.java

示例3: getCollidingBoundingBoxes

import net.minecraft.entity.Entity; //导入方法依赖的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

示例4: func_191504_a

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
private boolean func_191504_a(@Nullable Entity p_191504_1_, AxisAlignedBB p_191504_2_, boolean p_191504_3_, @Nullable List<AxisAlignedBB> p_191504_4_)
{
    int i = MathHelper.floor(p_191504_2_.minX) - 1;
    int j = MathHelper.ceil(p_191504_2_.maxX) + 1;
    int k = MathHelper.floor(p_191504_2_.minY) - 1;
    int l = MathHelper.ceil(p_191504_2_.maxY) + 1;
    int i1 = MathHelper.floor(p_191504_2_.minZ) - 1;
    int j1 = MathHelper.ceil(p_191504_2_.maxZ) + 1;
    WorldBorder worldborder = this.getWorldBorder();
    boolean flag = p_191504_1_ != null && p_191504_1_.isOutsideBorder();
    boolean flag1 = p_191504_1_ != null && this.func_191503_g(p_191504_1_);
    IBlockState iblockstate = Blocks.STONE.getDefaultState();
    BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

    try
    {
        for (int k1 = i; k1 < j; ++k1)
        {
            for (int l1 = i1; l1 < j1; ++l1)
            {
                boolean flag2 = k1 == i || k1 == j - 1;
                boolean flag3 = l1 == i1 || l1 == j1 - 1;

                if ((!flag2 || !flag3) && this.isBlockLoaded(blockpos$pooledmutableblockpos.setPos(k1, 64, l1)))
                {
                    for (int i2 = k; i2 < l; ++i2)
                    {
                        if (!flag2 && !flag3 || i2 != l - 1)
                        {
                            if (p_191504_3_)
                            {
                                if (k1 < -30000000 || k1 >= 30000000 || l1 < -30000000 || l1 >= 30000000)
                                {
                                    boolean lvt_21_1_ = true;
                                    return lvt_21_1_;
                                }
                            }
                            else if (p_191504_1_ != null && flag == flag1)
                            {
                                p_191504_1_.setOutsideBorder(!flag1);
                            }

                            blockpos$pooledmutableblockpos.setPos(k1, i2, l1);
                            IBlockState iblockstate1;

                            if (!p_191504_3_ && !worldborder.contains(blockpos$pooledmutableblockpos) && flag1)
                            {
                                iblockstate1 = iblockstate;
                            }
                            else
                            {
                                iblockstate1 = this.getBlockState(blockpos$pooledmutableblockpos);
                            }

                            iblockstate1.addCollisionBoxToList(this, blockpos$pooledmutableblockpos, p_191504_2_, p_191504_4_, p_191504_1_, false);

                            if (p_191504_3_ && !p_191504_4_.isEmpty())
                            {
                                boolean flag5 = true;
                                return flag5;
                            }
                        }
                    }
                }
            }
        }
    }
    finally
    {
        blockpos$pooledmutableblockpos.release();
    }

    return !p_191504_4_.isEmpty();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:75,代码来源:World.java


注:本文中的net.minecraft.entity.Entity.isOutsideBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。