本文整理匯總了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);
}
示例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();
}
}
示例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;
}
}
示例4: abs
import net.minecraft.util.MathHelper; //導入方法依賴的package包/類
public static int abs(int p_abs_0_)
{
return MathHelper.abs_int(p_abs_0_);
}
示例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);
}
示例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);
}