當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。