本文整理汇总了Java中net.minecraft.util.MathHelper.bucketInt方法的典型用法代码示例。如果您正苦于以下问题:Java MathHelper.bucketInt方法的具体用法?Java MathHelper.bucketInt怎么用?Java MathHelper.bucketInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.MathHelper
的用法示例。
在下文中一共展示了MathHelper.bucketInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRenderChunk
import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
protected RenderChunk getRenderChunk(BlockPos pos)
{
int i = MathHelper.bucketInt(pos.getX(), 16);
int j = MathHelper.bucketInt(pos.getY(), 16);
int k = MathHelper.bucketInt(pos.getZ(), 16);
if (j >= 0 && j < this.countChunksY)
{
i = i % this.countChunksX;
if (i < 0)
{
i += this.countChunksX;
}
k = k % this.countChunksZ;
if (k < 0)
{
k += this.countChunksZ;
}
int l = (k * this.countChunksY + j) * this.countChunksX + i;
return this.renderChunks[l];
}
else
{
return null;
}
}
示例2: intFloorDiv
import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
public static int intFloorDiv(int p_intFloorDiv_0_, int p_intFloorDiv_1_)
{
return MathHelper.bucketInt(p_intFloorDiv_0_, p_intFloorDiv_1_);
}
示例3: markBlocksForUpdate
import net.minecraft.util.MathHelper; //导入方法依赖的package包/类
public void markBlocksForUpdate(int fromX, int fromY, int fromZ, int toX, int toY, int toZ)
{
int i = MathHelper.bucketInt(fromX, 16);
int j = MathHelper.bucketInt(fromY, 16);
int k = MathHelper.bucketInt(fromZ, 16);
int l = MathHelper.bucketInt(toX, 16);
int i1 = MathHelper.bucketInt(toY, 16);
int j1 = MathHelper.bucketInt(toZ, 16);
for (int k1 = i; k1 <= l; ++k1)
{
int l1 = k1 % this.countChunksX;
if (l1 < 0)
{
l1 += this.countChunksX;
}
for (int i2 = j; i2 <= i1; ++i2)
{
int j2 = i2 % this.countChunksY;
if (j2 < 0)
{
j2 += this.countChunksY;
}
for (int k2 = k; k2 <= j1; ++k2)
{
int l2 = k2 % this.countChunksZ;
if (l2 < 0)
{
l2 += this.countChunksZ;
}
int i3 = (l2 * this.countChunksY + j2) * this.countChunksX + l1;
RenderChunk renderchunk = this.renderChunks[i3];
renderchunk.setNeedsUpdate(true);
}
}
}
}