net.minecraft.world.chunk.Chunk.generateSkylightMap()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中net.minecraft.world.chunk.Chunk.generateSkylightMap()方法的一些代码示例,展示了Chunk.generateSkylightMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Chunk.generateSkylightMap()方法的具体详情如下:
包路径:net.minecraft.world.chunk.Chunk
类名称:Chunk
方法名:generateSkylightMap

Chunk.generateSkylightMap介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

private void updateChunks()
{
  // update shit..
  for( int x = 0; x < this.cx_size; x++ )
  {
    for( int z = 0; z < this.cz_size; z++ )
    {
      final Chunk c = this.myChunks[x][z];
      c.resetRelightChecks();
      c.generateSkylightMap();
      c.setModified( true );
    }
  }
  // send shit...
  for( int x = 0; x < this.cx_size; x++ )
  {
    for( int z = 0; z < this.cz_size; z++ )
    {
      final Chunk c = this.myChunks[x][z];
      for( int y = 1; y < 255; y += 32 )
      {
        WorldData.instance().compassData().service().updateArea( this.getWorld(), c.x << 4, y, c.z << 4 );
      }
      Platform.sendChunk( c, this.verticalBits );
    }
  }
}

代码示例来源:origin: IntellectualSites/PlotSquared

@Override
public void fixChunkLighting(int x, int z) {
  Chunk nmsChunk = getChunk(getSpongeWorld(), x, z);
  nmsChunk.generateSkylightMap();
}

代码示例来源:origin: thraaawn/CompactMachines

@Override
public Chunk generateChunk(int x, int z) {
  ChunkPrimer cp = new ChunkPrimer();
  Chunk chunk = new Chunk(this.world, cp, x, z);
  chunk.generateSkylightMap();
  chunk.setBiomeArray(voidBiomeArray);
  return chunk;
}

代码示例来源:origin: thraaawn/CompactMachines

@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
  ChunkPrimer cp = new ChunkPrimer();
  this.terrainGen.generate(chunkX, chunkZ, cp);
  Chunk chunk = new Chunk(this.world, cp, chunkX, chunkZ);
  chunk.generateSkylightMap();
  // TODO: Set biome
  // this.terrainGen.setBiomes(chunkX, chunkZ, chunk);
  return chunk;
}

代码示例来源:origin: TeamWizardry/Wizardry

@Nonnull
@Override
public Chunk generateChunk(int x, int z) {
  ChunkPrimer chunkprimer = new ChunkPrimer();
  generate(x, z, chunkprimer);
  Chunk chunk = new Chunk(world, chunkprimer, x, z);
  byte[] biomeArray = chunk.getBiomeArray();
  for (int i = 0; i < biomeArray.length; ++i) {
    biomeArray[i] = (byte) 42;
  }
  chunk.generateSkylightMap();
  return chunk;
}

代码示例来源:origin: Electrical-Age/ElectricalAge

chunk.generateHeightMap();
Utils.updateSkylight(chunk);
chunk.generateSkylightMap();
Utils.updateAllLightTypes(worldObj, xCoord, yCoord, zCoord);

代码示例来源:origin: MCTCP/TerrainControl

@Override
public Chunk generateChunk(int chunkX, int chunkZ)
{
  BlockFalling.fallInstantly = true;
  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();
  BlockFalling.fallInstantly = false;
  return chunk;
}

代码示例来源:origin: gegy1000/Terrarium

@Override
public Chunk generateChunk(int chunkX, int chunkZ) {
  ChunkPrimer primer = this.generatePrimer(chunkX, chunkZ);
  Chunk chunk = new Chunk(this.world, primer, chunkX, chunkZ);
  Biome[] biomeBuffer = this.provideBiomes(chunkX, chunkZ);
  byte[] biomeArray = chunk.getBiomeArray();
  for (int i = 0; i < biomeBuffer.length; i++) {
    biomeArray[i] = (byte) Biome.getIdForBiome(biomeBuffer[i]);
  }
  chunk.generateSkylightMap();
  return chunk;
}

代码示例来源:origin: PenguinSquad/Harvest-Festival

@Override
@Nonnull
public Chunk provideChunk(int x, int z) {
  rand.setSeed((long) x * 341873128712L + (long) z * 132897987541L);
  ChunkPrimer chunkprimer = new ChunkPrimer();
  biomesForGeneration = this.world.getBiomeProvider().getBiomes(biomesForGeneration, x * 16, z * 16, 16, 16);
  season = HFApi.calendar.getDate(world).getSeason();
  if (season == null) season = Season.SPRING;
  setBlocksInChunk(x, z, chunkprimer);
  Chunk chunk = new Chunk(world, chunkprimer, x, z);
  byte[] abyte = chunk.getBiomeArray();
  for (int i = 0; i < abyte.length; ++i) {
    abyte[i] = (byte) Biome.getIdForBiome(biomesForGeneration[i]);
  }
  chunk.generateSkylightMap();
  return chunk;
}

