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


Java BlockLiquid.func_190972_g方法代码示例

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


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

示例1: checkInWater

import net.minecraft.block.BlockLiquid; //导入方法依赖的package包/类
private boolean checkInWater()
{
    AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
    int i = MathHelper.floor(axisalignedbb.minX);
    int j = MathHelper.ceil(axisalignedbb.maxX);
    int k = MathHelper.floor(axisalignedbb.minY);
    int l = MathHelper.ceil(axisalignedbb.minY + 0.001D);
    int i1 = MathHelper.floor(axisalignedbb.minZ);
    int j1 = MathHelper.ceil(axisalignedbb.maxZ);
    boolean flag = false;
    this.waterLevel = Double.MIN_VALUE;
    BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

    try
    {
        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.world.getBlockState(blockpos$pooledmutableblockpos);

                    if (iblockstate.getMaterial() == Material.WATER)
                    {
                        float f = BlockLiquid.func_190972_g(iblockstate, this.world, blockpos$pooledmutableblockpos);
                        this.waterLevel = Math.max((double)f, this.waterLevel);
                        flag |= axisalignedbb.minY < (double)f;
                    }
                }
            }
        }
    }
    finally
    {
        blockpos$pooledmutableblockpos.release();
    }

    return flag;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:EntityBoat.java

示例2: getUnderwaterStatus

import net.minecraft.block.BlockLiquid; //导入方法依赖的package包/类
@Nullable

    /**
     * Decides whether the boat is currently underwater.
     */
    private EntityBoat.Status getUnderwaterStatus()
    {
        AxisAlignedBB axisalignedbb = this.getEntityBoundingBox();
        double d0 = axisalignedbb.maxY + 0.001D;
        int i = MathHelper.floor(axisalignedbb.minX);
        int j = MathHelper.ceil(axisalignedbb.maxX);
        int k = MathHelper.floor(axisalignedbb.maxY);
        int l = MathHelper.ceil(d0);
        int i1 = MathHelper.floor(axisalignedbb.minZ);
        int j1 = MathHelper.ceil(axisalignedbb.maxZ);
        boolean flag = false;
        BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

        try
        {
            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.world.getBlockState(blockpos$pooledmutableblockpos);

                        if (iblockstate.getMaterial() == Material.WATER && d0 < (double)BlockLiquid.func_190972_g(iblockstate, this.world, blockpos$pooledmutableblockpos))
                        {
                            if (((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() != 0)
                            {
                                EntityBoat.Status entityboat$status = EntityBoat.Status.UNDER_FLOWING_WATER;
                                return entityboat$status;
                            }

                            flag = true;
                        }
                    }
                }
            }
        }
        finally
        {
            blockpos$pooledmutableblockpos.release();
        }

        return flag ? EntityBoat.Status.UNDER_WATER : null;
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:51,代码来源:EntityBoat.java

示例3: render

import net.minecraft.block.BlockLiquid; //导入方法依赖的package包/类
public void render(float p_190060_1_, long p_190060_2_)
{
    this.player = this.minecraft.player;
    this.xo = this.player.lastTickPosX + (this.player.posX - this.player.lastTickPosX) * (double)p_190060_1_;
    this.yo = this.player.lastTickPosY + (this.player.posY - this.player.lastTickPosY) * (double)p_190060_1_;
    this.zo = this.player.lastTickPosZ + (this.player.posZ - this.player.lastTickPosZ) * (double)p_190060_1_;
    BlockPos blockpos = this.minecraft.player.getPosition();
    World world = this.minecraft.player.world;
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(0.0F, 1.0F, 0.0F, 0.75F);
    GlStateManager.disableTexture2D();
    GlStateManager.glLineWidth(6.0F);

    for (BlockPos blockpos1 : BlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos1);

        if (iblockstate.getBlock() == Blocks.WATER || iblockstate.getBlock() == Blocks.FLOWING_WATER)
        {
            double d0 = (double)BlockLiquid.func_190972_g(iblockstate, world, blockpos1);
            RenderGlobal.renderFilledBox((new AxisAlignedBB((double)((float)blockpos1.getX() + 0.01F), (double)((float)blockpos1.getY() + 0.01F), (double)((float)blockpos1.getZ() + 0.01F), (double)((float)blockpos1.getX() + 0.99F), d0, (double)((float)blockpos1.getZ() + 0.99F))).offset(-this.xo, -this.yo, -this.zo), 1.0F, 1.0F, 1.0F, 0.2F);
        }
    }

    for (BlockPos blockpos2 : BlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate1 = world.getBlockState(blockpos2);

        if (iblockstate1.getBlock() == Blocks.WATER || iblockstate1.getBlock() == Blocks.FLOWING_WATER)
        {
            Integer integer = (Integer)iblockstate1.getValue(BlockLiquid.LEVEL);
            double d1 = integer.intValue() > 7 ? 0.9D : 1.0D - 0.11D * (double)integer.intValue();
            String s = iblockstate1.getBlock() == Blocks.FLOWING_WATER ? "f" : "s";
            DebugRenderer.renderDebugText(s + " " + integer, (double)blockpos2.getX() + 0.5D, (double)blockpos2.getY() + d1, (double)blockpos2.getZ() + 0.5D, p_190060_1_, -16777216);
        }
    }

    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:DebugRendererWater.java


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