Package net.minecraft.world.chunk

Examples of net.minecraft.world.chunk.Chunk


                {
                    return BlockVec3.chunkCached.getBlock(this.x & 15, this.y, this.z & 15);
                }
                else
                {
                    Chunk chunk = null;
                    chunk = world.getChunkFromChunkCoords(chunkx, chunkz);
                    BlockVec3.chunkCached = chunk;
                    BlockVec3.chunkCacheDim = world.provider.dimensionId;
                    BlockVec3.chunkCacheX = chunkx;
                    BlockVec3.chunkCacheZ = chunkz;
                    return chunk.getBlock(this.x & 15, this.y, this.z & 15);
                }
            }
            //Chunk doesn't exist - meaning, it is not loaded
            return Blocks.bedrock;
        }
View Full Code Here


                {
                    return BlockVec3.chunkCached.getBlock(this.x & 15, this.y, this.z & 15);
                }
                else
                {
                    Chunk chunk = null;
                    chunk = world.getChunkFromChunkCoords(chunkx, chunkz);
                    BlockVec3.chunkCached = chunk;
                    BlockVec3.chunkCacheDim = world.provider.dimensionId;
                    BlockVec3.chunkCacheX = chunkx;
                    BlockVec3.chunkCacheZ = chunkz;
                    return chunk.getBlock(this.x & 15, this.y, this.z & 15);
                }
            }
            //Chunk doesn't exist - meaning, it is not loaded
            return Blocks.bedrock;
        }
View Full Code Here

            {
                return BlockVec3Dim.chunkCached.getBlock(this.x & 15, this.y, this.z & 15);
            }
            else
            {
                Chunk chunk = null;
                chunk = world.getChunkFromChunkCoords(chunkx, chunkz);
                BlockVec3Dim.chunkCached = chunk;
                BlockVec3Dim.chunkCacheDim = world.provider.dimensionId;
                BlockVec3Dim.chunkCacheX = chunkx;
                BlockVec3Dim.chunkCacheZ = chunkz;
                return chunk.getBlock(this.x & 15, this.y, this.z & 15);
            }
        }
        catch (Throwable throwable)
        {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Oxygen Sealer thread: Exception getting block type in world");
View Full Code Here

                {
                    return BlockVec3Dim.chunkCached.getBlock(this.x & 15, this.y, this.z & 15);
                }
                else
                {
                    Chunk chunk = null;
                    chunk = world.getChunkFromChunkCoords(chunkx, chunkz);
                    BlockVec3Dim.chunkCached = chunk;
                    BlockVec3Dim.chunkCacheDim = world.provider.dimensionId;
                    BlockVec3Dim.chunkCacheX = chunkx;
                    BlockVec3Dim.chunkCacheZ = chunkz;
                    return chunk.getBlock(this.x & 15, this.y, this.z & 15);
                }
            }
            //Chunk doesn't exist - meaning, it is not loaded
            return Blocks.bedrock;
        }
View Full Code Here

            generator.generate(this, this.worldObj, par1, par2, ids, meta);
        }

        this.onChunkProvide(par1, par2, ids, meta);

        final Chunk var4 = new Chunk(this.worldObj, ids, meta, par1, par2);
        final byte[] var5 = var4.getBiomeArray();

        for (int var6 = 0; var6 < var5.length; ++var6)
        {
            var5[var6] = (byte) this.biomesForGeneration[var6].biomeID;
        }

        var4.generateSkylightMap();
        return var4;
    }
View Full Code Here

        }
        return cool;
    }

    public static BiomeGenBase getBiome(EntityPlayer player) {
        Chunk chunk = player.worldObj.getChunkFromBlockCoords((int) player.posX, (int) player.posZ);
        return chunk.getBiomeGenForWorldCoords((int) player.posX & 15, (int) player.posZ & 15, player.worldObj.getWorldChunkManager());
    }
