Package net.minecraft.world.chunk

Examples of net.minecraft.world.chunk.Chunk


    {
        ChunkCoordinate chunkCoord = ChunkCoordinate.fromChunkCoords(chunkX, chunkZ);
        ForgeChunkBuffer chunkBuffer = new ForgeChunkBuffer(chunkCoord);
        this.generator.generate(chunkBuffer);

        Chunk chunk = chunkBuffer.toChunk(this.worldHandle);
        fillBiomeArray(chunk);
        chunk.generateSkylightMap();

        return chunk;
    }
View Full Code Here


     *            The world the chunk will be in.
     * @return The chunk.
     */
    Chunk toChunk(World world)
    {
        return new Chunk(world, blocks, blockData, chunkCoord.getChunkX(), chunkCoord.getChunkZ());
    }
View Full Code Here

            // (Tree growing, /tc spawn, etc.)
           return world.getChunkFromChunkCoords(chunkX, chunkZ);
        }

        // Restrict to chunks we are currently populating
        Chunk topLeftCachedChunk = this.chunkCache[0];
        int indexX = (chunkX - topLeftCachedChunk.xPosition);
        int indexZ = (chunkZ - topLeftCachedChunk.zPosition);
        if ((indexX == 0 || indexX == 1) && (indexZ == 0 || indexZ == 1))
        {
            return this.chunkCache[indexX | (indexZ << 1)];
View Full Code Here

    }

    @Override
    public boolean isEmpty(int x, int y, int z)
    {
        Chunk chunk = this.getChunk(x, y, z);
        if (chunk == null)
        {
            return true;
        }
        return chunk.getBlock(x & 0xF, y, z & 0xF).getMaterial().equals(Material.air);
    }
View Full Code Here

    }

    @Override
    public LocalMaterialData getMaterial(int x, int y, int z)
    {
        Chunk chunk = this.getChunk(x, y, z);
        if (chunk == null)
        {
            return ForgeMaterialData.ofMinecraftBlock(Blocks.air, 0);
        }

        z &= 0xF;
        x &= 0xF;

        return ForgeMaterialData.ofMinecraftBlock(chunk.getBlock(x, y, z), chunk.getBlockMetadata(x, y, z));
    }
View Full Code Here

        {
            return;
        }

        // Get chunk from (faster) custom cache
        Chunk chunk = this.getChunk(x, y, z);

        if (chunk == null)
        {
            // Chunk is unloaded
            return;
        }

        // Temporarily make remote, so that torches etc. don't pop off
        boolean oldStatic = world.isRemote;
        world.isRemote = true;
        // chunk.setBlockAndMetadata(...)
        chunk.func_150807_a(x & 15, y, z & 15, ((ForgeMaterialData) material).internalBlock(), material.getBlockData());
        world.isRemote = oldStatic;

        // Relight and update players
        world.func_147451_t(x, y, z); // world.updateAllLightTypes
        if (!world.isRemote)
View Full Code Here

    }

    @Override
    public int getHighestBlockYAt(int x, int z)
    {
        Chunk chunk = this.getChunk(x, 0, z);
        if (chunk == null)
            return -1;
        z &= 0xF;
        x &= 0xF;
        int y = chunk.getHeightValue(x, z);
        int maxSearchY = y + 5; // Don't search too far away
        // while(chunk.getBlock(...) != ...)
        while (chunk.getBlock(x, y, z) != Blocks.air && y <= maxSearchY)
        {
            // Fix for incorrect lightmap
            y += 1;
        }
        return y;
View Full Code Here

  {
    Minecraft mc = Minecraft.getMinecraft();
    int x = MathHelper.floor_double(mc.thePlayer.posX);
    int z = MathHelper.floor_double(mc.thePlayer.posZ);
   
    Chunk chunk = mc.theWorld.getChunkFromBlockCoords(x, z);
    return chunk.getBiomeGenForWorldCoords(x & 15, z & 15, mc.theWorld.getWorldChunkManager());
  }
View Full Code Here

                for (int x0 = -12; x0 <= 12; x0++)
                {
                    for (int z0 = -12; z0 <= 12; z0++)
                    {
                        Chunk chunk = MinecraftServer.getServer().worldServerForDimension(0).getChunkFromChunkCoords(chunkCoordIntPair.chunkXPos + x0, chunkCoordIntPair.chunkZPos + z0);

                        if (chunk != null)
                        {
                            for (int z = 0; z < 16; z++)
                            {
                                for (int x = 0; x < 16; x++)
                                {
                                    int l4 = chunk.getHeightValue(x, z) + 1;
                                    Block block = Blocks.air;
                                    int i5 = 0;

                                    if (l4 > 1)
                                    {
                                        do
                                        {
                                            --l4;
                                            block = chunk.getBlock(x, l4, z);
                                            i5 = chunk.getBlockMetadata(x, l4, z);
                                        }
                                        while (block.getMapColor(i5) == MapColor.airColor && l4 > 0);
                                    }

                                    int col = block.getMapColor(i5).colorValue;
View Full Code Here

        int z1 = (int) entity.posZ;
        int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16);

        for (int x = x1 - 16; x <= x1 + 16; x++)
            for (int z = z1 - 16; z <= z1 + 16; z++) {
                Chunk chunk = world.getChunkFromBlockCoords(x, z);
                BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
                if (biome.getSpawnableList(EnumCreatureType.monster).isEmpty() || biome.getSpawningChance() <= 0)
                    continue;

                for (int y = y1 - 16; y < y1 + 16; y++) {
View Full Code Here

TOP

Related Classes of net.minecraft.world.chunk.Chunk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.