當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。