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


Java Vec3d.ZERO屬性代碼示例

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


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

示例1: getFogColor

@Override
	@SideOnly(Side.CLIENT)
	public Vec3d getFogColor(float p_76562_1_, float p_76562_2_)
	{
//		generateLightBrightnessTable();
//        float f = MathHelper.cos(p_76562_1_ * ((float)Math.PI * 2F)) * 2.0F + 0.5F;
//        f = MathHelper.clamp(f, 0.0F, 1.0F);
//        int color = 0;
//        float f1 = ((color >> 16) & 0xFF) * 255;
//        float f2 = ((color >> 8) & 0xFF) * 255;
//        float f3 = ((color >> 0) & 0xFF) * 255;
//        f1 = f1 * (f * 0.0F + 0.15F);
//        f2 = f2 * (f * 0.0F + 0.15F);
//        f3 = f3 * (f * 0.0F + 0.15F);
//        return new Vec3d((double)f1, (double)f2, (double)f3);
		return Vec3d.ZERO;
	}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:17,代碼來源:PontusWorldProvider.java

示例2: func_190949_e

@Deprecated
public Vec3d func_190949_e(IBlockState p_190949_1_, IBlockAccess p_190949_2_, BlockPos p_190949_3_)
{
    Block.EnumOffsetType block$enumoffsettype = this.getOffsetType();

    if (block$enumoffsettype == Block.EnumOffsetType.NONE)
    {
        return Vec3d.ZERO;
    }
    else
    {
        long i = MathHelper.getCoordinateRandom(p_190949_3_.getX(), 0, p_190949_3_.getZ());
        return new Vec3d(((double)((float)(i >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D, block$enumoffsettype == Block.EnumOffsetType.XYZ ? ((double)((float)(i >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D : 0.0D, ((double)((float)(i >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:15,代碼來源:Block.java

示例3: checkForStuck

/**
 * Checks if entity haven't been moved when last checked and if so, clears current {@link
 * net.minecraft.pathfinding.PathEntity}
 */
protected void checkForStuck(Vec3d positionVec3)
{
    if (this.totalTicks - this.ticksAtLastPos > 100)
    {
        if (positionVec3.squareDistanceTo(this.lastPosCheck) < 2.25D)
        {
            this.clearPathEntity();
        }

        this.ticksAtLastPos = this.totalTicks;
        this.lastPosCheck = positionVec3;
    }

    if (this.currentPath != null && !this.currentPath.isFinished())
    {
        Vec3d vec3d = this.currentPath.getCurrentPos();

        if (vec3d.equals(this.timeoutCachedNode))
        {
            this.timeoutTimer += System.currentTimeMillis() - this.lastTimeoutCheck;
        }
        else
        {
            this.timeoutCachedNode = vec3d;
            double d0 = positionVec3.distanceTo(this.timeoutCachedNode);
            this.timeoutLimit = this.theEntity.getAIMoveSpeed() > 0.0F ? d0 / (double)this.theEntity.getAIMoveSpeed() * 1000.0D : 0.0D;
        }

        if (this.timeoutLimit > 0.0D && (double)this.timeoutTimer > this.timeoutLimit * 3.0D)
        {
            this.timeoutCachedNode = Vec3d.ZERO;
            this.timeoutTimer = 0L;
            this.timeoutLimit = 0.0D;
            this.clearPathEntity();
        }

        this.lastTimeoutCheck = System.currentTimeMillis();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:43,代碼來源:PathNavigate.java

示例4: handleMaterialAcceleration

/**
 * handles the acceleration of an object whilst in water. Not sure if it is used elsewhere.
 */
public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)
{
    int i = MathHelper.floor(bb.minX);
    int j = MathHelper.ceil(bb.maxX);
    int k = MathHelper.floor(bb.minY);
    int l = MathHelper.ceil(bb.maxY);
    int i1 = MathHelper.floor(bb.minZ);
    int j1 = MathHelper.ceil(bb.maxZ);

    if (!this.isAreaLoaded(i, k, i1, j, l, j1, true))
    {
        return false;
    }
    else
    {
        boolean flag = false;
        Vec3d vec3d = Vec3d.ZERO;
        BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

        for (int k1 = i; k1 < j; ++k1)
        {
            for (int l1 = k; l1 < l; ++l1)
            {
                for (int i2 = i1; i2 < j1; ++i2)
                {
                    blockpos$pooledmutableblockpos.setPos(k1, l1, i2);
                    IBlockState iblockstate = this.getBlockState(blockpos$pooledmutableblockpos);
                    Block block = iblockstate.getBlock();

                    if (iblockstate.getMaterial() == materialIn)
                    {
                        double d0 = (double)((float)(l1 + 1) - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()));

                        if ((double)l >= d0)
                        {
                            flag = true;
                            vec3d = block.modifyAcceleration(this, blockpos$pooledmutableblockpos, entityIn, vec3d);
                        }
                    }
                }
            }
        }

        blockpos$pooledmutableblockpos.release();

        if (vec3d.lengthVector() > 0.0D && entityIn.isPushedByWater())
        {
            vec3d = vec3d.normalize();
            double d1 = 0.014D;
            entityIn.motionX += vec3d.xCoord * 0.014D;
            entityIn.motionY += vec3d.yCoord * 0.014D;
            entityIn.motionZ += vec3d.zCoord * 0.014D;
        }

        return flag;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:60,代碼來源:World.java

示例5: getPositionVector

/**
 * Get the position vector. <b>{@code null} is not allowed!</b> If you are not an entity in the world, return 0.0D,
 * 0.0D, 0.0D
 */
public Vec3d getPositionVector()
{
    return Vec3d.ZERO;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:RConConsoleSource.java

示例6: handleMaterialAcceleration

/**
 * handles the acceleration of an object whilst in water. Not sure if it is used elsewhere.
 */
public boolean handleMaterialAcceleration(AxisAlignedBB bb, Material materialIn, Entity entityIn)
{
    int i = MathHelper.floor_double(bb.minX);
    int j = MathHelper.ceiling_double_int(bb.maxX);
    int k = MathHelper.floor_double(bb.minY);
    int l = MathHelper.ceiling_double_int(bb.maxY);
    int i1 = MathHelper.floor_double(bb.minZ);
    int j1 = MathHelper.ceiling_double_int(bb.maxZ);

    if (!this.isAreaLoaded(i, k, i1, j, l, j1, true))
    {
        return false;
    }
    else
    {
        boolean flag = false;
        Vec3d vec3d = Vec3d.ZERO;
        BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

        for (int k1 = i; k1 < j; ++k1)
        {
            for (int l1 = k; l1 < l; ++l1)
            {
                for (int i2 = i1; i2 < j1; ++i2)
                {
                    blockpos$pooledmutableblockpos.setPos(k1, l1, i2);
                    IBlockState iblockstate = this.getBlockState(blockpos$pooledmutableblockpos);
                    Block block = iblockstate.getBlock();

                    Boolean result = block.isEntityInsideMaterial(this, blockpos$pooledmutableblockpos, iblockstate, entityIn, (double)l, materialIn, false);
                    if (result != null && result == true)
                    {
                        // Forge: When requested call blocks modifyAcceleration method, and more importantly cause this method to return true, which results in an entity being "inWater"
                        flag = true;
                        vec3d = block.modifyAcceleration(this, blockpos$pooledmutableblockpos, entityIn, vec3d);
                        continue;
                    }
                    else if (result != null && result == false) continue;

                    if (iblockstate.getMaterial() == materialIn)
                    {
                        double d0 = (double)((float)(l1 + 1) - BlockLiquid.getLiquidHeightPercent(((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue()));

                        if ((double)l >= d0)
                        {
                            flag = true;
                            vec3d = block.modifyAcceleration(this, blockpos$pooledmutableblockpos, entityIn, vec3d);
                        }
                    }
                }
            }
        }

        blockpos$pooledmutableblockpos.release();

        if (vec3d.lengthVector() > 0.0D && entityIn.isPushedByWater())
        {
            vec3d = vec3d.normalize();
            double d1 = 0.014D;
            entityIn.motionX += vec3d.xCoord * 0.014D;
            entityIn.motionY += vec3d.yCoord * 0.014D;
            entityIn.motionZ += vec3d.zCoord * 0.014D;
        }

        return flag;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:70,代碼來源:World.java

示例7: createDefault

public static ExPWorld createDefault()
{
	ExPWorld ret = new ExPWorld();
	ret.windDirection = Vec3d.ZERO;
	return ret;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:ExPWorld.java


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