本文整理匯總了Java中net.minecraft.util.math.ChunkPos.getXEnd方法的典型用法代碼示例。如果您正苦於以下問題:Java ChunkPos.getXEnd方法的具體用法?Java ChunkPos.getXEnd怎麽用?Java ChunkPos.getXEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.util.math.ChunkPos
的用法示例。
在下文中一共展示了ChunkPos.getXEnd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generate
import net.minecraft.util.math.ChunkPos; //導入方法依賴的package包/類
public boolean generate(World worldIn, Random rand, BlockPos position)
{
Random random = worldIn.getChunkFromBlockCoords(position).getRandomWithSeed(987234911L);
MinecraftServer minecraftserver = worldIn.getMinecraftServer();
Rotation[] arotation = Rotation.values();
Rotation rotation = arotation[random.nextInt(arotation.length)];
int i = random.nextInt(FOSSILS.length);
TemplateManager templatemanager = worldIn.getSaveHandler().getStructureTemplateManager();
Template template = templatemanager.getTemplate(minecraftserver, FOSSILS[i]);
Template template1 = templatemanager.getTemplate(minecraftserver, FOSSILS_COAL[i]);
ChunkPos chunkpos = new ChunkPos(position);
StructureBoundingBox structureboundingbox = new StructureBoundingBox(chunkpos.getXStart(), 0, chunkpos.getZStart(), chunkpos.getXEnd(), 256, chunkpos.getZEnd());
PlacementSettings placementsettings = (new PlacementSettings()).setRotation(rotation).setBoundingBox(structureboundingbox).setRandom(random);
BlockPos blockpos = template.transformedSize(rotation);
int j = random.nextInt(16 - blockpos.getX());
int k = random.nextInt(16 - blockpos.getZ());
int l = 256;
for (int i1 = 0; i1 < blockpos.getX(); ++i1)
{
for (int j1 = 0; j1 < blockpos.getX(); ++j1)
{
l = Math.min(l, worldIn.getHeight(position.getX() + i1 + j, position.getZ() + j1 + k));
}
}
int k1 = Math.max(l - 15 - random.nextInt(10), 10);
BlockPos blockpos1 = template.getZeroPositionWithTransform(position.add(j, k1, k), Mirror.NONE, rotation);
placementsettings.setIntegrity(0.9F);
template.addBlocksToWorld(worldIn, blockpos1, placementsettings, 20);
placementsettings.setIntegrity(0.1F);
template1.addBlocksToWorld(worldIn, blockpos1, placementsettings, 20);
return true;
}
示例2: generate
import net.minecraft.util.math.ChunkPos; //導入方法依賴的package包/類
public boolean generate(World worldIn, Random rand, BlockPos position)
{
Random random = worldIn.getChunkFromChunkCoords(position.getX(), position.getZ()).getRandomWithSeed(987234911L);
MinecraftServer minecraftserver = worldIn.getMinecraftServer();
Rotation[] arotation = Rotation.values();
Rotation rotation = arotation[random.nextInt(arotation.length)];
int i = random.nextInt(FOSSILS.length);
TemplateManager templatemanager = worldIn.getSaveHandler().getStructureTemplateManager();
Template template = templatemanager.getTemplate(minecraftserver, FOSSILS[i]);
Template template1 = templatemanager.getTemplate(minecraftserver, FOSSILS_COAL[i]);
ChunkPos chunkpos = new ChunkPos(position);
StructureBoundingBox structureboundingbox = new StructureBoundingBox(chunkpos.getXStart(), 0, chunkpos.getZStart(), chunkpos.getXEnd(), 256, chunkpos.getZEnd());
PlacementSettings placementsettings = (new PlacementSettings()).setRotation(rotation).setBoundingBox(structureboundingbox).setRandom(random);
BlockPos blockpos = template.transformedSize(rotation);
int j = random.nextInt(16 - blockpos.getX());
int k = random.nextInt(16 - blockpos.getZ());
int l = 256;
for (int i1 = 0; i1 < blockpos.getX(); ++i1)
{
for (int j1 = 0; j1 < blockpos.getX(); ++j1)
{
l = Math.min(l, worldIn.getHeightmapHeight(position.getX() + i1 + j, position.getZ() + j1 + k));
}
}
int k1 = Math.max(l - 15 - random.nextInt(10), 10);
BlockPos blockpos1 = template.getZeroPositionWithTransform(position.add(j, k1, k), Mirror.NONE, rotation);
placementsettings.setIntegrity(0.9F);
template.addBlocksToWorld(worldIn, blockpos1, placementsettings, 4);
placementsettings.setIntegrity(0.1F);
template1.addBlocksToWorld(worldIn, blockpos1, placementsettings, 4);
return true;
}
示例3: drawChunk
import net.minecraft.util.math.ChunkPos; //導入方法依賴的package包/類
private void drawChunk(ChunkPos chunk, Double heat, double pY){
double[] c = Graphical.heatToColor(heat / 10);
GL11.glColor4d(c[0],c[1],c[2],0.4);
int xStart = chunk.getXStart();
int zStart = chunk.getZStart();
int xEnd = chunk.getXEnd() + 1;
int zEnd = chunk.getZEnd() + 1;
GL11.glVertex3d(xEnd, pY + 80 , zStart );
GL11.glVertex3d(xEnd, pY + 80 , zEnd );
GL11.glVertex3d(xStart, pY + 80 , zEnd );
GL11.glVertex3d(xStart, pY + 80 , zStart );
}
示例4: contains
import net.minecraft.util.math.ChunkPos; //導入方法依賴的package包/類
public boolean contains(ChunkPos range)
{
return (double)range.getXEnd() > this.minX() && (double)range.getXStart() < this.maxX() && (double)range.getZEnd() > this.minZ() && (double)range.getZStart() < this.maxZ();
}