Java Code Examples for net.minecraft.util.MathHelper.func_154354_b()

The following are Jave code examples for showing how to use func_154354_b() of the net.minecraft.util.MathHelper class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BaseClient   File: SpawnerAnimals.java   Source Code and License Vote up 5 votes
protected static BlockPos getRandomChunkPosition(World worldIn, int x, int z)
{
    Chunk chunk = worldIn.getChunkFromChunkCoords(x, z);
    int i = x * 16 + worldIn.rand.nextInt(16);
    int j = z * 16 + worldIn.rand.nextInt(16);
    int k = MathHelper.func_154354_b(chunk.getHeight(new BlockPos(i, 0, j)) + 1, 16);
    int l = worldIn.rand.nextInt(k > 0 ? k : chunk.getTopFilledSegment() + 16 - 1);
    return new BlockPos(i, l, j);
}
 
Example 2
Project: BaseClient   File: SpawnerAnimals.java   Source Code and License Vote up 5 votes
protected static BlockPos getRandomChunkPosition(World worldIn, int x, int z)
{
    Chunk chunk = worldIn.getChunkFromChunkCoords(x, z);
    int i = x * 16 + worldIn.rand.nextInt(16);
    int j = z * 16 + worldIn.rand.nextInt(16);
    int k = MathHelper.func_154354_b(chunk.getHeight(new BlockPos(i, 0, j)) + 1, 16);
    int l = worldIn.rand.nextInt(k > 0 ? k : chunk.getTopFilledSegment() + 16 - 1);
    return new BlockPos(i, l, j);
}
 
Example 3
Project: BaseClient   File: RealmsMth.java   Source Code and License Vote up 4 votes
public static int roundUp(int p_roundUp_0_, int p_roundUp_1_)
{
    return MathHelper.func_154354_b(p_roundUp_0_, p_roundUp_1_);
}
 
Example 4
Project: BaseClient   File: RealmsMth.java   Source Code and License Vote up 4 votes
public static int roundUp(int p_roundUp_0_, int p_roundUp_1_)
{
    return MathHelper.func_154354_b(p_roundUp_0_, p_roundUp_1_);
}