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


Java AxisAlignedBB.offset方法代碼示例

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


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

示例1: isNotColliding

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
private boolean isNotColliding(double p_179926_1_, double p_179926_3_, double p_179926_5_, double p_179926_7_)
{
    double d0 = (p_179926_1_ - this.parentEntity.posX) / p_179926_7_;
    double d1 = (p_179926_3_ - this.parentEntity.posY) / p_179926_7_;
    double d2 = (p_179926_5_ - this.parentEntity.posZ) / p_179926_7_;
    AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();

    for (int i = 1; (double)i < p_179926_7_; ++i)
    {
        axisalignedbb = axisalignedbb.offset(d0, d1, d2);

        if (!this.parentEntity.worldObj.getCollidingBoundingBoxes(this.parentEntity, axisalignedbb).isEmpty())
        {
            return false;
        }
    }

    return true;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:EntityGhast.java

示例2: isCourseTraversable

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
private static boolean isCourseTraversable(Entity_AA aa, double posX, double posY, double posZ, double distanceSq)
{
    double d4 = (aa.waypointX - aa.posX) / distanceSq;
    double d5 = (aa.waypointY - aa.posY) / distanceSq;
    double d6 = (aa.waypointZ - aa.posZ) / distanceSq;
    
    AxisAlignedBB axisalignedbb = aa.boundingBox.copy();

    for (int i = 1; (double)i < distanceSq; ++i)
    {
        axisalignedbb.offset(d4, d5, d6);

        if (!aa.worldObj.getCollidingBoundingBoxes(aa, axisalignedbb).isEmpty())
        {
            return false;
        }
    }

    return true;
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:21,代碼來源:AI_Movement.java

示例3: onUpdateNavigation

import net.minecraft.util.AxisAlignedBB; //導入方法依賴的package包/類
public void onUpdateNavigation()
{
    ++this.totalTicks;

    if (!this.noPath())
    {
        if (this.canNavigate())
        {
            this.pathFollow();
        }
        else if (this.currentPath != null && this.currentPath.getCurrentPathIndex() < this.currentPath.getCurrentPathLength())
        {
            Vec3 vec3 = this.getEntityPosition();
            Vec3 vec31 = this.currentPath.getVectorFromIndex(this.theEntity, this.currentPath.getCurrentPathIndex());

            if (vec3.yCoord > vec31.yCoord && !this.theEntity.onGround && MathHelper.floor_double(vec3.xCoord) == MathHelper.floor_double(vec31.xCoord) && MathHelper.floor_double(vec3.zCoord) == MathHelper.floor_double(vec31.zCoord))
            {
                this.currentPath.setCurrentPathIndex(this.currentPath.getCurrentPathIndex() + 1);
            }
        }

        if (!this.noPath())
        {
            Vec3 vec32 = this.currentPath.getPosition(this.theEntity);

            if (vec32 != null)
            {
                AxisAlignedBB axisalignedbb1 = (new AxisAlignedBB(vec32.xCoord, vec32.yCoord, vec32.zCoord, vec32.xCoord, vec32.yCoord, vec32.zCoord)).expand(0.5D, 0.5D, 0.5D);
                List<AxisAlignedBB> list = this.worldObj.getCollidingBoundingBoxes(this.theEntity, axisalignedbb1.addCoord(0.0D, -1.0D, 0.0D));
                double d0 = -1.0D;
                axisalignedbb1 = axisalignedbb1.offset(0.0D, 1.0D, 0.0D);

                for (AxisAlignedBB axisalignedbb : list)
                {
                    d0 = axisalignedbb.calculateYOffset(axisalignedbb1, d0);
                }

                this.theEntity.getMoveHelper().setMoveTo(vec32.xCoord, vec32.yCoord + d0, vec32.zCoord, this.speed);
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:43,代碼來源:PathNavigate.java


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