Java Code Examples for net.minecraft.world.ChunkCoordIntPair

The following are top voted examples for showing how to use net.minecraft.world.ChunkCoordIntPair. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Uranium   File: CraftWorld.java   View source code 6 votes vote down vote up
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);
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: AnvilChunkLoader.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 3
Project: DecompiledMinecraft   File: MapGenStructure.java   View source code 6 votes vote down vote up
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;
}
 
Example 4
Project: BaseClient   File: MapGenStronghold.java   View source code 6 votes vote down vote up
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);
        }
    }
}
 
Example 5
Project: BaseClient   File: AnvilChunkLoader.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 6
Project: DecompiledMinecraft   File: AnvilChunkLoader.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 7
Project: DecompiledMinecraft   File: MapGenStructure.java   View source code 6 votes vote down vote up
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;
}
 
Example 8
Project: BaseClient   File: AnvilChunkLoader.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 9
Project: BaseClient   File: MapGenStructure.java   View source code 6 votes vote down vote up
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;
}
 
Example 10
Project: BaseClient   File: ChunkProviderServer.java   View source code 5 votes vote down vote up
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_)));
    }
}
 
Example 11
Project: DecompiledMinecraft   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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);
        }
    }
}
 
Example 12
Project: DecompiledMinecraft   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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;
}
 
Example 13
Project: BaseClient   File: WorldClient.java   View source code 5 votes vote down vote up
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;
            }
        }
    }
}
 
Example 14
Project: DecompiledMinecraft   File: MapGenStructure.java   View source code 5 votes vote down vote up
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);
                        }
                    }
                }
            }
        }
    }
}
 
Example 15
Project: DecompiledMinecraft   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
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);
}
 
Example 16
Project: DecompiledMinecraft   File: ChunkProviderServer.java   View source code 5 votes vote down vote up
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_)));
    }
}
 
Example 17
Project: DecompiledMinecraft   File: ChunkProviderGenerate.java   View source code 5 votes vote down vote up
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;
}
 
Example 18
Project: DecompiledMinecraft   File: S22PacketMultiBlockChange.java   View source code 5 votes vote down vote up
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);
    }
}
 
Example 19
Project: DecompiledMinecraft   File: S22PacketMultiBlockChange.java   View source code 5 votes vote down vote up
/**
 * 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()));
    }
}
 
Example 20
Project: DecompiledMinecraft   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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);
        }
    }
}
 
Example 21
Project: DecompiledMinecraft   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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;
}
 
Example 22
Project: BaseClient   File: AnvilChunkLoader.java   View source code 5 votes vote down vote up
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);
}
 
Example 23
Project: DecompiledMinecraft   File: MapGenStructure.java   View source code 5 votes vote down vote up
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);
                        }
                    }
                }
            }
        }
    }
}
 
Example 24
Project: BaseClient   File: ChunkProviderGenerate.java   View source code 5 votes vote down vote up
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;
}
 
Example 25
Project: DecompiledMinecraft   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
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);
}
 
Example 26
Project: DecompiledMinecraft   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
public void readFromNBT(NBTTagCompound tagCompound)
{
    super.readFromNBT(tagCompound);

    if (tagCompound.hasKey("Processed", 9))
    {
        NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            this.field_175791_c.add(new ChunkCoordIntPair(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z")));
        }
    }
}
 
Example 27
Project: DecompiledMinecraft   File: ChunkProviderServer.java   View source code 5 votes vote down vote up
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_)));
    }
}
 
Example 28
Project: DecompiledMinecraft   File: ChunkProviderGenerate.java   View source code 5 votes vote down vote up
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;
}
 
Example 29
Project: DecompiledMinecraft   File: S22PacketMultiBlockChange.java   View source code 5 votes vote down vote up
/**
 * 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()));
    }
}
 
Example 30
Project: DecompiledMinecraft   File: ChunkProviderClient.java   View source code 5 votes vote down vote up
/**
 * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set
 * to false
 */
public void unloadChunk(int p_73234_1_, int p_73234_2_)
{
    Chunk chunk = this.provideChunk(p_73234_1_, p_73234_2_);

    if (!chunk.isEmpty())
    {
        chunk.onChunkUnload();
    }

    this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(p_73234_1_, p_73234_2_));
    this.chunkListing.remove(chunk);
}
 
Example 31
Project: DecompiledMinecraft   File: ChunkProviderClient.java   View source code 5 votes vote down vote up
/**
 * loads or generates the chunk at the chunk location specified
 */
public Chunk loadChunk(int p_73158_1_, int p_73158_2_)
{
    Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_);
    this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk);
    this.chunkListing.add(chunk);
    chunk.setChunkLoaded(true);
    return chunk;
}
 
Example 32
Project: BaseClient   File: AnvilChunkLoader.java   View source code 5 votes vote down vote up
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);
}
 
Example 33
Project: BaseClient   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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);
        }
    }
}
 
Example 34
Project: BaseClient   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
public void readFromNBT(NBTTagCompound tagCompound)
{
    super.readFromNBT(tagCompound);

    if (tagCompound.hasKey("Processed", 9))
    {
        NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            this.field_175791_c.add(new ChunkCoordIntPair(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z")));
        }
    }
}
 
Example 35
Project: BaseClient   File: MapGenStronghold.java   View source code 5 votes vote down vote up
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;
}
 
Example 36
Project: BaseClient   File: ChunkProviderClient.java   View source code 5 votes vote down vote up
/**
 * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set
 * to false
 */
public void unloadChunk(int p_73234_1_, int p_73234_2_)
{
    Chunk chunk = this.provideChunk(p_73234_1_, p_73234_2_);

    if (!chunk.isEmpty())
    {
        chunk.onChunkUnload();
    }

    this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(p_73234_1_, p_73234_2_));
    this.chunkListing.remove(chunk);
}
 
Example 37
Project: BaseClient   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
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);
}
 
Example 38
Project: BaseClient   File: StructureOceanMonument.java   View source code 5 votes vote down vote up
public void readFromNBT(NBTTagCompound tagCompound)
{
    super.readFromNBT(tagCompound);

    if (tagCompound.hasKey("Processed", 9))
    {
        NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            this.field_175791_c.add(new ChunkCoordIntPair(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z")));
        }
    }
}
 
Example 39
Project: BaseClient   File: ChunkProviderServer.java   View source code 5 votes vote down vote up
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_)));
    }
}
 
Example 40
Project: BaseClient   File: ChunkProviderClient.java   View source code 5 votes vote down vote up
/**
 * loads or generates the chunk at the chunk location specified
 */
public Chunk loadChunk(int p_73158_1_, int p_73158_2_)
{
    Chunk chunk = new Chunk(this.worldObj, p_73158_1_, p_73158_2_);
    this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk);
    this.chunkListing.add(chunk);
    chunk.setChunkLoaded(true);
    return chunk;
}