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


Java MathHelper.abs_int方法代码示例

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


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

示例1: getGreatestDistance

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
/**
 * Returns the absolute greatest distance in the BlockPos object.
 */
private int getGreatestDistance(BlockPos posIn)
{
    int i = MathHelper.abs_int(posIn.getX());
    int j = MathHelper.abs_int(posIn.getY());
    int k = MathHelper.abs_int(posIn.getZ());
    return k > i && k > j ? k : (j > i ? j : i);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:WorldGenBigTree.java

示例2: isBlockProtected

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
public boolean isBlockProtected(World worldIn, BlockPos pos, EntityPlayer playerIn)
{
    if (worldIn.provider.getDimensionId() != 0)
    {
        return false;
    }
    else if (this.getConfigurationManager().getOppedPlayers().isEmpty())
    {
        return false;
    }
    else if (this.getConfigurationManager().canSendCommands(playerIn.getGameProfile()))
    {
        return false;
    }
    else if (this.getSpawnProtectionSize() <= 0)
    {
        return false;
    }
    else
    {
        BlockPos blockpos = worldIn.getSpawnPoint();
        int i = MathHelper.abs_int(pos.getX() - blockpos.getX());
        int j = MathHelper.abs_int(pos.getZ() - blockpos.getZ());
        int k = Math.max(i, j);
        return k <= this.getSpawnProtectionSize();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:DedicatedServer.java

示例3: func_181562_a

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
private RenderChunk func_181562_a(BlockPos p_181562_1_, RenderChunk p_181562_2_, EnumFacing p_181562_3_)
{
    BlockPos blockpos = p_181562_2_.getPositionOffset16(p_181562_3_);

    if (blockpos.getY() >= 0 && blockpos.getY() < 256)
    {
        int i = MathHelper.abs_int(p_181562_1_.getX() - blockpos.getX());
        int j = MathHelper.abs_int(p_181562_1_.getZ() - blockpos.getZ());

        if (Config.isFogOff())
        {
            if (i > this.renderDistance || j > this.renderDistance)
            {
                return null;
            }
        }
        else
        {
            int k = i * i + j * j;

            if (k > this.renderDistanceSq)
            {
                return null;
            }
        }

        return this.viewFrustum.getRenderChunk(blockpos);
    }
    else
    {
        return null;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:RenderGlobal.java

示例4: abs

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
public static int abs(int p_abs_0_)
{
    return MathHelper.abs_int(p_abs_0_);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:RealmsMth.java

示例5: isPositionInRenderChunk

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
private boolean isPositionInRenderChunk(BlockPos pos, RenderChunk renderChunkIn)
{
    BlockPos blockpos = renderChunkIn.getPosition();
    return MathHelper.abs_int(pos.getX() - blockpos.getX()) > 16 ? false : (MathHelper.abs_int(pos.getY() - blockpos.getY()) > 16 ? false : MathHelper.abs_int(pos.getZ() - blockpos.getZ()) <= 16);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:RenderGlobal.java

示例6: func_181562_a

import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
private RenderChunk func_181562_a(BlockPos p_181562_1_, RenderChunk p_181562_2_, EnumFacing p_181562_3_)
{
    BlockPos blockpos = p_181562_2_.func_181701_a(p_181562_3_);
    return MathHelper.abs_int(p_181562_1_.getX() - blockpos.getX()) > this.renderDistanceChunks * 16 ? null : (blockpos.getY() >= 0 && blockpos.getY() < 256 ? (MathHelper.abs_int(p_181562_1_.getZ() - blockpos.getZ()) > this.renderDistanceChunks * 16 ? null : this.viewFrustum.getRenderChunk(blockpos)) : null);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:RenderGlobal.java


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