當前位置: 首頁>>代碼示例>>Java>>正文


Java ChunkPos.getZEnd方法代碼示例

本文整理匯總了Java中net.minecraft.util.math.ChunkPos.getZEnd方法的典型用法代碼示例。如果您正苦於以下問題:Java ChunkPos.getZEnd方法的具體用法?Java ChunkPos.getZEnd怎麽用?Java ChunkPos.getZEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.math.ChunkPos的用法示例。


在下文中一共展示了ChunkPos.getZEnd方法的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;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:35,代碼來源:WorldGenFossils.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:35,代碼來源:WorldGenFossils.java

示例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 );


    }
 
開發者ID:TerminatorNL,項目名稱:LagGoggles,代碼行數:20,代碼來源:LagOverlayGui.java

示例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();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:5,代碼來源:WorldBorder.java


注:本文中的net.minecraft.util.math.ChunkPos.getZEnd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。