View Full Code Here

            LogHelper.info("Moving player " + player);
            player.setLocationAndAngles(safeX, player.posY, safeZ, 0.0F, 0.0F);
            worldObj.updateEntityWithOptionalForce(player, true);
          }
        }
        final Chunk chunk = world.getChunkFromBlockCoords(x, z);
        chunks.put(Pair.of(x1, z1), chunk); // save map of chunks
        providerServer.unloadChunksIfNotNearSpawn(x1, z1);
      }
    }

    // verify that chunks unloaded
    int lastloaded = 0;
    while (providerServer.getLoadedChunkCount() != lastloaded) {
      lastloaded = providerServer.getLoadedChunkCount();
      providerServer.unloadQueuedChunks();

      for (final Pair<Integer, Integer> coord : chunks.keySet()) {
        final Chunk chunk = chunks.get(coord);
        if (chunk != null) {
          if (chunk.isChunkLoaded) {
            LogHelper.warning("Failed to unload chunk @ " + coord);
            /*
             * } else { LogHelper.info("Chunk unloaded @ " + coord);
             */
          }
        }
      }
    }
    chunks.clear();
    LogHelper.info(providerServer.makeString());

    IChunkLoader chunkloader = providerServer.currentChunkLoader;
    providerServer.currentChunkLoader = null;
    for (int x1 = chunkX.intValue() - range; x1 <= chunkX.intValue() + range; x1++) {
      for (int z1 = chunkZ.intValue() - range; z1 <= chunkZ.intValue() + range; z1++) {
        // GenesisBiomeOverrideHandler.myQueue.add(new
        // GenesisBiomeOverrideHandler.coord(x1, z1));

        final Chunk chunk = providerServer.loadChunk(x1, z1);
       
        byte[] chunkBiomes = chunk.getBiomeArray();
        for (int k = 0; k < chunkBiomes.length; ++k) {
          chunkBiomes[k] = (byte) newBiome.biomeID;
        }
        chunk.setBiomeArray(chunkBiomes);
       
        //providerServer.populate(providerGenesis, x1, z1);
       
       
        
        //chunk.sendUpdates = true;
        //chunk.setStorageArrays(par1ArrayOfExtendedBlockStorage);
        chunk.setChunkModified();
      }
    }

    providerServer.currentChunkLoader = chunkloader;

View Full Code Here

        @SubscribeEvent
      public void handleChunkLoad(ChunkEvent.Load event) {
      if(!core_enabled) return;
      if(!onchunkgenerate) return;
            if(!(event.world instanceof WorldServer)) return;
      Chunk c = event.getChunk();
      if((c != null) && (c.lastSaveTime == 0)) {  // If new chunk?
        ForgeWorld fw = getWorld(event.world, false);
        if(fw == null) {
          return;
        }
        int ymax = 0;
        ExtendedBlockStorage[] sections = c.getBlockStorageArray();
        for(int i = 0; i < sections.length; i++) {
          if((sections[i] != null) && (sections[i].isEmpty() == false)) {
            ymax = 16*(i+1);
          }
        }
 
View Full Code Here

        @SubscribeEvent
      public void handleChunkPopulate(PopulateChunkEvent.Post event) {
      if(!core_enabled) return;
      if(!onchunkpopulate) return;
            if(!(event.world instanceof WorldServer)) return;
      Chunk c = event.chunkProvider.loadChunk(event.chunkX, event.chunkZ);
      int ymin = 0, ymax = 0;
      if(c != null) {
                ForgeWorld fw = getWorld(event.world, false);
                if (fw == null) return;

                ExtendedBlockStorage[] sections = c.getBlockStorageArray();
        for(int i = 0; i < sections.length; i++) {
          if((sections[i] != null) && (sections[i].isEmpty() == false)) {
            ymax = 16*(i+1);
          }
        }
 
View Full Code Here

  //---------------------------------------------------------
 
  @SubscribeEvent
  public void chunkLoaded(ChunkDataEvent event)
  {
    Chunk chunk = event.getChunk();
    for(List<Entity> list : chunk.entityLists)
    {
      for(Entity entity : list)
      {
        if(entity instanceof ITeamBase)
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.