当前位置: 首页>>代码示例>>Java>>正文


Java ChunkCoordIntPair类代码示例

本文整理汇总了Java中net.minecraft.world.ChunkCoordIntPair的典型用法代码示例。如果您正苦于以下问题:Java ChunkCoordIntPair类的具体用法?Java ChunkCoordIntPair怎么用?Java ChunkCoordIntPair使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChunkCoordIntPair类属于net.minecraft.world包,在下文中一共展示了ChunkCoordIntPair类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: chunkLoadPostProcess

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
    if (chunk != null) {
        world.theChunkProviderServer.loadedChunkHashMap.add(ChunkCoordIntPair.chunkXZ2Int(x, z),chunk);
        world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility

        chunk.onChunkLoad();

        if (!chunk.isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z) && !world.theChunkProviderServer.provideChunk(x - 1, z).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z + 1) && world.theChunkProviderServer.chunkExists(x, z + 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z);
        }

        if (world.theChunkProviderServer.chunkExists(x, z - 1) && !world.theChunkProviderServer.provideChunk(x, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x + 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x + 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x, z - 1);
        }

        if (world.theChunkProviderServer.chunkExists(x - 1, z - 1) && !world.theChunkProviderServer.provideChunk(x - 1, z - 1).isTerrainPopulated && world.theChunkProviderServer.chunkExists(x - 1, z - 1) && world.theChunkProviderServer.chunkExists(x, z - 1) && world.theChunkProviderServer.chunkExists(x - 1, z)) {
            world.theChunkProviderServer.populate(world.theChunkProviderServer, x - 1, z - 1);
        }
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:25,代码来源:CraftWorld.java

示例2: loadChunk

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
/**
 * Loads the specified(XZ) chunk into the specified world.
 */
public Chunk loadChunk(World worldIn, int x, int z) throws IOException
{
    ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z);
    NBTTagCompound nbttagcompound = (NBTTagCompound)this.chunksToRemove.get(chunkcoordintpair);

    if (nbttagcompound == null)
    {
        DataInputStream datainputstream = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, x, z);

        if (datainputstream == null)
        {
            return null;
        }

        nbttagcompound = CompressedStreamTools.read(datainputstream);
    }

    return this.checkedReadChunkFromNBT(worldIn, x, z, nbttagcompound);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:AnvilChunkLoader.java

示例3: generateStructure

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public boolean generateStructure(World worldIn, Random randomIn, ChunkCoordIntPair chunkCoord)
{
    this.func_143027_a(worldIn);
    int i = (chunkCoord.chunkXPos << 4) + 8;
    int j = (chunkCoord.chunkZPos << 4) + 8;
    boolean flag = false;

    for (StructureStart structurestart : this.structureMap.values())
    {
        if (structurestart.isSizeableStructure() && structurestart.func_175788_a(chunkCoord) && structurestart.getBoundingBox().intersectsWith(i, j, i + 15, j + 15))
        {
            structurestart.generateStructure(worldIn, randomIn, new StructureBoundingBox(i, j, i + 15, j + 15));
            structurestart.func_175787_b(chunkCoord);
            flag = true;
            this.func_143026_a(structurestart.getChunkPosX(), structurestart.getChunkPosZ(), structurestart);
        }
    }

    return flag;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:MapGenStructure.java

示例4: MapGenStronghold

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public MapGenStronghold(Map<String, String> p_i2068_1_)
{
    this();

    for (Entry<String, String> entry : p_i2068_1_.entrySet())
    {
        if (((String)entry.getKey()).equals("distance"))
        {
            this.field_82671_h = MathHelper.parseDoubleWithDefaultAndMax((String)entry.getValue(), this.field_82671_h, 1.0D);
        }
        else if (((String)entry.getKey()).equals("count"))
        {
            this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.structureCoords.length, 1)];
        }
        else if (((String)entry.getKey()).equals("spread"))
        {
            this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.field_82672_i, 1);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:MapGenStronghold.java

示例5: generateStructure

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public boolean generateStructure(World worldIn, Random randomIn, ChunkCoordIntPair chunkCoord)
{
    this.func_143027_a(worldIn);
    int i = (chunkCoord.chunkXPos << 4) + 8;
    int j = (chunkCoord.chunkZPos << 4) + 8;
    boolean flag = false;

    for (Object structurestart0 : this.structureMap.values())
    {
    	StructureStart structurestart = (StructureStart)structurestart0;
        if (structurestart.isSizeableStructure() && structurestart.func_175788_a(chunkCoord) && structurestart.getBoundingBox().intersectsWith(i, j, i + 15, j + 15))
        {
            structurestart.generateStructure(worldIn, randomIn, new StructureBoundingBox(i, j, i + 15, j + 15));
            structurestart.func_175787_b(chunkCoord);
            flag = true;
            this.func_143026_a(structurestart.getChunkPosX(), structurestart.getChunkPosZ(), structurestart);
        }
    }

    return flag;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:MapGenStructure.java

示例6: dropChunk

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public void dropChunk(int p_73241_1_, int p_73241_2_)
{
    if (this.worldObj.provider.canRespawnHere())
    {
        if (!this.worldObj.isSpawnChunk(p_73241_1_, p_73241_2_))
        {
            this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_)));
        }
    }
    else
    {
        this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(p_73241_1_, p_73241_2_)));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:ChunkProviderServer.java

