diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2017-08-18 12:17:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-18 12:17:56 +0200 |
commit | 72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82 (patch) | |
tree | c1c1a040332d4ba1f784be25c67c9800e85015eb /src/WorldStorage | |
parent | Sitting cats block enderchests from opening (#3906) (diff) | |
parent | Changed entity ownership model to use smart pointers (diff) | |
download | cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.gz cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.bz2 cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.lz cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.xz cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.tar.zst cuberite-72d7027861a3b7e7e8bb5fdcbbc5a1a778fa7f82.zip |
Diffstat (limited to 'src/WorldStorage')
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 16688b712..14d5738c2 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -458,7 +458,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT } // for y //*/ - cSetChunkDataPtr SetChunkData(new cSetChunkData( + auto SetChunkData = cpp14::make_unique<cSetChunkData>( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, BlockTypes, MetaData, IsLightValid ? BlockLight : nullptr, @@ -466,7 +466,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT nullptr, Biomes, std::move(Entities), std::move(BlockEntities), false - )); + ); m_World->QueueSetChunkData(std::move(SetChunkData)); return true; } @@ -1655,7 +1655,7 @@ void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N { Boat->SetMaterial(cBoat::StringToMaterial(a_NBT.GetString(TypeIdx))); } - a_Entities.push_back(Boat.release()); + a_Entities.emplace_back(std::move(Boat)); } @@ -1669,7 +1669,7 @@ void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedN { return; } - a_Entities.push_back(EnderCrystal.release()); + a_Entities.emplace_back(std::move(EnderCrystal)); } @@ -1694,7 +1694,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN { return; } - a_Entities.push_back(FallingBlock.release()); + a_Entities.emplace_back(std::move(FallingBlock)); } @@ -1708,7 +1708,7 @@ void cWSSAnvil::LoadMinecartRFromNBT(cEntityList & a_Entities, const cParsedNBT { return; } - a_Entities.push_back(Minecart.release()); + a_Entities.emplace_back(std::move(Minecart)); } @@ -1740,7 +1740,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT Minecart->SetSlot(a_NBT.GetByte(Slot), Item); } } // for itr - ItemDefs[] - a_Entities.push_back(Minecart.release()); + a_Entities.emplace_back(std::move(Minecart)); } @@ -1757,7 +1757,7 @@ void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT // TODO: Load the Push and Fuel tags - a_Entities.push_back(Minecart.release()); + a_Entities.emplace_back(std::move(Minecart)); } @@ -1774,7 +1774,7 @@ void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT // TODO: Everything to do with TNT carts - a_Entities.push_back(Minecart.release()); + a_Entities.emplace_back(std::move(Minecart)); } @@ -1791,7 +1791,7 @@ void cWSSAnvil::LoadMinecartHFromNBT(cEntityList & a_Entities, const cParsedNBT // TODO: Everything to do with hopper carts - a_Entities.push_back(Minecart.release()); + a_Entities.emplace_back(std::move(Minecart)); } @@ -1825,7 +1825,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a Pickup->SetAge(a_NBT.GetShort(Age)); } - a_Entities.push_back(Pickup.release()); + a_Entities.emplace_back(std::move(Pickup)); } @@ -1847,7 +1847,7 @@ void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB TNT->SetFuseTicks(static_cast<int>(a_NBT.GetByte(FuseTicks))); } - a_Entities.push_back(TNT.release()); + a_Entities.emplace_back(std::move(TNT)); } @@ -1876,7 +1876,7 @@ void cWSSAnvil::LoadExpOrbFromNBT(cEntityList & a_Entities, const cParsedNBT & a ExpOrb->SetReward(a_NBT.GetShort(Reward)); } - a_Entities.push_back(ExpOrb.release()); + a_Entities.emplace_back(std::move(ExpOrb)); } @@ -1941,7 +1941,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT ItemFrame->SetItemRotation(static_cast<Byte>(a_NBT.GetByte(Rotation))); } - a_Entities.push_back(ItemFrame.release()); + a_Entities.emplace_back(std::move(ItemFrame)); } @@ -1964,7 +1964,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT & } LoadHangingFromNBT(*Painting.get(), a_NBT, a_TagIdx); - a_Entities.push_back(Painting.release()); + a_Entities.emplace_back(std::move(Painting)); } @@ -2035,7 +2035,7 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ } // Store the new arrow in the entities list: - a_Entities.push_back(Arrow.release()); + a_Entities.emplace_back(std::move(Arrow)); } @@ -2058,7 +2058,7 @@ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedN SplashPotion->SetPotionColor(a_NBT.FindChildByName(a_TagIdx, "PotionName")); // Store the new splash potion in the entities list: - a_Entities.push_back(SplashPotion.release()); + a_Entities.emplace_back(std::move(SplashPotion)); } @@ -2074,7 +2074,7 @@ void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & } // Store the new snowball in the entities list: - a_Entities.push_back(Snowball.release()); + a_Entities.emplace_back(std::move(Snowball)); } @@ -2090,7 +2090,7 @@ void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB } // Store the new egg in the entities list: - a_Entities.push_back(Egg.release()); + a_Entities.emplace_back(std::move(Egg)); } @@ -2106,7 +2106,7 @@ void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & } // Store the new fireball in the entities list: - a_Entities.push_back(Fireball.release()); + a_Entities.emplace_back(std::move(Fireball)); } @@ -2122,7 +2122,7 @@ void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT } // Store the new FireCharge in the entities list: - a_Entities.push_back(FireCharge.release()); + a_Entities.emplace_back(std::move(FireCharge)); } @@ -2138,7 +2138,7 @@ void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cPar } // Store the new enderpearl in the entities list: - a_Entities.push_back(Enderpearl.release()); + a_Entities.emplace_back(std::move(Enderpearl)); } @@ -2158,7 +2158,7 @@ void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2178,7 +2178,7 @@ void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2198,7 +2198,7 @@ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2218,7 +2218,7 @@ void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2238,7 +2238,7 @@ void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2258,7 +2258,7 @@ void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2278,7 +2278,7 @@ void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNB return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2298,7 +2298,7 @@ void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2318,7 +2318,7 @@ void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2338,7 +2338,7 @@ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2358,7 +2358,7 @@ void cWSSAnvil::LoadGuardianFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2404,7 +2404,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2424,7 +2424,7 @@ void cWSSAnvil::LoadIronGolemFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2453,7 +2453,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2473,7 +2473,7 @@ void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2527,7 +2527,7 @@ void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2560,7 +2560,7 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2604,7 +2604,7 @@ void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2650,7 +2650,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2670,7 +2670,7 @@ void cWSSAnvil::LoadSilverfishFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2698,7 +2698,7 @@ void cWSSAnvil::LoadSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2727,7 +2727,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2747,7 +2747,7 @@ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2767,7 +2767,7 @@ void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2787,7 +2787,7 @@ void cWSSAnvil::LoadSquidFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2829,7 +2829,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2849,7 +2849,7 @@ void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2875,7 +2875,7 @@ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a Monster->SetWitherInvulnerableTicks(static_cast<unsigned int>(a_NBT.GetInt(CurrLine))); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2951,7 +2951,7 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -2992,7 +2992,7 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } @@ -3025,7 +3025,7 @@ void cWSSAnvil::LoadPigZombieFromNBT(cEntityList & a_Entities, const cParsedNBT Monster->SetAge(Age); } - a_Entities.push_back(Monster.release()); + a_Entities.emplace_back(std::move(Monster)); } |