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

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

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

Chunk.setModified介绍

暂无

代码示例

代码示例来源: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: AppliedEnergistics/Applied-Energistics-2

@Override
public Chunk generateChunk( final int x, final int z )
{
  final Chunk chunk = new Chunk( this.world, x, z );
  final byte[] biomes = chunk.getBiomeArray();
  Biome biome = AppEng.instance().getStorageBiome();
  byte biomeId = (byte) Biome.getIdForBiome( biome );
  for( int k = 0; k < biomes.length; ++k )
  {
    biomes[k] = biomeId;
  }
  AEApi.instance().definitions().blocks().matrixFrame().maybeBlock().ifPresent( block -> this.fillChunk( chunk, block.getDefaultState() ) );
  chunk.setModified( false );
  if( !chunk.isTerrainPopulated() )
  {
    chunk.setTerrainPopulated( true );
    chunk.resetRelightChecks();
  }
  return chunk;
}

代码示例来源:origin: Chisel-Team/Chisel

public void chunkModified(Chunk chunk, String key) {
  IChunkData<?> cd = data.get(key);
  chunk.setModified(true);
  updateClient(chunk, key, cd);
}

代码示例来源:origin: PrinceOfAmber/Cyclic

public static void teleportWallSafe(EntityLivingBase player, World world, double x, double y, double z) {
 BlockPos coords = new BlockPos(x, y, z);
 world.markBlockRangeForRenderUpdate(coords, coords);
 world.getChunk(coords).setModified(true);
 player.setPositionAndUpdate(x, y, z);
 moveEntityWallSafe(player, world);
}

代码示例来源:origin: PrinceOfAmber/Cyclic

public static boolean teleport(EntityPlayer player, int slot) {
 ItemStack book = getPlayersBook(player);
 BlockPosDim loc = getLocation(book, slot);
 if (GuiEnderBook.BACK_BTN_ID == slot) {
  loc = getBackLocation(book);
 }
 if (player.dimension != loc.dimension) {
  return false;//button was disabled anyway,... but just in case 
 }
 //something in vanilla 
 if (player instanceof EntityPlayerMP) {//server only
  // thanks so much to
  // http://www.minecraftforge.net/forum/index.php?topic=18308.0 
  //also moving up so  not stuck in floor
  boolean success = UtilEntity.enderTeleportEvent(player, player.world, loc.X, loc.Y + 0.1, loc.Z);
  if (success) { // try and force chunk loading it it worked 
   player.getEntityWorld().getChunk(new BlockPos(loc.X, loc.Y, loc.Z)).setModified(true);
  }
 }
 return true;
}

代码示例来源:origin: Silentine/GrimoireOfGaia

chunk.setModified(true);
world.getChunkProvider()
    .provideChunk(chunk.x, chunk.z);

相关文章