示例7: MapGenStronghold

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public MapGenStronghold()
{
    this.structureCoords = new ChunkCoordIntPair[3];
    this.field_82671_h = 32.0D;
    this.field_82672_i = 3;
    this.field_151546_e = Lists.<BiomeGenBase>newArrayList();

    for (BiomeGenBase biomegenbase : BiomeGenBase.getBiomeGenArray())
    {
        if (biomegenbase != null && biomegenbase.minHeight > 0.0F)
        {
            this.field_151546_e.add(biomegenbase);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:MapGenStronghold.java

示例8: getCoordList

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
protected List<BlockPos> getCoordList()
{
    List<BlockPos> list = Lists.<BlockPos>newArrayList();

    for (ChunkCoordIntPair chunkcoordintpair : this.structureCoords)
    {
        if (chunkcoordintpair != null)
        {
            list.add(chunkcoordintpair.getCenterBlock(64));
        }
    }

    return list;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:MapGenStronghold.java

示例9: updateBlocks

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
protected void updateBlocks()
{
    super.updateBlocks();
    this.previousActiveChunkSet.retainAll(this.activeChunkSet);

    if (this.previousActiveChunkSet.size() == this.activeChunkSet.size())
    {
        this.previousActiveChunkSet.clear();
    }

    int i = 0;

    for (ChunkCoordIntPair chunkcoordintpair : this.activeChunkSet)
    {
        if (!this.previousActiveChunkSet.contains(chunkcoordintpair))
        {
            int j = chunkcoordintpair.chunkXPos * 16;
            int k = chunkcoordintpair.chunkZPos * 16;
            this.theProfiler.startSection("getChunk");
            Chunk chunk = this.getChunkFromChunkCoords(chunkcoordintpair.chunkXPos, chunkcoordintpair.chunkZPos);
            this.playMoodSoundAndCheckLight(j, k, chunk);
            this.theProfiler.endSection();
            this.previousActiveChunkSet.add(chunkcoordintpair);
            ++i;

            if (i >= 10)
            {
                return;
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:33,代码来源:WorldClient.java

示例10: func_143027_a

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
private void func_143027_a(World worldIn)
{
    if (this.structureData == null)
    {
        this.structureData = (MapGenStructureData)worldIn.loadItemData(MapGenStructureData.class, this.getStructureName());

        if (this.structureData == null)
        {
            this.structureData = new MapGenStructureData(this.getStructureName());
            worldIn.setItemData(this.getStructureName(), this.structureData);
        }
        else
        {
            NBTTagCompound nbttagcompound = this.structureData.getTagCompound();

            for (String s : nbttagcompound.getKeySet())
            {
                NBTBase nbtbase = nbttagcompound.getTag(s);

                if (nbtbase.getId() == 10)
                {
                    NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbtbase;

                    if (nbttagcompound1.hasKey("ChunkX") && nbttagcompound1.hasKey("ChunkZ"))
                    {
                        int i = nbttagcompound1.getInteger("ChunkX");
                        int j = nbttagcompound1.getInteger("ChunkZ");
                        StructureStart structurestart = MapGenStructureIO.getStructureStart(nbttagcompound1, worldIn);

                        if (structurestart != null)
                        {
                            this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(i, j)), structurestart);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:MapGenStructure.java

示例11: writeToNBT

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public void writeToNBT(NBTTagCompound tagCompound)
{
    super.writeToNBT(tagCompound);
    NBTTagList nbttaglist = new NBTTagList();

    for (ChunkCoordIntPair chunkcoordintpair : this.field_175791_c)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        nbttagcompound.setInteger("X", chunkcoordintpair.chunkXPos);
        nbttagcompound.setInteger("Z", chunkcoordintpair.chunkZPos);
        nbttaglist.appendTag(nbttagcompound);
    }

    tagCompound.setTag("Processed", nbttaglist);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:StructureOceanMonument.java

示例12: func_177460_a

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_)
{
    boolean flag = false;

    if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L)
    {
        flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_));
    }

    return flag;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:ChunkProviderGenerate.java

示例13: S22PacketMultiBlockChange

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
public S22PacketMultiBlockChange(int p_i45181_1_, short[] crammedPositionsIn, Chunk chunkIn)
{
    this.chunkPosCoord = new ChunkCoordIntPair(chunkIn.xPosition, chunkIn.zPosition);
    this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[p_i45181_1_];

    for (int i = 0; i < this.changedBlocks.length; ++i)
    {
        this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(crammedPositionsIn[i], chunkIn);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:S22PacketMultiBlockChange.java

示例14: readPacketData

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.chunkPosCoord = new ChunkCoordIntPair(buf.readInt(), buf.readInt());
    this.changedBlocks = new S22PacketMultiBlockChange.BlockUpdateData[buf.readVarIntFromBuffer()];

    for (int i = 0; i < this.changedBlocks.length; ++i)
    {
        this.changedBlocks[i] = new S22PacketMultiBlockChange.BlockUpdateData(buf.readShort(), (IBlockState)Block.BLOCK_STATE_IDS.getByValue(buf.readVarIntFromBuffer()));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:S22PacketMultiBlockChange.java

示例15: addChunkToPending

import net.minecraft.world.ChunkCoordIntPair; //导入依赖的package包/类
protected void addChunkToPending(ChunkCoordIntPair p_75824_1_, NBTTagCompound p_75824_2_)
{
    if (!this.pendingAnvilChunksCoordinates.contains(p_75824_1_))
    {
        this.chunksToRemove.put(p_75824_1_, p_75824_2_);
    }

    ThreadedFileIOBase.getThreadedIOInstance().queueIO(this);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:AnvilChunkLoader.java


注:本文中的net.minecraft.world.ChunkCoordIntPair类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。