代码示例来源:origin: vadis365/TheErebus

@Override
public Chunk generateChunk(int x, int z) {
  rand.setSeed(x * 341873128712L + z * 132897987541L);
  ChunkPrimer chunkprimer = new ChunkPrimer();
  biomesForGeneration = worldObj.getBiomeProvider().getBiomes(biomesForGeneration, x * 16, z * 16, 16, 16);
  generateTerrain(x, z, chunkprimer);
  replaceBlocksForBiome(x, z, biomesForGeneration, chunkprimer);
  caveGenerator.generate(worldObj, x, z, chunkprimer);
  ravineGenerator.generate(worldObj, x, z, chunkprimer);
  Chunk chunk = new Chunk(worldObj, chunkprimer, x, z);
  byte[] biomeArrayReference = chunk.getBiomeArray();
  for (int a = 0; a < biomeArrayReference.length; ++a)
    biomeArrayReference[a] = (byte) Biome.getIdForBiome(biomesForGeneration[a]);
  chunk.generateSkylightMap();
  chunk.resetRelightChecks();
  return chunk;
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

chunk.generateSkylightMap();
return chunk;

代码示例来源:origin: McJtyMods/LostCities

chunk.generateSkylightMap();

代码示例来源:origin: McJtyMods/ModTutorials

@Override
public Chunk generateChunk(int x, int z) {
  ChunkPrimer chunkprimer = new ChunkPrimer();
  // Setup biomes for terraingen
  this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomesForGeneration(this.biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10);
  terraingen.setBiomesForGeneration(biomesForGeneration);
  terraingen.generate(x, z, chunkprimer);
  // Setup biomes again for actual biome decoration
  this.biomesForGeneration = this.worldObj.getBiomeProvider().getBiomes(this.biomesForGeneration, x * 16, z * 16, 16, 16);
  // This will replace stone with the biome specific stones
  terraingen.replaceBiomeBlocks(x, z, chunkprimer, this, biomesForGeneration);
  // Generate caves
  this.caveGenerator.generate(this.worldObj, x, z, chunkprimer);
  Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z);
  byte[] biomeArray = chunk.getBiomeArray();
  for (int i = 0; i < biomeArray.length; ++i) {
    biomeArray[i] = (byte)Biome.getIdForBiome(this.biomesForGeneration[i]);
  }
  chunk.generateSkylightMap();
  return chunk;
}

代码示例来源:origin: jabelar/ExampleMod-1.12

chunk.generateSkylightMap();
return chunk;

代码示例来源:origin: IntellectualSites/PlotSquared

nmsChunk.generateSkylightMap();
net.minecraft.world.World nmsWorld = nmsChunk.getWorld();

代码示例来源:origin: Electrical-Age/ElectricalAge

@Override
public boolean removedByPlayer(World world, EntityPlayer entityPlayer, int x, int y, int z) {
  if (world.isRemote) return false;
  SixNodeEntity tileEntity = (SixNodeEntity) world.getTileEntity(x, y, z);
  MovingObjectPosition MOP = collisionRayTrace(world, x, y, z, entityPlayer);
  if (MOP == null) return false;
  SixNode sixNode = (SixNode) tileEntity.getNode();
  if (sixNode == null) return true;
  if (sixNode.sixNodeCacheBlock != Blocks.air) {
    if (Utils.isCreative((EntityPlayerMP) entityPlayer) == false) {
      ItemStack stack = new ItemStack(sixNode.sixNodeCacheBlock, 1, sixNode.sixNodeCacheBlockMeta);
      sixNode.dropItem(stack);
    }
    sixNode.sixNodeCacheBlock = Blocks.air;
    Chunk chunk = world.getChunkFromBlockCoords(x, z);
    Utils.generateHeightMap(chunk);
    Utils.updateSkylight(chunk);
    chunk.generateSkylightMap();
    Utils.updateAllLightTypes(world, x, y, z);
    sixNode.setNeedPublish(true);
    return false;
  }
  if (false == sixNode.playerAskToBreakSubBlock((EntityPlayerMP) entityPlayer, Direction.fromIntMinecraftSide(MOP.sideHit)))
    return false;
  if (sixNode.getIfSideRemain()) return true;
  return super.removedByPlayer(world, entityPlayer, x, y, z);
}

代码示例来源:origin: Electrical-Age/ElectricalAge

Utils.generateHeightMap(chunk);
Utils.updateSkylight(chunk);
chunk.generateSkylightMap();
Utils.updateAllLightTypes(coordonate.world(), coordonate.x, coordonate.y, coordonate.z);

代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped

for (int z = ownedChunks.minZ; z <= ownedChunks.maxZ; z++) {
  claimedChunks[x - ownedChunks.minX][z - ownedChunks.minZ].isTerrainPopulated = true;
  claimedChunks[x - ownedChunks.minX][z - ownedChunks.minZ].generateSkylightMap();
  claimedChunks[x - ownedChunks.minX][z - ownedChunks.minZ].checkLight();

相关文章