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


Java AxisAlignedBB.offset方法代碼示例

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


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

示例1: isNotColliding

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
/**
 * Checks if entity bounding box is not colliding with terrain
 */
private boolean isNotColliding(double x, double y, double z, double doubleIn)
{
    double d0 = (x - this.parentEntity.posX) / doubleIn;
    double d1 = (y - this.parentEntity.posY) / doubleIn;
    double d2 = (z - this.parentEntity.posZ) / doubleIn;
    AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();

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

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

    return true;
}
 
開發者ID:Herobone,項目名稱:HeroUtils,代碼行數:23,代碼來源:FlyMoveHelper.java

示例2: updateFlyHeight

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
private void updateFlyHeight()
{
    double h = 1;
    AxisAlignedBB box = WMinecraft.getPlayer().getEntityBoundingBox()
        .expand(0.0625, 0.0625, 0.0625);
    for(flyHeight = 0; flyHeight < WMinecraft.getPlayer().posY; flyHeight +=
        h)
    {
        AxisAlignedBB nextBox = box.offset(0, -flyHeight, 0);
        
        if(WMinecraft.getWorld().checkBlockCollision(nextBox))
        {
            if(h < 0.0625)
                break;
            
            flyHeight -= h;
            h /= 2;
        }
    }
}
 
開發者ID:Wurst-Imperium,項目名稱:Wurst-MC-1.12,代碼行數:21,代碼來源:FlightMod.java

示例3: isNotColliding

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
    double d0 = (x - this.parentEntity.posX) / p_179926_7_;
    double d1 = (y - this.parentEntity.posY) / p_179926_7_;
    double d2 = (z - 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.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
        {
            return false;
        }
    }

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

示例4: getOffsetBoundingBox

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
public static AxisAlignedBB getOffsetBoundingBox(AxisAlignedBB p_getOffsetBoundingBox_0_, Block.EnumOffsetType p_getOffsetBoundingBox_1_, BlockPos p_getOffsetBoundingBox_2_)
{
    int i = p_getOffsetBoundingBox_2_.getX();
    int j = p_getOffsetBoundingBox_2_.getZ();
    long k = (long)(i * 3129871) ^ (long)j * 116129781L;
    k = k * k * 42317861L + k * 11L;
    double d0 = ((double)((float)(k >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
    double d1 = ((double)((float)(k >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
    double d2 = 0.0D;

    if (p_getOffsetBoundingBox_1_ == Block.EnumOffsetType.XYZ)
    {
        d2 = ((double)((float)(k >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
    }

    return p_getOffsetBoundingBox_0_.offset(d0, d2, d1);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:18,代碼來源:BlockModelUtils.java

示例5: getHead

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
public static AxisAlignedBB getHead(EntityLivingBase target){
    double ymax = target.posY + target.getEyeHeight();
    AxisAlignedBB head = new AxisAlignedBB(target.posX - 0.25, ymax - 0.16, target.posZ - 0.25, target.posX + 0.25, ymax + 0.25, target.posZ + 0.25);
    //if (target instanceof EntityCreeper || target instanceof EntityEnderman || target instanceof EntityIronGolem)
    //	head=head.offset(0, -0.2, 0);
    if (target.width >= 0.63) {
        float offsetX = -MathHelper.sin(target.renderYawOffset * 0.017453292F) * Math.max(0f,target.width*0.6f-0.32f);
       // float f1 = -MathHelper.sin((rotationPitchIn + pitchOffset) * 0.017453292F);
        float offsetZ = MathHelper.cos(target.renderYawOffset * 0.017453292F) * Math.max(0f,target.width*0.6f-0.32f);
        /*double offsetX = MathHelper.cos(target.renderYawOffset / 180.0F * (float) Math.PI) * target.width / 2;
        double offsetZ = -(double) (MathHelper.sin(target.renderYawOffset / 180.0F * (float) Math.PI) * target.width / 2);// cos*/
        // double offsetX2=- (double)(MathHelper.sin(living.rotationYaw
        // / 180.0F * (float)Math.PI) * var5.width/2);
        // double offsetZ2=(double)(MathHelper.cos(living.rotationYaw /
        // 180.0F * (float)Math.PI) * var5.width/2);//cos
        // System.out.println("Offsets: "+offsetX+" "+offsetZ+"
        // "+offsetX2+" "+offsetZ2);
        head=head.offset(offsetX, 0, offsetZ);
    }
    return head;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:22,代碼來源:TF2Util.java

示例6: isNotColliding

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
/**
 * Checks if entity bounding box is not colliding with terrain
 */
private boolean isNotColliding(double x, double y, double z, double p_179926_7_) {
    double d0 = (x - this.parentEntity.posX) / p_179926_7_;
    double d1 = (y - this.parentEntity.posY) / p_179926_7_;
    double d2 = (z - this.parentEntity.posZ) / p_179926_7_;
    AxisAlignedBB axisalignedbb = this.parentEntity.getEntityBoundingBox();

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

        if (!this.parentEntity.world.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
            return false;
    }

    return true;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:19,代碼來源:EntityMerasmus.java

示例7: isNotColliding

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
/**
 * Checks if entity bounding box is not colliding with terrain
 */
private boolean isNotColliding(double x, double y, double z, double p_179926_7_)
{
    double d0 = (x - this.parentEntity.posX) / p_179926_7_;
    double d1 = (y - this.parentEntity.posY) / p_179926_7_;
    double d2 = (z - 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.getCollisionBoxes(this.parentEntity, axisalignedbb).isEmpty())
        {
            return false;
        }
    }

    return true;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:23,代碼來源:EntityGhast.java

示例8: getSelectedBoundingBox

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
@Nullable
@Override
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos)
{
    AxisAlignedBB bounds = getContent().selectionBounds.get(getSubtype(state)).orElse(null);
    if (bounds == DEFAULT_AABB_MARKER)
        return super.getSelectedBoundingBox(state, worldIn, pos);
    else
        return bounds != null ? bounds.offset(pos) : null;
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:11,代碼來源:BlockMixin.java

示例9: addCollisionBoxToList

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
protected static void addCollisionBoxToList(BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable AxisAlignedBB blockBox)
{
    if (blockBox != NULL_AABB)
    {
        AxisAlignedBB axisalignedbb = blockBox.offset(pos);

        if (entityBox.intersectsWith(axisalignedbb))
        {
            collidingBoxes.add(axisalignedbb);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:13,代碼來源:Block.java

示例10: func_190607_a

import net.minecraft.util.math.AxisAlignedBB; //導入方法依賴的package包/類
private AxisAlignedBB func_190607_a(AxisAlignedBB p_190607_1_)
{
    double d0 = (double)this.getExtendedProgress(this.progress);
    return p_190607_1_.offset((double)this.pos.getX() + d0 * (double)this.pistonFacing.getFrontOffsetX(), (double)this.pos.getY() + d0 * (double)this.pistonFacing.getFrontOffsetY(), (double)this.pos.getZ() + d0 * (double)this.pistonFacing.getFrontOffsetZ());
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:TileEntityPiston.java


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