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