本文整理汇总了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);
}