diff options
author | Mattes D <github@xoft.cz> | 2020-08-01 20:18:03 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-01 21:04:31 +0200 |
commit | 46398f4671012a0d913bd7bc0c70ffdc2645f2ac (patch) | |
tree | 11d766b1ce592e526b6cbac8d7a245208bdce26e | |
parent | Added HandleCraftItem call to ShiftClickedResult to make sure achievements are awarded (#4791) (diff) | |
download | cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar.gz cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar.bz2 cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar.lz cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar.xz cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.tar.zst cuberite-46398f4671012a0d913bd7bc0c70ffdc2645f2ac.zip |
Diffstat (limited to '')
35 files changed, 252 insertions, 257 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 3b9d30933..31493d4fe 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -1213,7 +1213,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback) { if (a_Callback == nullptr) { - a_Callback = cpp14::make_unique<cCallback>(); + a_Callback = std::make_unique<cCallback>(); } return a_Callback->RefStack(*this, a_StackPos); } @@ -1235,7 +1235,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cOptionalCallbackPtr & a_Callback) { if (a_Callback == nullptr) { - a_Callback = cpp14::make_unique<cOptionalCallback>(); + a_Callback = std::make_unique<cOptionalCallback>(); } return a_Callback->RefStack(*this, a_StackPos); } @@ -1290,7 +1290,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cStackTablePtr & a_StackTable) } // Assign the StackTable to the specified stack position: - a_StackTable = cpp14::make_unique<cStackTable>(*this, a_StackPos); + a_StackTable = std::make_unique<cStackTable>(*this, a_StackPos); return true; } @@ -1311,7 +1311,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTableRefPtr & a_TableRef) { if (a_TableRef == nullptr) { - a_TableRef = cpp14::make_unique<cTableRef>(); + a_TableRef = std::make_unique<cTableRef>(); } return a_TableRef->RefStack(*this, a_StackPos); } @@ -1333,7 +1333,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTrackedRefPtr & a_Ref) { if (a_Ref == nullptr) { - a_Ref = cpp14::make_unique<cTrackedRef>(); + a_Ref = std::make_unique<cTrackedRef>(); } return a_Ref->RefStack(*this, a_StackPos); } diff --git a/src/Bindings/ManualBindings_Network.cpp b/src/Bindings/ManualBindings_Network.cpp index 4a7dd2367..911e1a8bb 100644 --- a/src/Bindings/ManualBindings_Network.cpp +++ b/src/Bindings/ManualBindings_Network.cpp @@ -967,7 +967,7 @@ static int tolua_cUrlClient_Request_Common(lua_State * a_LuaState, const AString { return L.ApiParamError("Cannot read the CallbacksTable parameter at idx %d", a_UrlStackIdx + 1); } - urlClientCallbacks = cpp14::make_unique<cFullUrlClientCallbacks>(std::move(callbacks)); + urlClientCallbacks = std::make_unique<cFullUrlClientCallbacks>(std::move(callbacks)); } else if (lua_isfunction(L, a_UrlStackIdx + 1)) { @@ -975,7 +975,7 @@ static int tolua_cUrlClient_Request_Common(lua_State * a_LuaState, const AString { return L.ApiParamError("Cannot read the CallbackFn parameter at idx %d", a_UrlStackIdx + 1); } - urlClientCallbacks = cpp14::make_unique<cSimpleUrlClientCallbacks>(std::move(onCompleteBodyCallback)); + urlClientCallbacks = std::make_unique<cSimpleUrlClientCallbacks>(std::move(onCompleteBodyCallback)); } else { diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp index cfefb4f7a..8c73c5cd1 100644 --- a/src/Bindings/ManualBindings_World.cpp +++ b/src/Bindings/ManualBindings_World.cpp @@ -307,7 +307,7 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S) ASSERT(chunkCoords != nullptr); // If the table was invalid, GetStackValues() would have failed // Read the chunk coords: - auto chunkStay = cpp14::make_unique<cLuaChunkStay>(); + auto chunkStay = std::make_unique<cLuaChunkStay>(); if (!chunkStay->AddChunks(*chunkCoords)) { return 0; @@ -732,7 +732,7 @@ static int tolua_cWorld_PrepareChunk(lua_State * tolua_S) cWorld * world = nullptr; int chunkX = 0; int chunkZ = 0; - auto Callback = cpp14::make_unique<cCallback>(); + auto Callback = std::make_unique<cCallback>(); L.GetStackValues(1, world, chunkX, chunkZ, Callback->m_LuaCallback); if (world == nullptr) { diff --git a/src/BlockEntities/BlockEntity.cpp b/src/BlockEntities/BlockEntity.cpp index 52611dce9..b32785e3c 100644 --- a/src/BlockEntities/BlockEntity.cpp +++ b/src/BlockEntities/BlockEntity.cpp @@ -77,25 +77,25 @@ OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETY { switch (a_BlockType) { - case E_BLOCK_BEACON: return cpp14::make_unique<cBeaconEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_BED: return cpp14::make_unique<cBedEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_BREWING_STAND: return cpp14::make_unique<cBrewingstandEntity>(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_CHEST: return cpp14::make_unique<cChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_COMMAND_BLOCK: return cpp14::make_unique<cCommandBlockEntity>(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_DISPENSER: return cpp14::make_unique<cDispenserEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_DROPPER: return cpp14::make_unique<cDropperEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_ENDER_CHEST: return cpp14::make_unique<cEnderChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_FLOWER_POT: return cpp14::make_unique<cFlowerPotEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_FURNACE: return cpp14::make_unique<cFurnaceEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_HEAD: return cpp14::make_unique<cMobHeadEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_HOPPER: return cpp14::make_unique<cHopperEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_JUKEBOX: return cpp14::make_unique<cJukeboxEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_LIT_FURNACE: return cpp14::make_unique<cFurnaceEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_MOB_SPAWNER: return cpp14::make_unique<cMobSpawnerEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_NOTE_BLOCK: return cpp14::make_unique<cNoteEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_SIGN_POST: return cpp14::make_unique<cSignEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_TRAPPED_CHEST: return cpp14::make_unique<cChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); - case E_BLOCK_WALLSIGN: return cpp14::make_unique<cSignEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BEACON: return std::make_unique<cBeaconEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BED: return std::make_unique<cBedEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_BREWING_STAND: return std::make_unique<cBrewingstandEntity>(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_CHEST: return std::make_unique<cChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_COMMAND_BLOCK: return std::make_unique<cCommandBlockEntity>(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_DISPENSER: return std::make_unique<cDispenserEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_DROPPER: return std::make_unique<cDropperEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_ENDER_CHEST: return std::make_unique<cEnderChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_FLOWER_POT: return std::make_unique<cFlowerPotEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_FURNACE: return std::make_unique<cFurnaceEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_HEAD: return std::make_unique<cMobHeadEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_HOPPER: return std::make_unique<cHopperEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_JUKEBOX: return std::make_unique<cJukeboxEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_LIT_FURNACE: return std::make_unique<cFurnaceEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_MOB_SPAWNER: return std::make_unique<cMobSpawnerEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_NOTE_BLOCK: return std::make_unique<cNoteEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_SIGN_POST: return std::make_unique<cSignEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_TRAPPED_CHEST: return std::make_unique<cChestEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); + case E_BLOCK_WALLSIGN: return std::make_unique<cSignEntity >(a_BlockType, a_BlockMeta, a_Pos, a_World); default: { LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)", diff --git a/src/Blocks/BlockFence.h b/src/Blocks/BlockFence.h index 25ac85eed..35a9b139a 100644 --- a/src/Blocks/BlockFence.h +++ b/src/Blocks/BlockFence.h @@ -107,7 +107,7 @@ public: // New knot? needs to init and produce sound effect else { - auto NewLeashKnot = cpp14::make_unique<cLeashKnot>(a_BlockFace, a_BlockPos); + auto NewLeashKnot = std::make_unique<cLeashKnot>(a_BlockFace, a_BlockPos); auto NewLeashKnotPtr = NewLeashKnot.get(); NewLeashKnotPtr->TiePlayersLeashedMobs(a_Player, KnotAlreadyExists); diff --git a/src/BrewingRecipes.cpp b/src/BrewingRecipes.cpp index 829660ffe..7bce72883 100644 --- a/src/BrewingRecipes.cpp +++ b/src/BrewingRecipes.cpp @@ -64,7 +64,7 @@ void cBrewingRecipes::AddRecipeFromLine(AString a_Line, unsigned int a_LineNum) { a_Line.erase(std::remove_if(a_Line.begin(), a_Line.end(), isspace), a_Line.end()); - auto Recipe = cpp14::make_unique<cRecipe>(); + auto Recipe = std::make_unique<cRecipe>(); const AStringVector & InputAndIngredient = StringSplit(a_Line, "+"); @@ -145,7 +145,7 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_ if (a_Input.m_ItemDamage & 0x2000) { // Create new recipe and add it to list - auto Recipe = cpp14::make_unique<cRecipe>(); + auto Recipe = std::make_unique<cRecipe>(); Recipe->Input.m_ItemType = a_Input.m_ItemDamage; Recipe->Output.m_ItemDamage = a_Input.m_ItemDamage + 8192; @@ -178,7 +178,7 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_ } // Create new recipe and add it to list - auto Recipe = cpp14::make_unique<cRecipe>(); + auto Recipe = std::make_unique<cRecipe>(); Recipe->Input.m_ItemDamage = a_Input.m_ItemDamage; Recipe->Output.m_ItemDamage = (*FoundRecipe)->Output.m_ItemDamage + 8192; diff --git a/src/ChunkDataCallback.h b/src/ChunkDataCallback.h index c26ec5beb..0f120bfb1 100644 --- a/src/ChunkDataCallback.h +++ b/src/ChunkDataCallback.h @@ -115,7 +115,7 @@ public: }; cChunkDataCopyCollector(): - m_Pool(cpp14::make_unique<MemCallbacks>(), 0, cChunkData::NumSections), // Keep 1 chunk worth of reserve + m_Pool(std::make_unique<MemCallbacks>(), 0, cChunkData::NumSections), // Keep 1 chunk worth of reserve m_Data(m_Pool) { } diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 9a3baa609..e548a02e8 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -39,8 +39,8 @@ cChunkMap::cChunkMap(cWorld * a_World) : m_World(a_World), m_Pool( - cpp14::make_unique<cListAllocationPool<cChunkData::sChunkSection>>( - cpp14::make_unique<cStarvationCallbacks>(), 1600u, 5000u + std::make_unique<cListAllocationPool<cChunkData::sChunkSection>>( + std::make_unique<cStarvationCallbacks>(), 1600u, 5000u ) ) { @@ -71,7 +71,7 @@ cChunkPtr cChunkMap::ConstructChunk(int a_ChunkX, int a_ChunkZ) return ( *m_Chunks.emplace( ChunkCoordinate{ a_ChunkX, a_ChunkZ }, - cpp14::make_unique<cChunk>( + std::make_unique<cChunk>( a_ChunkX, a_ChunkZ, this, diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index dc0af8647..ec05258ae 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -236,7 +236,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, std::unordered_set<cCli // If the chunk is not lighted, queue it for relighting and get notified when it's ready: if (!m_World.IsChunkLighted(a_ChunkX, a_ChunkZ)) { - m_World.QueueLightChunk(a_ChunkX, a_ChunkZ, cpp14::make_unique<cNotifyChunkSender>(*this, m_World)); + m_World.QueueLightChunk(a_ChunkX, a_ChunkZ, std::make_unique<cNotifyChunkSender>(*this, m_World)); return; } diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 15b7238fe..9dc1274d1 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -356,7 +356,7 @@ void cClientHandle::FinishAuthenticate(const AString & a_Name, const cUUID & a_U cWorld * World; { // Spawn player (only serversided, so data is loaded) - m_PlayerPtr = cpp14::make_unique<cPlayer>(m_Self, GetUsername()); + m_PlayerPtr = std::make_unique<cPlayer>(m_Self, GetUsername()); m_Player = m_PlayerPtr.get(); /* LOGD("Created a new cPlayer object at %p for client %s @ %s (%p)", diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp index 7cd41ec97..d08a3943c 100644 --- a/src/CraftingRecipes.cpp +++ b/src/CraftingRecipes.cpp @@ -464,7 +464,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine return; } - std::unique_ptr<cCraftingRecipes::cRecipe> Recipe = cpp14::make_unique<cCraftingRecipes::cRecipe>(); + std::unique_ptr<cCraftingRecipes::cRecipe> Recipe = std::make_unique<cCraftingRecipes::cRecipe>(); AStringVector RecipeSplit = StringSplit(Sides[0], ":"); const auto * resultPart = &RecipeSplit[0]; @@ -852,7 +852,7 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti } // for y, for x // The recipe has matched. Create a copy of the recipe and set its coords to match the crafting grid: - std::unique_ptr<cRecipe> Recipe = cpp14::make_unique<cRecipe>(); + std::unique_ptr<cRecipe> Recipe = std::make_unique<cRecipe>(); Recipe->m_Result = a_Recipe->m_Result; Recipe->m_Width = a_Recipe->m_Width; Recipe->m_Height = a_Recipe->m_Height; diff --git a/src/Entities/EntityEffect.cpp b/src/Entities/EntityEffect.cpp index 9475a1710..ef38e3a80 100644 --- a/src/Entities/EntityEffect.cpp +++ b/src/Entities/EntityEffect.cpp @@ -191,31 +191,31 @@ std::unique_ptr<cEntityEffect> cEntityEffect::CreateEntityEffect(cEntityEffect:: { switch (a_EffectType) { - case cEntityEffect::effNoEffect: return cpp14::make_unique<cEntityEffect >(a_Duration, a_Intensity, a_DistanceModifier); - - case cEntityEffect::effAbsorption: return cpp14::make_unique<cEntityEffectAbsorption >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effBlindness: return cpp14::make_unique<cEntityEffectBlindness >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effFireResistance: return cpp14::make_unique<cEntityEffectFireResistance>(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHaste: return cpp14::make_unique<cEntityEffectHaste >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHealthBoost: return cpp14::make_unique<cEntityEffectHealthBoost >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effHunger: return cpp14::make_unique<cEntityEffectHunger >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInstantDamage: return cpp14::make_unique<cEntityEffectInstantDamage >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInstantHealth: return cpp14::make_unique<cEntityEffectInstantHealth >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effInvisibility: return cpp14::make_unique<cEntityEffectInvisibility >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effJumpBoost: return cpp14::make_unique<cEntityEffectJumpBoost >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effMiningFatigue: return cpp14::make_unique<cEntityEffectMiningFatigue >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effNausea: return cpp14::make_unique<cEntityEffectNausea >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effNightVision: return cpp14::make_unique<cEntityEffectNightVision >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effPoison: return cpp14::make_unique<cEntityEffectPoison >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effRegeneration: return cpp14::make_unique<cEntityEffectRegeneration >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effResistance: return cpp14::make_unique<cEntityEffectResistance >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSaturation: return cpp14::make_unique<cEntityEffectSaturation >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSlowness: return cpp14::make_unique<cEntityEffectSlowness >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effSpeed: return cpp14::make_unique<cEntityEffectSpeed >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effStrength: return cpp14::make_unique<cEntityEffectStrength >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWaterBreathing: return cpp14::make_unique<cEntityEffectWaterBreathing>(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWeakness: return cpp14::make_unique<cEntityEffectWeakness >(a_Duration, a_Intensity, a_DistanceModifier); - case cEntityEffect::effWither: return cpp14::make_unique<cEntityEffectWither >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNoEffect: return std::make_unique<cEntityEffect >(a_Duration, a_Intensity, a_DistanceModifier); + + case cEntityEffect::effAbsorption: return std::make_unique<cEntityEffectAbsorption >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effBlindness: return std::make_unique<cEntityEffectBlindness >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effFireResistance: return std::make_unique<cEntityEffectFireResistance>(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHaste: return std::make_unique<cEntityEffectHaste >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHealthBoost: return std::make_unique<cEntityEffectHealthBoost >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effHunger: return std::make_unique<cEntityEffectHunger >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInstantDamage: return std::make_unique<cEntityEffectInstantDamage >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInstantHealth: return std::make_unique<cEntityEffectInstantHealth >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effInvisibility: return std::make_unique<cEntityEffectInvisibility >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effJumpBoost: return std::make_unique<cEntityEffectJumpBoost >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effMiningFatigue: return std::make_unique<cEntityEffectMiningFatigue >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNausea: return std::make_unique<cEntityEffectNausea >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effNightVision: return std::make_unique<cEntityEffectNightVision >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effPoison: return std::make_unique<cEntityEffectPoison >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effRegeneration: return std::make_unique<cEntityEffectRegeneration >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effResistance: return std::make_unique<cEntityEffectResistance >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSaturation: return std::make_unique<cEntityEffectSaturation >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSlowness: return std::make_unique<cEntityEffectSlowness >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effSpeed: return std::make_unique<cEntityEffectSpeed >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effStrength: return std::make_unique<cEntityEffectStrength >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWaterBreathing: return std::make_unique<cEntityEffectWaterBreathing>(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWeakness: return std::make_unique<cEntityEffectWeakness >(a_Duration, a_Intensity, a_DistanceModifier); + case cEntityEffect::effWither: return std::make_unique<cEntityEffectWither >(a_Duration, a_Intensity, a_DistanceModifier); } UNREACHABLE("Unsupported entity effect"); } diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index a8ba83b5d..1887e32a6 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -264,15 +264,15 @@ std::unique_ptr<cProjectileEntity> cProjectileEntity::Create( switch (a_Kind) { - case pkArrow: return cpp14::make_unique<cArrowEntity> (a_Creator, a_Pos, Speed); - case pkEgg: return cpp14::make_unique<cThrownEggEntity> (a_Creator, a_Pos, Speed); - case pkEnderPearl: return cpp14::make_unique<cThrownEnderPearlEntity>(a_Creator, a_Pos, Speed); - case pkSnowball: return cpp14::make_unique<cThrownSnowballEntity> (a_Creator, a_Pos, Speed); - case pkGhastFireball: return cpp14::make_unique<cGhastFireballEntity> (a_Creator, a_Pos, Speed); - case pkFireCharge: return cpp14::make_unique<cFireChargeEntity> (a_Creator, a_Pos, Speed); - case pkExpBottle: return cpp14::make_unique<cExpBottleEntity> (a_Creator, a_Pos, Speed); - case pkSplashPotion: return cpp14::make_unique<cSplashPotionEntity> (a_Creator, a_Pos, Speed, *a_Item); - case pkWitherSkull: return cpp14::make_unique<cWitherSkullEntity> (a_Creator, a_Pos, Speed); + case pkArrow: return std::make_unique<cArrowEntity> (a_Creator, a_Pos, Speed); + case pkEgg: return std::make_unique<cThrownEggEntity> (a_Creator, a_Pos, Speed); + case pkEnderPearl: return std::make_unique<cThrownEnderPearlEntity>(a_Creator, a_Pos, Speed); + case pkSnowball: return std::make_unique<cThrownSnowballEntity> (a_Creator, a_Pos, Speed); + case pkGhastFireball: return std::make_unique<cGhastFireballEntity> (a_Creator, a_Pos, Speed); + case pkFireCharge: return std::make_unique<cFireChargeEntity> (a_Creator, a_Pos, Speed); + case pkExpBottle: return std::make_unique<cExpBottleEntity> (a_Creator, a_Pos, Speed); + case pkSplashPotion: return std::make_unique<cSplashPotionEntity> (a_Creator, a_Pos, Speed, *a_Item); + case pkWitherSkull: return std::make_unique<cWitherSkullEntity> (a_Creator, a_Pos, Speed); case pkFirework: { ASSERT(a_Item != nullptr); @@ -281,7 +281,7 @@ std::unique_ptr<cProjectileEntity> cProjectileEntity::Create( return nullptr; } - return cpp14::make_unique<cFireworkEntity>(a_Creator, a_Pos, *a_Item); + return std::make_unique<cFireworkEntity>(a_Creator, a_Pos, *a_Item); } } diff --git a/src/FurnaceRecipe.cpp b/src/FurnaceRecipe.cpp index 4e642cccd..621a47a31 100644 --- a/src/FurnaceRecipe.cpp +++ b/src/FurnaceRecipe.cpp @@ -117,7 +117,7 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line Line.erase(Line.begin()); // Remove the beginning "!" Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end()); - std::unique_ptr<cItem> Item = cpp14::make_unique<cItem>(); + std::unique_ptr<cItem> Item = std::make_unique<cItem>(); int BurnTime; const AStringVector & Sides = StringSplit(Line, "="); @@ -160,8 +160,8 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li int CookTime = 200; float Reward = 0; - std::unique_ptr<cItem> InputItem = cpp14::make_unique<cItem>(); - std::unique_ptr<cItem> OutputItem = cpp14::make_unique<cItem>(); + std::unique_ptr<cItem> InputItem = std::make_unique<cItem>(); + std::unique_ptr<cItem> OutputItem = std::make_unique<cItem>(); const AStringVector & Sides = StringSplit(Line, "="); if (Sides.size() != 2) diff --git a/src/Generating/PieceGeneratorBFSTree.cpp b/src/Generating/PieceGeneratorBFSTree.cpp index b6929d4b0..4d9c78b45 100644 --- a/src/Generating/PieceGeneratorBFSTree.cpp +++ b/src/Generating/PieceGeneratorBFSTree.cpp @@ -177,7 +177,7 @@ bool cPieceGeneratorBFSTree::TryPlacePieceAtConnector( // Place the piece: Vector3i NewPos = Conn.m_Piece->RotatePos(Conn.m_Connector.m_Pos, Conn.m_NumCCWRotations); ConnPos -= NewPos; - auto PlacedPiece = cpp14::make_unique<cPlacedPiece>(&a_ParentPiece, *(Conn.m_Piece), ConnPos, Conn.m_NumCCWRotations); + auto PlacedPiece = std::make_unique<cPlacedPiece>(&a_ParentPiece, *(Conn.m_Piece), ConnPos, Conn.m_NumCCWRotations); // Add the new piece's connectors to the list of free connectors: cPiece::cConnectors Connectors = Conn.m_Piece->GetConnectors(); diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index d984912cb..e52bb1621 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -398,7 +398,7 @@ std::unique_ptr<cPrefab> cPrefabPiecePool::LoadPrefabFromCubesetVer1( ); return nullptr; } - return cpp14::make_unique<cPrefab>(area); + return std::make_unique<cPrefab>(area); } // if (SchematicFileName) // There's no referenced schematic file, load from BlockDefinitions / BlockData. @@ -452,7 +452,7 @@ std::unique_ptr<cPrefab> cPrefabPiecePool::LoadPrefabFromCubesetVer1( return nullptr; } - return cpp14::make_unique<cPrefab>(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ); + return std::make_unique<cPrefab>(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ); } diff --git a/src/Globals.h b/src/Globals.h index 114991129..c29f3200a 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -327,12 +327,7 @@ typename std::enable_if<std::is_arithmetic<T>::value, C>::type CeilC(T a_Value) -// TODO: Replace cpp14 with std at point of use -namespace cpp14 -{ -using std::make_unique; -} // a tick is 50 ms using cTickTime = std::chrono::duration<int, std::ratio_multiply<std::chrono::milliseconds::period, std::ratio<50>>>; diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index b7a9ef638..636df5753 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -70,7 +70,7 @@ public: } // Create the arrow entity: - auto Arrow = cpp14::make_unique<cArrowEntity>(*a_Player, Force * 2); + auto Arrow = std::make_unique<cArrowEntity>(*a_Player, Force * 2); auto ArrowPtr = Arrow.get(); if (!ArrowPtr->Initialize(std::move(Arrow), *a_Player->GetWorld())) { diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h index 8817c8c38..008ecd01e 100644 --- a/src/Items/ItemFishingRod.h +++ b/src/Items/ItemFishingRod.h @@ -88,7 +88,7 @@ public: // Cast a hook: auto & Random = GetRandomProvider(); auto CountDownTime = Random.RandInt(100, 900) - static_cast<int>(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100); - auto Floater = cpp14::make_unique<cFloater>( + auto Floater = std::make_unique<cFloater>( a_Player->GetEyePosition(), a_Player->GetLookVector() * 15, a_Player->GetUniqueID(), CountDownTime diff --git a/src/Items/ItemItemFrame.h b/src/Items/ItemItemFrame.h index 2c191a003..f1f687461 100644 --- a/src/Items/ItemItemFrame.h +++ b/src/Items/ItemItemFrame.h @@ -49,7 +49,7 @@ public: } // Place the item frame: - auto ItemFrame = cpp14::make_unique<cItemFrame>(a_ClickedBlockFace, PlacePos); + auto ItemFrame = std::make_unique<cItemFrame>(a_ClickedBlockFace, PlacePos); auto ItemFramePtr = ItemFrame.get(); if (!ItemFramePtr->Initialize(std::move(ItemFrame), *a_World)) { diff --git a/src/Items/ItemPainting.h b/src/Items/ItemPainting.h index cc1d02ac4..78d9f040a 100644 --- a/src/Items/ItemPainting.h +++ b/src/Items/ItemPainting.h @@ -85,7 +85,7 @@ public: }; auto PaintingTitle = gPaintingTitlesList[a_World->GetTickRandomNumber(ARRAYCOUNT(gPaintingTitlesList) - 1)]; - auto Painting = cpp14::make_unique<cPainting>(PaintingTitle, a_ClickedBlockFace, PlacePos); + auto Painting = std::make_unique<cPainting>(PaintingTitle, a_ClickedBlockFace, PlacePos); auto PaintingPtr = Painting.get(); if (!PaintingPtr->Initialize(std::move(Painting), *a_World)) { diff --git a/src/LoggerListeners.cpp b/src/LoggerListeners.cpp index b7c8fbb38..19b8c82d7 100644 --- a/src/LoggerListeners.cpp +++ b/src/LoggerListeners.cpp @@ -211,7 +211,7 @@ std::unique_ptr<cLogger::cListener> MakeConsoleListener(bool a_IsService) { if (a_IsService) { - return cpp14::make_unique<cNullConsoleListener>(); + return std::make_unique<cNullConsoleListener>(); } #ifdef _WIN32 @@ -223,24 +223,24 @@ std::unique_ptr<cLogger::cListener> MakeConsoleListener(bool a_IsService) HANDLE Console = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(Console, &sbi); WORD DefaultConsoleAttrib = sbi.wAttributes; - return cpp14::make_unique<cWindowsConsoleListener>(Console, DefaultConsoleAttrib); + return std::make_unique<cWindowsConsoleListener>(Console, DefaultConsoleAttrib); } else { - return cpp14::make_unique<cVanillaCPPConsoleListener>(); + return std::make_unique<cVanillaCPPConsoleListener>(); } #elif defined (__linux) || defined (__APPLE__) // TODO: lookup terminal in terminfo if (isatty(fileno(stdout))) { - return cpp14::make_unique<cANSIConsoleListener>(); + return std::make_unique<cANSIConsoleListener>(); } else { - return cpp14::make_unique<cVanillaCPPConsoleListener>(); + return std::make_unique<cVanillaCPPConsoleListener>(); } #else - return cpp14::make_unique<cVanillaCPPConsoleListener>(); + return std::make_unique<cVanillaCPPConsoleListener>(); #endif } @@ -323,7 +323,7 @@ private: std::pair<bool, std::unique_ptr<cLogger::cListener>> MakeFileListener() { - auto listener = cpp14::make_unique<cFileListener>(); + auto listener = std::make_unique<cFileListener>(); if (!listener->Open()) { return {false, nullptr}; diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp index a87cc02fb..a1c41d392 100644 --- a/src/Mobs/Blaze.cpp +++ b/src/Mobs/Blaze.cpp @@ -69,7 +69,7 @@ void cBlaze::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d Speed = GetLookVector() * 20; Speed.y = Speed.y + 1; - auto FireCharge = cpp14::make_unique<cFireChargeEntity>(this, GetPosition().addedY(1), Speed); + auto FireCharge = std::make_unique<cFireChargeEntity>(this, GetPosition().addedY(1), Speed); auto FireChargePtr = FireCharge.get(); FireChargePtr->Initialize(std::move(FireCharge), *m_World); diff --git a/src/Mobs/Ghast.cpp b/src/Mobs/Ghast.cpp index 88b10294a..3b20bea28 100644 --- a/src/Mobs/Ghast.cpp +++ b/src/Mobs/Ghast.cpp @@ -89,7 +89,7 @@ void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d Speed = GetLookVector() * 20; Speed.y = Speed.y + 1; - auto GhastBall = cpp14::make_unique<cGhastFireballEntity>(this, GetPosition(), Speed); + auto GhastBall = std::make_unique<cGhastFireballEntity>(this, GetPosition(), Speed); auto GhastBallPtr = GhastBall.get(); GhastBallPtr->Initialize(std::move(GhastBall), *m_World); diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 1c3b3a45e..ec240b61c 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -1181,13 +1181,13 @@ std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_MobType) { case mtMagmaCube: { - return cpp14::make_unique<cMagmaCube>(1 << Random.RandInt(2)); // Size 1, 2 or 4 + return std::make_unique<cMagmaCube>(1 << Random.RandInt(2)); // Size 1, 2 or 4 } case mtSlime: { - return cpp14::make_unique<cSlime>(1 << Random.RandInt(2)); // Size 1, 2 or 4 + return std::make_unique<cSlime>(1 << Random.RandInt(2)); // Size 1, 2 or 4 } - case mtVillager: return cpp14::make_unique<cVillager>(cVillager::GetRandomProfession()); + case mtVillager: return std::make_unique<cVillager>(cVillager::GetRandomProfession()); case mtHorse: { // Horses take a type (species), a colour, and a style (dots, stripes, etc.) @@ -1202,40 +1202,40 @@ std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_MobType) HorseType = 0; } - return cpp14::make_unique<cHorse>(HorseType, HorseColor, HorseStyle, HorseTameTimes); + return std::make_unique<cHorse>(HorseType, HorseColor, HorseStyle, HorseTameTimes); } case mtZombieVillager: { - return cpp14::make_unique<cZombieVillager>(cVillager::GetRandomProfession()); + return std::make_unique<cZombieVillager>(cVillager::GetRandomProfession()); } - case mtBat: return cpp14::make_unique<cBat>(); - case mtBlaze: return cpp14::make_unique<cBlaze>(); - case mtCaveSpider: return cpp14::make_unique<cCaveSpider>(); - case mtChicken: return cpp14::make_unique<cChicken>(); - case mtCow: return cpp14::make_unique<cCow>(); - case mtCreeper: return cpp14::make_unique<cCreeper>(); - case mtEnderDragon: return cpp14::make_unique<cEnderDragon>(); - case mtEnderman: return cpp14::make_unique<cEnderman>(); - case mtGhast: return cpp14::make_unique<cGhast>(); - case mtGiant: return cpp14::make_unique<cGiant>(); - case mtGuardian: return cpp14::make_unique<cGuardian>(); - case mtIronGolem: return cpp14::make_unique<cIronGolem>(); - case mtMooshroom: return cpp14::make_unique<cMooshroom>(); - case mtOcelot: return cpp14::make_unique<cOcelot>(); - case mtPig: return cpp14::make_unique<cPig>(); - case mtRabbit: return cpp14::make_unique<cRabbit>(); - case mtSheep: return cpp14::make_unique<cSheep>(); - case mtSilverfish: return cpp14::make_unique<cSilverfish>(); - case mtSkeleton: return cpp14::make_unique<cSkeleton>(); - case mtSnowGolem: return cpp14::make_unique<cSnowGolem>(); - case mtSpider: return cpp14::make_unique<cSpider>(); - case mtSquid: return cpp14::make_unique<cSquid>(); - case mtWitch: return cpp14::make_unique<cWitch>(); - case mtWither: return cpp14::make_unique<cWither>(); - case mtWitherSkeleton: return cpp14::make_unique<cWitherSkeleton>(); - case mtWolf: return cpp14::make_unique<cWolf>(); - case mtZombie: return cpp14::make_unique<cZombie>(); - case mtZombiePigman: return cpp14::make_unique<cZombiePigman>(); + case mtBat: return std::make_unique<cBat>(); + case mtBlaze: return std::make_unique<cBlaze>(); + case mtCaveSpider: return std::make_unique<cCaveSpider>(); + case mtChicken: return std::make_unique<cChicken>(); + case mtCow: return std::make_unique<cCow>(); + case mtCreeper: return std::make_unique<cCreeper>(); + case mtEnderDragon: return std::make_unique<cEnderDragon>(); + case mtEnderman: return std::make_unique<cEnderman>(); + case mtGhast: return std::make_unique<cGhast>(); + case mtGiant: return std::make_unique<cGiant>(); + case mtGuardian: return std::make_unique<cGuardian>(); + case mtIronGolem: return std::make_unique<cIronGolem>(); + case mtMooshroom: return std::make_unique<cMooshroom>(); + case mtOcelot: return std::make_unique<cOcelot>(); + case mtPig: return std::make_unique<cPig>(); + case mtRabbit: return std::make_unique<cRabbit>(); + case mtSheep: return std::make_unique<cSheep>(); + case mtSilverfish: return std::make_unique<cSilverfish>(); + case mtSkeleton: return std::make_unique<cSkeleton>(); + case mtSnowGolem: return std::make_unique<cSnowGolem>(); + case mtSpider: return std::make_unique<cSpider>(); + case mtSquid: return std::make_unique<cSquid>(); + case mtWitch: return std::make_unique<cWitch>(); + case mtWither: return std::make_unique<cWither>(); + case mtWitherSkeleton: return std::make_unique<cWitherSkeleton>(); + case mtWolf: return std::make_unique<cWolf>(); + case mtZombie: return std::make_unique<cZombie>(); + case mtZombiePigman: return std::make_unique<cZombiePigman>(); default: { ASSERT(!"Unhandled mob type whilst trying to spawn mob!"); diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 44700e9d3..3af4cad6e 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -46,7 +46,7 @@ bool cSkeleton::Attack(std::chrono::milliseconds a_Dt) Vector3d Speed = (GetTarget()->GetPosition() + Inaccuracy - GetPosition()) * 5; Speed.y += Random.RandInt(-1, 1); - auto Arrow = cpp14::make_unique<cArrowEntity>(this, GetPosition().addedY(1), Speed); + auto Arrow = std::make_unique<cArrowEntity>(this, GetPosition().addedY(1), Speed); auto ArrowPtr = Arrow.get(); if (!ArrowPtr->Initialize(std::move(Arrow), *m_World)) { diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 00cf30d13..601d9b747 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -79,7 +79,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI) double AddX = (i % 2 - 0.5) * m_Size / 4.0; double AddZ = (i / 2 - 0.5) * m_Size / 4.0; - auto NewSlime = cpp14::make_unique<cSlime>(m_Size / 2); + auto NewSlime = std::make_unique<cSlime>(m_Size / 2); NewSlime->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ); NewSlime->SetYaw(Random.RandReal(360.0f)); m_World->SpawnMobFinalize(std::move(NewSlime)); diff --git a/src/Root.cpp b/src/Root.cpp index 8b8df817d..4b40fd983 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -177,7 +177,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) m_SettingsFilename = a_OverridesRepo->GetValue("Server","ConfigFile"); } - auto IniFile = cpp14::make_unique<cIniFile>(); + auto IniFile = std::make_unique<cIniFile>(); bool IsNewIniFile = !IniFile->ReadFile(m_SettingsFilename); if (IsNewIniFile) @@ -187,7 +187,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) IniFile->AddHeaderComment(" Most of the settings here can be configured using the webadmin interface, if enabled in webadmin.ini"); } - auto settingsRepo = cpp14::make_unique<cOverridesSettingsRepository>(std::move(IniFile), std::move(a_OverridesRepo)); + auto settingsRepo = std::make_unique<cOverridesSettingsRepository>(std::move(IniFile), std::move(a_OverridesRepo)); LOG("Starting server..."); diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index d27e53d1c..8f850dec4 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -26,7 +26,7 @@ struct sMemCallbacks: cSetChunkData::cSetChunkData(int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty) : m_ChunkX(a_ChunkX), m_ChunkZ(a_ChunkZ), - m_Pool(cpp14::make_unique<sMemCallbacks>(), 0u, cChunkData::NumSections), + m_Pool(std::make_unique<sMemCallbacks>(), 0u, cChunkData::NumSections), m_ChunkData(m_Pool), m_IsLightValid(false), m_IsHeightMapValid(false), diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp index c4aa0a94b..fdcd69069 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp @@ -60,18 +60,18 @@ std::unique_ptr<cRedstoneHandler> cIncrementalRedstoneSimulator::CreateComponent { case E_BLOCK_ACTIVATOR_RAIL: case E_BLOCK_DETECTOR_RAIL: - case E_BLOCK_POWERED_RAIL: return cpp14::make_unique<cPoweredRailHandler>(); + case E_BLOCK_POWERED_RAIL: return std::make_unique<cPoweredRailHandler>(); case E_BLOCK_ACTIVE_COMPARATOR: - case E_BLOCK_INACTIVE_COMPARATOR: return cpp14::make_unique<cRedstoneComparatorHandler>(); + case E_BLOCK_INACTIVE_COMPARATOR: return std::make_unique<cRedstoneComparatorHandler>(); case E_BLOCK_DISPENSER: - case E_BLOCK_DROPPER: return cpp14::make_unique<cDropSpenserHandler>(); + case E_BLOCK_DROPPER: return std::make_unique<cDropSpenserHandler>(); case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: case E_BLOCK_STONE_PRESSURE_PLATE: - case E_BLOCK_WOODEN_PRESSURE_PLATE: return cpp14::make_unique<cPressurePlateHandler>(); + case E_BLOCK_WOODEN_PRESSURE_PLATE: return std::make_unique<cPressurePlateHandler>(); case E_BLOCK_ACACIA_FENCE_GATE: case E_BLOCK_BIRCH_FENCE_GATE: @@ -80,44 +80,44 @@ std::unique_ptr<cRedstoneHandler> cIncrementalRedstoneSimulator::CreateComponent case E_BLOCK_IRON_TRAPDOOR: case E_BLOCK_JUNGLE_FENCE_GATE: case E_BLOCK_SPRUCE_FENCE_GATE: - case E_BLOCK_TRAPDOOR: return cpp14::make_unique<cSmallGateHandler>(); + case E_BLOCK_TRAPDOOR: return std::make_unique<cSmallGateHandler>(); case E_BLOCK_REDSTONE_LAMP_OFF: - case E_BLOCK_REDSTONE_LAMP_ON: return cpp14::make_unique<cRedstoneLampHandler>(); + case E_BLOCK_REDSTONE_LAMP_ON: return std::make_unique<cRedstoneLampHandler>(); case E_BLOCK_REDSTONE_REPEATER_OFF: - case E_BLOCK_REDSTONE_REPEATER_ON: return cpp14::make_unique<cRedstoneRepeaterHandler>(); + case E_BLOCK_REDSTONE_REPEATER_ON: return std::make_unique<cRedstoneRepeaterHandler>(); case E_BLOCK_REDSTONE_TORCH_OFF: - case E_BLOCK_REDSTONE_TORCH_ON: return cpp14::make_unique<cRedstoneTorchHandler>(); + case E_BLOCK_REDSTONE_TORCH_ON: return std::make_unique<cRedstoneTorchHandler>(); - case E_BLOCK_OBSERVER: return cpp14::make_unique<cObserverHandler>(); + case E_BLOCK_OBSERVER: return std::make_unique<cObserverHandler>(); case E_BLOCK_PISTON: - case E_BLOCK_STICKY_PISTON: return cpp14::make_unique<cPistonHandler>(); + case E_BLOCK_STICKY_PISTON: return std::make_unique<cPistonHandler>(); case E_BLOCK_LEVER: case E_BLOCK_STONE_BUTTON: - case E_BLOCK_WOODEN_BUTTON: return cpp14::make_unique<cRedstoneToggleHandler>(); - - case E_BLOCK_BLOCK_OF_REDSTONE: return cpp14::make_unique<cRedstoneBlockHandler>(); - case E_BLOCK_COMMAND_BLOCK: return cpp14::make_unique<cCommandBlockHandler>(); - case E_BLOCK_HOPPER: return cpp14::make_unique<cHopperHandler>(); - case E_BLOCK_NOTE_BLOCK: return cpp14::make_unique<cNoteBlockHandler>(); - case E_BLOCK_REDSTONE_WIRE: return cpp14::make_unique<cRedstoneWireHandler>(); - case E_BLOCK_TNT: return cpp14::make_unique<cTNTHandler>(); - case E_BLOCK_TRAPPED_CHEST: return cpp14::make_unique<cTrappedChestHandler>(); - case E_BLOCK_TRIPWIRE_HOOK: return cpp14::make_unique<cTripwireHookHandler>(); + case E_BLOCK_WOODEN_BUTTON: return std::make_unique<cRedstoneToggleHandler>(); + + case E_BLOCK_BLOCK_OF_REDSTONE: return std::make_unique<cRedstoneBlockHandler>(); + case E_BLOCK_COMMAND_BLOCK: return std::make_unique<cCommandBlockHandler>(); + case E_BLOCK_HOPPER: return std::make_unique<cHopperHandler>(); + case E_BLOCK_NOTE_BLOCK: return std::make_unique<cNoteBlockHandler>(); + case E_BLOCK_REDSTONE_WIRE: return std::make_unique<cRedstoneWireHandler>(); + case E_BLOCK_TNT: return std::make_unique<cTNTHandler>(); + case E_BLOCK_TRAPPED_CHEST: return std::make_unique<cTrappedChestHandler>(); + case E_BLOCK_TRIPWIRE_HOOK: return std::make_unique<cTripwireHookHandler>(); default: { if (cBlockDoorHandler::IsDoorBlockType(a_BlockType)) { - return cpp14::make_unique<cDoorHandler>(); + return std::make_unique<cDoorHandler>(); } if (cBlockInfo::FullyOccupiesVoxel(a_BlockType)) { - return cpp14::make_unique<cSolidBlockHandler>(); + return std::make_unique<cSolidBlockHandler>(); } return nullptr; } diff --git a/src/SpawnPrepare.cpp b/src/SpawnPrepare.cpp index e9f9e3b09..d79e12754 100644 --- a/src/SpawnPrepare.cpp +++ b/src/SpawnPrepare.cpp @@ -59,7 +59,7 @@ void cSpawnPrepare::PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_Spa { int chunkX, chunkZ; prep->DecodeChunkCoords(i, chunkX, chunkZ); - a_World.PrepareChunk(chunkX, chunkZ, cpp14::make_unique<cSpawnPrepareCallback>(prep)); + a_World.PrepareChunk(chunkX, chunkZ, std::make_unique<cSpawnPrepareCallback>(prep)); } // for i // Wait for the lighting thread to prepare everything. Event is set in the Call() callback: @@ -107,7 +107,7 @@ void cSpawnPrepare::PreparedChunkCallback(int a_ChunkX, int a_ChunkZ) { int chunkX, chunkZ; DecodeChunkCoords(m_NextIdx, chunkX, chunkZ); - m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, cpp14::make_unique<cSpawnPrepareCallback>(shared_from_this())); + m_World.GetLightingThread().QueueChunk(chunkX, chunkZ, std::make_unique<cSpawnPrepareCallback>(shared_from_this())); m_NextIdx += 1; } diff --git a/src/World.cpp b/src/World.cpp index 6e7c066c9..d13081fb0 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -225,7 +225,7 @@ cWorld::cWorld( cFile::CreateFolderRecursive(m_DataPath); - m_ChunkMap = cpp14::make_unique<cChunkMap>(this); + m_ChunkMap = std::make_unique<cChunkMap>(this); m_ChunkMap->TrackInDeadlockDetect(a_DeadlockDetect, m_WorldName); // Load the scoreboard @@ -419,11 +419,11 @@ cWorld::cWorld( m_BlockTickQueueCopy.reserve(1000); // Simulators: - m_SimulatorManager = cpp14::make_unique<cSimulatorManager>(*this); + m_SimulatorManager = std::make_unique<cSimulatorManager>(*this); m_WaterSimulator = InitializeFluidSimulator(IniFile, "Water", E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER); m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA); - m_SandSimulator = cpp14::make_unique<cSandSimulator>(*this, IniFile); - m_FireSimulator = cpp14::make_unique<cFireSimulator>(*this, IniFile); + m_SandSimulator = std::make_unique<cSandSimulator>(*this, IniFile); + m_FireSimulator = std::make_unique<cFireSimulator>(*this, IniFile); m_RedstoneSimulator = InitializeRedstoneSimulator(IniFile); // Water, Lava and Redstone simulators get registered in their initialize function. @@ -1988,7 +1988,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, double a float SpeedY = static_cast<float>(a_FlyAwaySpeed * Random.RandInt(40, 50)); float SpeedZ = static_cast<float>(a_FlyAwaySpeed * Random.RandInt(-10, 10)); - auto Pickup = cpp14::make_unique<cPickup>(a_Pos, *itr, a_IsPlayerCreated, Vector3f{SpeedX, SpeedY, SpeedZ}); + auto Pickup = std::make_unique<cPickup>(a_Pos, *itr, a_IsPlayerCreated, Vector3f{SpeedX, SpeedY, SpeedZ}); auto PickupPtr = Pickup.get(); PickupPtr->Initialize(std::move(Pickup), *this); } @@ -2007,7 +2007,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, Vector3d continue; } - auto pickup = cpp14::make_unique<cPickup>(a_Pos, *itr, a_IsPlayerCreated, a_Speed); + auto pickup = std::make_unique<cPickup>(a_Pos, *itr, a_IsPlayerCreated, a_Speed); auto pickupPtr = pickup.get(); pickupPtr->Initialize(std::move(pickup), *this); } @@ -2019,7 +2019,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, Vector3d UInt32 cWorld::SpawnItemPickup(Vector3d a_Pos, const cItem & a_Item, Vector3f a_Speed, int a_LifetimeTicks, bool a_CanCombine) { - auto pickup = cpp14::make_unique<cPickup>(a_Pos, a_Item, false, a_Speed, a_LifetimeTicks, a_CanCombine); + auto pickup = std::make_unique<cPickup>(a_Pos, a_Item, false, a_Speed, a_LifetimeTicks, a_CanCombine); auto pickupPtr = pickup.get(); if (!pickupPtr->Initialize(std::move(pickup), *this)) { @@ -2034,7 +2034,7 @@ UInt32 cWorld::SpawnItemPickup(Vector3d a_Pos, const cItem & a_Item, Vector3f a_ UInt32 cWorld::SpawnFallingBlock(Vector3d a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { - auto fallingBlock = cpp14::make_unique<cFallingBlock>(a_Pos, a_BlockType, a_BlockMeta); + auto fallingBlock = std::make_unique<cFallingBlock>(a_Pos, a_BlockType, a_BlockMeta); auto fallingBlockPtr = fallingBlock.get(); auto ID = fallingBlock->GetUniqueID(); if (!fallingBlockPtr->Initialize(std::move(fallingBlock), *this)) @@ -2056,7 +2056,7 @@ UInt32 cWorld::SpawnExperienceOrb(Vector3d a_Pos, int a_Reward) return cEntity::INVALID_ID; } - auto expOrb = cpp14::make_unique<cExpOrb>(a_Pos, a_Reward); + auto expOrb = std::make_unique<cExpOrb>(a_Pos, a_Reward); auto expOrbPtr = expOrb.get(); if (!expOrbPtr->Initialize(std::move(expOrb), *this)) { @@ -2091,7 +2091,7 @@ std::vector<UInt32> cWorld::SpawnSplitExperienceOrbs(Vector3d a_Pos, int a_Rewar auto & Random = GetRandomProvider(); for (auto Reward : Rewards) { - auto ExpOrb = cpp14::make_unique<cExpOrb>(a_Pos, Reward); + auto ExpOrb = std::make_unique<cExpOrb>(a_Pos, Reward); auto ExpOrbPtr = ExpOrb.get(); double SpeedX = Random.RandReal(-SpeedLimit, SpeedLimit); double SpeedY = Random.RandReal(0.5); @@ -2117,11 +2117,11 @@ UInt32 cWorld::SpawnMinecart(Vector3d a_Pos, int a_MinecartType, const cItem & a std::unique_ptr<cMinecart> Minecart; switch (a_MinecartType) { - case E_ITEM_MINECART: Minecart = cpp14::make_unique<cRideableMinecart> (a_Pos, a_Content, a_BlockHeight); break; - case E_ITEM_CHEST_MINECART: Minecart = cpp14::make_unique<cMinecartWithChest> (a_Pos); break; - case E_ITEM_FURNACE_MINECART: Minecart = cpp14::make_unique<cMinecartWithFurnace>(a_Pos); break; - case E_ITEM_MINECART_WITH_TNT: Minecart = cpp14::make_unique<cMinecartWithTNT> (a_Pos); break; - case E_ITEM_MINECART_WITH_HOPPER: Minecart = cpp14::make_unique<cMinecartWithHopper> (a_Pos); break; + case E_ITEM_MINECART: Minecart = std::make_unique<cRideableMinecart> (a_Pos, a_Content, a_BlockHeight); break; + case E_ITEM_CHEST_MINECART: Minecart = std::make_unique<cMinecartWithChest> (a_Pos); break; + case E_ITEM_FURNACE_MINECART: Minecart = std::make_unique<cMinecartWithFurnace>(a_Pos); break; + case E_ITEM_MINECART_WITH_TNT: Minecart = std::make_unique<cMinecartWithTNT> (a_Pos); break; + case E_ITEM_MINECART_WITH_HOPPER: Minecart = std::make_unique<cMinecartWithHopper> (a_Pos); break; default: { return cEntity::INVALID_ID; @@ -2142,7 +2142,7 @@ UInt32 cWorld::SpawnMinecart(Vector3d a_Pos, int a_MinecartType, const cItem & a UInt32 cWorld::SpawnBoat(Vector3d a_Pos, cBoat::eMaterial a_Material) { - auto Boat = cpp14::make_unique<cBoat>(a_Pos, a_Material); + auto Boat = std::make_unique<cBoat>(a_Pos, a_Material); auto BoatPtr = Boat.get(); if (!BoatPtr->Initialize(std::move(Boat), *this)) { @@ -2157,7 +2157,7 @@ UInt32 cWorld::SpawnBoat(Vector3d a_Pos, cBoat::eMaterial a_Material) UInt32 cWorld::SpawnPrimedTNT(Vector3d a_Pos, int a_FuseTicks, double a_InitialVelocityCoeff, bool a_ShouldPlayFuseSound) { - auto TNT = cpp14::make_unique<cTNTEntity>(a_Pos, a_FuseTicks); + auto TNT = std::make_unique<cTNTEntity>(a_Pos, a_FuseTicks); auto TNTPtr = TNT.get(); if (!TNTPtr->Initialize(std::move(TNT), *this)) { @@ -3594,7 +3594,7 @@ void cWorld::cChunkGeneratorCallbacks::OnChunkGenerated(cChunkDesc & a_ChunkDesc cChunkDef::BlockNibbles BlockMetas; a_ChunkDesc.CompressBlockMetas(BlockMetas); - auto SetChunkData = cpp14::make_unique<cSetChunkData>( + auto SetChunkData = std::make_unique<cSetChunkData>( a_ChunkDesc.GetChunkX(), a_ChunkDesc.GetChunkZ(), a_ChunkDesc.GetBlockTypes(), BlockMetas, nullptr, nullptr, // We don't have lighting, chunk will be lighted when needed diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 7ddc8a2e4..a77f10ae7 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -462,7 +462,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT } // for y //*/ - auto SetChunkData = cpp14::make_unique<cSetChunkData>( + auto SetChunkData = std::make_unique<cSetChunkData>( a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ, BlockTypes, MetaData, IsLightValid ? BlockLight : nullptr, @@ -900,7 +900,7 @@ OwnedBlockEntity cWSSAnvil::LoadBeaconFromNBT(const cParsedNBT & a_NBT, int a_Ta return nullptr; } - auto Beacon = cpp14::make_unique<cBeaconEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Beacon = std::make_unique<cBeaconEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int CurrentLine = a_NBT.FindChildByName(a_TagIdx, "Levels"); if (CurrentLine >= 0) @@ -952,7 +952,7 @@ OwnedBlockEntity cWSSAnvil::LoadBedFromNBT(const cParsedNBT & a_NBT, int a_TagId Color = static_cast<short>(a_NBT.GetInt(ColorIDx)); } - return cpp14::make_unique<cBedEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World, Color); + return std::make_unique<cBedEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World, Color); } @@ -974,7 +974,7 @@ OwnedBlockEntity cWSSAnvil::LoadBrewingstandFromNBT(const cParsedNBT & a_NBT, in return nullptr; // Make it an empty brewingstand - the chunk loader will provide an empty cBrewingstandEntity for this } - auto Brewingstand = cpp14::make_unique<cBrewingstandEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Brewingstand = std::make_unique<cBrewingstandEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); // Fuel has to be loaded at first, because of slot events: int Fuel = a_NBT.FindChildByName(a_TagIdx, "Fuel"); @@ -1032,7 +1032,7 @@ OwnedBlockEntity cWSSAnvil::LoadChestFromNBT(const cParsedNBT & a_NBT, int a_Tag { return nullptr; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this } - auto Chest = cpp14::make_unique<cChestEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Chest = std::make_unique<cChestEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Chest->GetContents(), a_NBT, Items); return std::move(Chest); } @@ -1050,7 +1050,7 @@ OwnedBlockEntity cWSSAnvil::LoadCommandBlockFromNBT(const cParsedNBT & a_NBT, in return nullptr; } - auto CmdBlock = cpp14::make_unique<cCommandBlockEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto CmdBlock = std::make_unique<cCommandBlockEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command"); if (currentLine >= 0) @@ -1093,7 +1093,7 @@ OwnedBlockEntity cWSSAnvil::LoadDispenserFromNBT(const cParsedNBT & a_NBT, int a { return nullptr; // Make it an empty dispenser - the chunk loader will provide an empty cDispenserEntity for this } - auto Dispenser = cpp14::make_unique<cDispenserEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Dispenser = std::make_unique<cDispenserEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Dispenser->GetContents(), a_NBT, Items); return std::move(Dispenser); } @@ -1116,7 +1116,7 @@ OwnedBlockEntity cWSSAnvil::LoadDropperFromNBT(const cParsedNBT & a_NBT, int a_T { return nullptr; // Make it an empty dropper - the chunk loader will provide an empty cDropperEntity for this } - auto Dropper = cpp14::make_unique<cDropperEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Dropper = std::make_unique<cDropperEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Dropper->GetContents(), a_NBT, Items); return std::move(Dropper); } @@ -1134,7 +1134,7 @@ OwnedBlockEntity cWSSAnvil::LoadFlowerPotFromNBT(const cParsedNBT & a_NBT, int a return nullptr; } - auto FlowerPot = cpp14::make_unique<cFlowerPotEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto FlowerPot = std::make_unique<cFlowerPotEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); cItem Item; int currentLine = a_NBT.FindChildByName(a_TagIdx, "Item"); @@ -1179,7 +1179,7 @@ OwnedBlockEntity cWSSAnvil::LoadFurnaceFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; // Make it an empty furnace - the chunk loader will provide an empty cFurnaceEntity for this } - auto Furnace = cpp14::make_unique<cFurnaceEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Furnace = std::make_unique<cFurnaceEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); Furnace->SetLoading(true); // Load slots: @@ -1238,7 +1238,7 @@ OwnedBlockEntity cWSSAnvil::LoadHopperFromNBT(const cParsedNBT & a_NBT, int a_Ta { return nullptr; // Make it an empty hopper - the chunk loader will provide an empty cHopperEntity for this } - auto Hopper = cpp14::make_unique<cHopperEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Hopper = std::make_unique<cHopperEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); LoadItemGridFromNBT(Hopper->GetContents(), a_NBT, Items); return std::move(Hopper); } @@ -1256,7 +1256,7 @@ OwnedBlockEntity cWSSAnvil::LoadJukeboxFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; } - auto Jukebox = cpp14::make_unique<cJukeboxEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Jukebox = std::make_unique<cJukeboxEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int Record = a_NBT.FindChildByName(a_TagIdx, "Record"); if (Record >= 0) { @@ -1278,7 +1278,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobSpawnerFromNBT(const cParsedNBT & a_NBT, int return nullptr; } - auto MobSpawner = cpp14::make_unique<cMobSpawnerEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto MobSpawner = std::make_unique<cMobSpawnerEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); // Load entity (Cuberite worlds): int Type = a_NBT.FindChildByName(a_TagIdx, "Entity"); @@ -1327,7 +1327,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobHeadFromNBT(const cParsedNBT & a_NBT, int a_T return nullptr; } - auto MobHead = cpp14::make_unique<cMobHeadEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto MobHead = std::make_unique<cMobHeadEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "SkullType"); if (currentLine >= 0) @@ -1401,7 +1401,7 @@ OwnedBlockEntity cWSSAnvil::LoadNoteBlockFromNBT(const cParsedNBT & a_NBT, int a return nullptr; } - auto NoteBlock = cpp14::make_unique<cNoteEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto NoteBlock = std::make_unique<cNoteEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int note = a_NBT.FindChildByName(a_TagIdx, "note"); if (note >= 0) { @@ -1423,7 +1423,7 @@ OwnedBlockEntity cWSSAnvil::LoadSignFromNBT(const cParsedNBT & a_NBT, int a_TagI return nullptr; } - auto Sign = cpp14::make_unique<cSignEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); + auto Sign = std::make_unique<cSignEntity>(a_BlockType, a_BlockMeta, a_Pos, m_World); int currentLine = a_NBT.FindChildByName(a_TagIdx, "Text1"); if (currentLine >= 0) @@ -1611,7 +1611,7 @@ void cWSSAnvil::LoadOldMinecartFromNBT(cEntityList & a_Entities, const cParsedNB void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Boat = cpp14::make_unique<cBoat>(Vector3d(), cBoat::bmOak); + auto Boat = std::make_unique<cBoat>(Vector3d(), cBoat::bmOak); if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx)) { return; @@ -1631,7 +1631,7 @@ void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto EnderCrystal = cpp14::make_unique<cEnderCrystal>(Vector3d()); + auto EnderCrystal = std::make_unique<cEnderCrystal>(Vector3d()); if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx)) { return; @@ -1656,7 +1656,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN BLOCKTYPE Type = static_cast<BLOCKTYPE>(a_NBT.GetInt(TypeIdx)); NIBBLETYPE Meta = static_cast<NIBBLETYPE>(a_NBT.GetByte(MetaIdx)); - auto FallingBlock = cpp14::make_unique<cFallingBlock>(Vector3i(0, 0, 0), Type, Meta); + auto FallingBlock = std::make_unique<cFallingBlock>(Vector3i(0, 0, 0), Type, Meta); if (!LoadEntityBaseFromNBT(*FallingBlock.get(), a_NBT, a_TagIdx)) { return; @@ -1670,7 +1670,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN void cWSSAnvil::LoadMinecartRFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique<cRideableMinecart>(Vector3d(), cItem(), 1); // TODO: Load the block and the height + auto Minecart = std::make_unique<cRideableMinecart>(Vector3d(), cItem(), 1); // TODO: Load the block and the height if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1689,7 +1689,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT { return; // Make it an empty chest - the chunk loader will provide an empty cChestEntity for this } - auto Minecart = cpp14::make_unique<cMinecartWithChest>(Vector3d()); + auto Minecart = std::make_unique<cMinecartWithChest>(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1716,7 +1716,7 @@ void cWSSAnvil::LoadMinecartCFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique<cMinecartWithFurnace>(Vector3d()); + auto Minecart = std::make_unique<cMinecartWithFurnace>(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1733,7 +1733,7 @@ void cWSSAnvil::LoadMinecartFFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique<cMinecartWithTNT>(Vector3d()); + auto Minecart = std::make_unique<cMinecartWithTNT>(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1750,7 +1750,7 @@ void cWSSAnvil::LoadMinecartTFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMinecartHFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Minecart = cpp14::make_unique<cMinecartWithHopper>(Vector3d()); + auto Minecart = std::make_unique<cMinecartWithHopper>(Vector3d()); if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx)) { return; @@ -1779,7 +1779,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a return; } - auto Pickup = cpp14::make_unique<cPickup>(Vector3d(), Item, false); // Pickup delay doesn't matter, just say false + auto Pickup = std::make_unique<cPickup>(Vector3d(), Item, false); // Pickup delay doesn't matter, just say false if (!LoadEntityBaseFromNBT(*Pickup.get(), a_NBT, a_TagIdx)) { return; @@ -1801,7 +1801,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto TNT = cpp14::make_unique<cTNTEntity>(Vector3d(), 0); + auto TNT = std::make_unique<cTNTEntity>(Vector3d(), 0); if (!LoadEntityBaseFromNBT(*TNT.get(), a_NBT, a_TagIdx)) { return; @@ -1823,7 +1823,7 @@ void cWSSAnvil::LoadTNTFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadExpOrbFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto ExpOrb = cpp14::make_unique<cExpOrb>(Vector3d(), 0); + auto ExpOrb = std::make_unique<cExpOrb>(Vector3d(), 0); if (!LoadEntityBaseFromNBT(*ExpOrb.get(), a_NBT, a_TagIdx)) { return; @@ -1892,7 +1892,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT return; } - auto ItemFrame = cpp14::make_unique<cItemFrame>(BLOCK_FACE_NONE, Vector3d()); + auto ItemFrame = std::make_unique<cItemFrame>(BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*ItemFrame.get(), a_NBT, a_TagIdx)) { return; @@ -1917,7 +1917,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadLeashKnotFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto LeashKnot = cpp14::make_unique<cLeashKnot>(BLOCK_FACE_NONE, Vector3d()); + auto LeashKnot = std::make_unique<cLeashKnot>(BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*LeashKnot.get(), a_NBT, a_TagIdx)) { @@ -1942,7 +1942,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT & return; } - auto Painting = cpp14::make_unique<cPainting>(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, Vector3d()); + auto Painting = std::make_unique<cPainting>(a_NBT.GetString(MotiveTag), BLOCK_FACE_NONE, Vector3d()); if (!LoadEntityBaseFromNBT(*Painting.get(), a_NBT, a_TagIdx)) { return; @@ -1958,7 +1958,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Arrow = cpp14::make_unique<cArrowEntity>(nullptr, Vector3d(), Vector3d()); + auto Arrow = std::make_unique<cArrowEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Arrow.get(), a_NBT, a_TagIdx)) { return; @@ -2029,7 +2029,7 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto SplashPotion = cpp14::make_unique<cSplashPotionEntity>(nullptr, Vector3d(), Vector3d(), cItem()); + auto SplashPotion = std::make_unique<cSplashPotionEntity>(nullptr, Vector3d(), Vector3d(), cItem()); if (!LoadProjectileBaseFromNBT(*SplashPotion.get(), a_NBT, a_TagIdx)) { return; @@ -2053,7 +2053,7 @@ void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedN void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Snowball = cpp14::make_unique<cThrownSnowballEntity>(nullptr, Vector3d(), Vector3d()); + auto Snowball = std::make_unique<cThrownSnowballEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Snowball.get(), a_NBT, a_TagIdx)) { return; @@ -2069,7 +2069,7 @@ void cWSSAnvil::LoadSnowballFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Egg = cpp14::make_unique<cThrownEggEntity>(nullptr, Vector3d(), Vector3d()); + auto Egg = std::make_unique<cThrownEggEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Egg.get(), a_NBT, a_TagIdx)) { return; @@ -2085,7 +2085,7 @@ void cWSSAnvil::LoadEggFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Fireball = cpp14::make_unique<cGhastFireballEntity>(nullptr, Vector3d(), Vector3d()); + auto Fireball = std::make_unique<cGhastFireballEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Fireball.get(), a_NBT, a_TagIdx)) { return; @@ -2101,7 +2101,7 @@ void cWSSAnvil::LoadFireballFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto FireCharge = cpp14::make_unique<cFireChargeEntity>(nullptr, Vector3d(), Vector3d()); + auto FireCharge = std::make_unique<cFireChargeEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*FireCharge.get(), a_NBT, a_TagIdx)) { return; @@ -2117,7 +2117,7 @@ void cWSSAnvil::LoadFireChargeFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Enderpearl = cpp14::make_unique<cThrownEnderPearlEntity>(nullptr, Vector3d(), Vector3d()); + auto Enderpearl = std::make_unique<cThrownEnderPearlEntity>(nullptr, Vector3d(), Vector3d()); if (!LoadProjectileBaseFromNBT(*Enderpearl.get(), a_NBT, a_TagIdx)) { return; @@ -2133,7 +2133,7 @@ void cWSSAnvil::LoadThrownEnderpearlFromNBT(cEntityList & a_Entities, const cPar void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Monster = cpp14::make_unique<cBat>(); + auto Monster = std::make_unique<cBat>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2153,7 +2153,7 @@ void cWSSAnvil::LoadBatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cBlaze> Monster = cpp14::make_unique<cBlaze>(); + std::unique_ptr<cBlaze> Monster = std::make_unique<cBlaze>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2173,7 +2173,7 @@ void cWSSAnvil::LoadBlazeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cCaveSpider> Monster = cpp14::make_unique<cCaveSpider>(); + std::unique_ptr<cCaveSpider> Monster = std::make_unique<cCaveSpider>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2193,7 +2193,7 @@ void cWSSAnvil::LoadCaveSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cChicken> Monster = cpp14::make_unique<cChicken>(); + std::unique_ptr<cChicken> Monster = std::make_unique<cChicken>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2213,7 +2213,7 @@ void cWSSAnvil::LoadChickenFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cCow> Monster = cpp14::make_unique<cCow>(); + std::unique_ptr<cCow> Monster = std::make_unique<cCow>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2233,7 +2233,7 @@ void cWSSAnvil::LoadCowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cCreeper> Monster = cpp14::make_unique<cCreeper>(); + std::unique_ptr<cCreeper> Monster = std::make_unique<cCreeper>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2253,7 +2253,7 @@ void cWSSAnvil::LoadCreeperFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cEnderDragon> Monster = cpp14::make_unique<cEnderDragon>(); + std::unique_ptr<cEnderDragon> Monster = std::make_unique<cEnderDragon>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2273,7 +2273,7 @@ void cWSSAnvil::LoadEnderDragonFromNBT(cEntityList & a_Entities, const cParsedNB void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cEnderman> Monster = cpp14::make_unique<cEnderman>(); + std::unique_ptr<cEnderman> Monster = std::make_unique<cEnderman>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2293,7 +2293,7 @@ void cWSSAnvil::LoadEndermanFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cGhast> Monster = cpp14::make_unique<cGhast>(); + std::unique_ptr<cGhast> Monster = std::make_unique<cGhast>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2313,7 +2313,7 @@ void cWSSAnvil::LoadGhastFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cGiant> Monster = cpp14::make_unique<cGiant>(); + std::unique_ptr<cGiant> Monster = std::make_unique<cGiant>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2333,7 +2333,7 @@ void cWSSAnvil::LoadGiantFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadGuardianFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cGuardian> Monster = cpp14::make_unique<cGuardian>(); + std::unique_ptr<cGuardian> Monster = std::make_unique<cGuardian>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2365,7 +2365,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ int Color = a_NBT.GetInt(ColorIdx); int Style = a_NBT.GetInt(StyleIdx); - std::unique_ptr<cHorse> Monster = cpp14::make_unique<cHorse>(Type, Color, Style, 1); + std::unique_ptr<cHorse> Monster = std::make_unique<cHorse>(Type, Color, Style, 1); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { @@ -2399,7 +2399,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadIronGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cIronGolem> Monster = cpp14::make_unique<cIronGolem>(); + std::unique_ptr<cIronGolem> Monster = std::make_unique<cIronGolem>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2428,7 +2428,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT int Size = a_NBT.GetInt(SizeIdx); - std::unique_ptr<cMagmaCube> Monster = cpp14::make_unique<cMagmaCube>(Size); + std::unique_ptr<cMagmaCube> Monster = std::make_unique<cMagmaCube>(Size); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2448,7 +2448,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cMooshroom> Monster = cpp14::make_unique<cMooshroom>(); + std::unique_ptr<cMooshroom> Monster = std::make_unique<cMooshroom>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2468,7 +2468,7 @@ void cWSSAnvil::LoadMooshroomFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cOcelot> Monster = cpp14::make_unique<cOcelot>(); + std::unique_ptr<cOcelot> Monster = std::make_unique<cOcelot>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2522,7 +2522,7 @@ void cWSSAnvil::LoadOcelotFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cPig> Monster = cpp14::make_unique<cPig>(); + std::unique_ptr<cPig> Monster = std::make_unique<cPig>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2566,7 +2566,7 @@ void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a int Type = a_NBT.GetInt(TypeIdx); int MoreCarrotTicks = a_NBT.GetInt(MoreCarrotTicksIdx); - std::unique_ptr<cRabbit> Monster = cpp14::make_unique<cRabbit>(static_cast<eRabbitType>(Type), MoreCarrotTicks); + std::unique_ptr<cRabbit> Monster = std::make_unique<cRabbit>(static_cast<eRabbitType>(Type), MoreCarrotTicks); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2606,7 +2606,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ Color = static_cast<int>(a_NBT.GetByte(ColorIdx)); } - std::unique_ptr<cSheep> Monster = cpp14::make_unique<cSheep>(Color); + std::unique_ptr<cSheep> Monster = std::make_unique<cSheep>(Color); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2645,7 +2645,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSilverfishFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cSilverfish> Monster = cpp14::make_unique<cSilverfish>(); + std::unique_ptr<cSilverfish> Monster = std::make_unique<cSilverfish>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2672,11 +2672,11 @@ void cWSSAnvil::LoadSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT & std::unique_ptr<cMonster> Monster; if ((TypeIdx > 0) && (a_NBT.GetByte(TypeIdx) == 1)) { - Monster = cpp14::make_unique<cWitherSkeleton>(); + Monster = std::make_unique<cWitherSkeleton>(); } else { - Monster = cpp14::make_unique<cSkeleton>(); + Monster = std::make_unique<cSkeleton>(); } if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) @@ -2707,7 +2707,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ int Size = a_NBT.GetInt(SizeIdx); - std::unique_ptr<cSlime> Monster = cpp14::make_unique<cSlime>(Size); + std::unique_ptr<cSlime> Monster = std::make_unique<cSlime>(Size); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2727,7 +2727,7 @@ void cWSSAnvil::LoadSlimeFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cSnowGolem> Monster = cpp14::make_unique<cSnowGolem>(); + std::unique_ptr<cSnowGolem> Monster = std::make_unique<cSnowGolem>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2747,7 +2747,7 @@ void cWSSAnvil::LoadSnowGolemFromNBT(cEntityList & a_Entities, const cParsedNBT void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cSpider> Monster = cpp14::make_unique<cSpider>(); + std::unique_ptr<cSpider> Monster = std::make_unique<cSpider>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2767,7 +2767,7 @@ void cWSSAnvil::LoadSpiderFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadSquidFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cSquid> Monster = cpp14::make_unique<cSquid>(); + std::unique_ptr<cSquid> Monster = std::make_unique<cSquid>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2795,7 +2795,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & int Type = a_NBT.GetInt(TypeIdx); - std::unique_ptr<cVillager> Monster = cpp14::make_unique<cVillager>(cVillager::eVillagerType(Type)); + std::unique_ptr<cVillager> Monster = std::make_unique<cVillager>(cVillager::eVillagerType(Type)); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2829,7 +2829,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT & void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cWitch> Monster = cpp14::make_unique<cWitch>(); + std::unique_ptr<cWitch> Monster = std::make_unique<cWitch>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2849,7 +2849,7 @@ void cWSSAnvil::LoadWitchFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cWither> Monster = cpp14::make_unique<cWither>(); + std::unique_ptr<cWither> Monster = std::make_unique<cWither>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2875,7 +2875,7 @@ void cWSSAnvil::LoadWitherFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadWitherSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto Monster = cpp14::make_unique<cWitherSkeleton>(); + auto Monster = std::make_unique<cWitherSkeleton>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2895,7 +2895,7 @@ void cWSSAnvil::LoadWitherSkeletonFromNBT(cEntityList & a_Entities, const cParse void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cWolf> Monster = cpp14::make_unique<cWolf>(); + std::unique_ptr<cWolf> Monster = std::make_unique<cWolf>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -2971,7 +2971,7 @@ void cWSSAnvil::LoadWolfFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cZombie> Monster = cpp14::make_unique<cZombie>(); + std::unique_ptr<cZombie> Monster = std::make_unique<cZombie>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -3004,7 +3004,7 @@ void cWSSAnvil::LoadZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a void cWSSAnvil::LoadPigZombieFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - std::unique_ptr<cZombiePigman> Monster = cpp14::make_unique<cZombiePigman>(); + std::unique_ptr<cZombiePigman> Monster = std::make_unique<cZombiePigman>(); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; @@ -3045,7 +3045,7 @@ void cWSSAnvil::LoadZombieVillagerFromNBT(cEntityList & a_Entities, const cParse cVillager::eVillagerType Profession = static_cast<cVillager::eVillagerType>(a_NBT.GetInt(ProfessionIdx)); - std::unique_ptr<cZombieVillager> Monster = cpp14::make_unique<cZombieVillager>(Profession); + std::unique_ptr<cZombieVillager> Monster = std::make_unique<cZombieVillager>(Profession); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) { return; diff --git a/src/main.cpp b/src/main.cpp index 7411b410e..4d59fea0e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -256,7 +256,7 @@ static DWORD WINAPI serviceWorkerThread(LPVOID lpParam) while (!cRoot::m_TerminateEventRaised) { // Do the normal startup - UniversalMain(cpp14::make_unique<cMemorySettingsRepository>()); + UniversalMain(std::make_unique<cMemorySettingsRepository>()); } return ERROR_SUCCESS; @@ -380,7 +380,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char cmd.parse(argc, argv); // Copy the parsed args' values into a settings repository: - auto repo = cpp14::make_unique<cMemorySettingsRepository>(); + auto repo = std::make_unique<cMemorySettingsRepository>(); if (confArg.isSet()) { AString conf_file = confArg.getValue(); @@ -441,7 +441,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char catch (const TCLAP::ArgException & exc) { fmt::print("Error reading command line {0} for arg {1}", exc.error(), exc.argId()); - return cpp14::make_unique<cMemorySettingsRepository>(); + return std::make_unique<cMemorySettingsRepository>(); } } diff --git a/tests/HTTP/UrlClientTest.cpp b/tests/HTTP/UrlClientTest.cpp index 05844ca53..17f98ab70 100644 --- a/tests/HTTP/UrlClientTest.cpp +++ b/tests/HTTP/UrlClientTest.cpp @@ -114,7 +114,7 @@ int TestRequest1() { LOG("Running test 1"); auto evtFinished = std::make_shared<cEvent>(); - auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished); + auto callbacks = std::make_unique<cCallbacks>(evtFinished); AStringMap options; options["MaxRedirects"] = "0"; auto res = cUrlClient::Get("http://github.com", std::move(callbacks), AStringMap(), AString(), options); @@ -138,7 +138,7 @@ int TestRequest2() { LOG("Running test 2"); auto evtFinished = std::make_shared<cEvent>(); - auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished); + auto callbacks = std::make_unique<cCallbacks>(evtFinished); auto res = cUrlClient::Get("http://github.com", std::move(callbacks)); if (res.first) { @@ -160,7 +160,7 @@ int TestRequest3() { LOG("Running test 3"); auto evtFinished = std::make_shared<cEvent>(); - auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished); + auto callbacks = std::make_unique<cCallbacks>(evtFinished); AStringMap options; options["MaxRedirects"] = "0"; auto res = cUrlClient::Get("https://github.com", std::move(callbacks), AStringMap(), AString(), options); @@ -184,7 +184,7 @@ int TestRequest4() { LOG("Running test 4"); auto evtFinished = std::make_shared<cEvent>(); - auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished); + auto callbacks = std::make_unique<cCallbacks>(evtFinished); auto res = cUrlClient::Get("https://github.com", std::move(callbacks)); if (res.first) { |