Replaced cpp14::make_unique<> with std::make_unique<>.
This commit is contained in:
parent
54e499c065
commit
46398f4671
@ -1213,7 +1213,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cCallbackPtr & a_Callback)
|
|||||||
{
|
{
|
||||||
if (a_Callback == nullptr)
|
if (a_Callback == nullptr)
|
||||||
{
|
{
|
||||||
a_Callback = cpp14::make_unique<cCallback>();
|
a_Callback = std::make_unique<cCallback>();
|
||||||
}
|
}
|
||||||
return a_Callback->RefStack(*this, a_StackPos);
|
return a_Callback->RefStack(*this, a_StackPos);
|
||||||
}
|
}
|
||||||
@ -1235,7 +1235,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cOptionalCallbackPtr & a_Callback)
|
|||||||
{
|
{
|
||||||
if (a_Callback == nullptr)
|
if (a_Callback == nullptr)
|
||||||
{
|
{
|
||||||
a_Callback = cpp14::make_unique<cOptionalCallback>();
|
a_Callback = std::make_unique<cOptionalCallback>();
|
||||||
}
|
}
|
||||||
return a_Callback->RefStack(*this, a_StackPos);
|
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:
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,7 +1311,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTableRefPtr & a_TableRef)
|
|||||||
{
|
{
|
||||||
if (a_TableRef == nullptr)
|
if (a_TableRef == nullptr)
|
||||||
{
|
{
|
||||||
a_TableRef = cpp14::make_unique<cTableRef>();
|
a_TableRef = std::make_unique<cTableRef>();
|
||||||
}
|
}
|
||||||
return a_TableRef->RefStack(*this, a_StackPos);
|
return a_TableRef->RefStack(*this, a_StackPos);
|
||||||
}
|
}
|
||||||
@ -1333,7 +1333,7 @@ bool cLuaState::GetStackValue(int a_StackPos, cTrackedRefPtr & a_Ref)
|
|||||||
{
|
{
|
||||||
if (a_Ref == nullptr)
|
if (a_Ref == nullptr)
|
||||||
{
|
{
|
||||||
a_Ref = cpp14::make_unique<cTrackedRef>();
|
a_Ref = std::make_unique<cTrackedRef>();
|
||||||
}
|
}
|
||||||
return a_Ref->RefStack(*this, a_StackPos);
|
return a_Ref->RefStack(*this, a_StackPos);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
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))
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -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
|
ASSERT(chunkCoords != nullptr); // If the table was invalid, GetStackValues() would have failed
|
||||||
|
|
||||||
// Read the chunk coords:
|
// Read the chunk coords:
|
||||||
auto chunkStay = cpp14::make_unique<cLuaChunkStay>();
|
auto chunkStay = std::make_unique<cLuaChunkStay>();
|
||||||
if (!chunkStay->AddChunks(*chunkCoords))
|
if (!chunkStay->AddChunks(*chunkCoords))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@ -732,7 +732,7 @@ static int tolua_cWorld_PrepareChunk(lua_State * tolua_S)
|
|||||||
cWorld * world = nullptr;
|
cWorld * world = nullptr;
|
||||||
int chunkX = 0;
|
int chunkX = 0;
|
||||||
int chunkZ = 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);
|
L.GetStackValues(1, world, chunkX, chunkZ, Callback->m_LuaCallback);
|
||||||
if (world == nullptr)
|
if (world == nullptr)
|
||||||
{
|
{
|
||||||
|
@ -77,25 +77,25 @@ OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETY
|
|||||||
{
|
{
|
||||||
switch (a_BlockType)
|
switch (a_BlockType)
|
||||||
{
|
{
|
||||||
case E_BLOCK_BEACON: return cpp14::make_unique<cBeaconEntity >(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 cpp14::make_unique<cBedEntity >(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 cpp14::make_unique<cBrewingstandEntity>(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 cpp14::make_unique<cChestEntity >(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 cpp14::make_unique<cCommandBlockEntity>(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 cpp14::make_unique<cDispenserEntity >(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 cpp14::make_unique<cDropperEntity >(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 cpp14::make_unique<cEnderChestEntity >(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 cpp14::make_unique<cFlowerPotEntity >(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 cpp14::make_unique<cFurnaceEntity >(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 cpp14::make_unique<cMobHeadEntity >(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 cpp14::make_unique<cHopperEntity >(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 cpp14::make_unique<cJukeboxEntity >(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 cpp14::make_unique<cFurnaceEntity >(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 cpp14::make_unique<cMobSpawnerEntity >(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 cpp14::make_unique<cNoteEntity >(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 cpp14::make_unique<cSignEntity >(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 cpp14::make_unique<cChestEntity >(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 cpp14::make_unique<cSignEntity >(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:
|
default:
|
||||||
{
|
{
|
||||||
LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)",
|
LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)",
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
// New knot? needs to init and produce sound effect
|
// New knot? needs to init and produce sound effect
|
||||||
else
|
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();
|
auto NewLeashKnotPtr = NewLeashKnot.get();
|
||||||
|
|
||||||
NewLeashKnotPtr->TiePlayersLeashedMobs(a_Player, KnotAlreadyExists);
|
NewLeashKnotPtr->TiePlayersLeashedMobs(a_Player, KnotAlreadyExists);
|
||||||
|
@ -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());
|
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, "+");
|
const AStringVector & InputAndIngredient = StringSplit(a_Line, "+");
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_
|
|||||||
if (a_Input.m_ItemDamage & 0x2000)
|
if (a_Input.m_ItemDamage & 0x2000)
|
||||||
{
|
{
|
||||||
// Create new recipe and add it to list
|
// 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->Input.m_ItemType = a_Input.m_ItemDamage;
|
||||||
Recipe->Output.m_ItemDamage = a_Input.m_ItemDamage + 8192;
|
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
|
// 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->Input.m_ItemDamage = a_Input.m_ItemDamage;
|
||||||
Recipe->Output.m_ItemDamage = (*FoundRecipe)->Output.m_ItemDamage + 8192;
|
Recipe->Output.m_ItemDamage = (*FoundRecipe)->Output.m_ItemDamage + 8192;
|
||||||
|
@ -115,7 +115,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
cChunkDataCopyCollector():
|
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)
|
m_Data(m_Pool)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@
|
|||||||
cChunkMap::cChunkMap(cWorld * a_World) :
|
cChunkMap::cChunkMap(cWorld * a_World) :
|
||||||
m_World(a_World),
|
m_World(a_World),
|
||||||
m_Pool(
|
m_Pool(
|
||||||
cpp14::make_unique<cListAllocationPool<cChunkData::sChunkSection>>(
|
std::make_unique<cListAllocationPool<cChunkData::sChunkSection>>(
|
||||||
cpp14::make_unique<cStarvationCallbacks>(), 1600u, 5000u
|
std::make_unique<cStarvationCallbacks>(), 1600u, 5000u
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -71,7 +71,7 @@ cChunkPtr cChunkMap::ConstructChunk(int a_ChunkX, int a_ChunkZ)
|
|||||||
return (
|
return (
|
||||||
*m_Chunks.emplace(
|
*m_Chunks.emplace(
|
||||||
ChunkCoordinate{ a_ChunkX, a_ChunkZ },
|
ChunkCoordinate{ a_ChunkX, a_ChunkZ },
|
||||||
cpp14::make_unique<cChunk>(
|
std::make_unique<cChunk>(
|
||||||
a_ChunkX,
|
a_ChunkX,
|
||||||
a_ChunkZ,
|
a_ChunkZ,
|
||||||
this,
|
this,
|
||||||
|
@ -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 the chunk is not lighted, queue it for relighting and get notified when it's ready:
|
||||||
if (!m_World.IsChunkLighted(a_ChunkX, a_ChunkZ))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ void cClientHandle::FinishAuthenticate(const AString & a_Name, const cUUID & a_U
|
|||||||
cWorld * World;
|
cWorld * World;
|
||||||
{
|
{
|
||||||
// Spawn player (only serversided, so data is loaded)
|
// 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();
|
m_Player = m_PlayerPtr.get();
|
||||||
/*
|
/*
|
||||||
LOGD("Created a new cPlayer object at %p for client %s @ %s (%p)",
|
LOGD("Created a new cPlayer object at %p for client %s @ %s (%p)",
|
||||||
|
@ -464,7 +464,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine
|
|||||||
return;
|
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], ":");
|
AStringVector RecipeSplit = StringSplit(Sides[0], ":");
|
||||||
const auto * resultPart = &RecipeSplit[0];
|
const auto * resultPart = &RecipeSplit[0];
|
||||||
@ -852,7 +852,7 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
|
|||||||
} // for y, for x
|
} // for y, for x
|
||||||
|
|
||||||
// The recipe has matched. Create a copy of the recipe and set its coords to match the crafting grid:
|
// 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_Result = a_Recipe->m_Result;
|
||||||
Recipe->m_Width = a_Recipe->m_Width;
|
Recipe->m_Width = a_Recipe->m_Width;
|
||||||
Recipe->m_Height = a_Recipe->m_Height;
|
Recipe->m_Height = a_Recipe->m_Height;
|
||||||
|
@ -191,31 +191,31 @@ std::unique_ptr<cEntityEffect> cEntityEffect::CreateEntityEffect(cEntityEffect::
|
|||||||
{
|
{
|
||||||
switch (a_EffectType)
|
switch (a_EffectType)
|
||||||
{
|
{
|
||||||
case cEntityEffect::effNoEffect: return cpp14::make_unique<cEntityEffect >(a_Duration, a_Intensity, a_DistanceModifier);
|
case cEntityEffect::effNoEffect: return std::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::effAbsorption: return std::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::effBlindness: return std::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::effFireResistance: return std::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::effHaste: return std::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::effHealthBoost: return std::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::effHunger: return std::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::effInstantDamage: return std::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::effInstantHealth: return std::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::effInvisibility: return std::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::effJumpBoost: return std::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::effMiningFatigue: return std::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::effNausea: return std::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::effNightVision: return std::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::effPoison: return std::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::effRegeneration: return std::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::effResistance: return std::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::effSaturation: return std::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::effSlowness: return std::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::effSpeed: return std::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::effStrength: return std::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::effWaterBreathing: return std::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::effWeakness: return std::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::effWither: return std::make_unique<cEntityEffectWither >(a_Duration, a_Intensity, a_DistanceModifier);
|
||||||
}
|
}
|
||||||
UNREACHABLE("Unsupported entity effect");
|
UNREACHABLE("Unsupported entity effect");
|
||||||
}
|
}
|
||||||
|
@ -264,15 +264,15 @@ std::unique_ptr<cProjectileEntity> cProjectileEntity::Create(
|
|||||||
|
|
||||||
switch (a_Kind)
|
switch (a_Kind)
|
||||||
{
|
{
|
||||||
case pkArrow: return cpp14::make_unique<cArrowEntity> (a_Creator, a_Pos, Speed);
|
case pkArrow: return std::make_unique<cArrowEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkEgg: return cpp14::make_unique<cThrownEggEntity> (a_Creator, a_Pos, Speed);
|
case pkEgg: return std::make_unique<cThrownEggEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkEnderPearl: return cpp14::make_unique<cThrownEnderPearlEntity>(a_Creator, a_Pos, Speed);
|
case pkEnderPearl: return std::make_unique<cThrownEnderPearlEntity>(a_Creator, a_Pos, Speed);
|
||||||
case pkSnowball: return cpp14::make_unique<cThrownSnowballEntity> (a_Creator, a_Pos, Speed);
|
case pkSnowball: return std::make_unique<cThrownSnowballEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkGhastFireball: return cpp14::make_unique<cGhastFireballEntity> (a_Creator, a_Pos, Speed);
|
case pkGhastFireball: return std::make_unique<cGhastFireballEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkFireCharge: return cpp14::make_unique<cFireChargeEntity> (a_Creator, a_Pos, Speed);
|
case pkFireCharge: return std::make_unique<cFireChargeEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkExpBottle: return cpp14::make_unique<cExpBottleEntity> (a_Creator, a_Pos, Speed);
|
case pkExpBottle: return std::make_unique<cExpBottleEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkSplashPotion: return cpp14::make_unique<cSplashPotionEntity> (a_Creator, a_Pos, Speed, *a_Item);
|
case pkSplashPotion: return std::make_unique<cSplashPotionEntity> (a_Creator, a_Pos, Speed, *a_Item);
|
||||||
case pkWitherSkull: return cpp14::make_unique<cWitherSkullEntity> (a_Creator, a_Pos, Speed);
|
case pkWitherSkull: return std::make_unique<cWitherSkullEntity> (a_Creator, a_Pos, Speed);
|
||||||
case pkFirework:
|
case pkFirework:
|
||||||
{
|
{
|
||||||
ASSERT(a_Item != nullptr);
|
ASSERT(a_Item != nullptr);
|
||||||
@ -281,7 +281,7 @@ std::unique_ptr<cProjectileEntity> cProjectileEntity::Create(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cpp14::make_unique<cFireworkEntity>(a_Creator, a_Pos, *a_Item);
|
return std::make_unique<cFireworkEntity>(a_Creator, a_Pos, *a_Item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void cFurnaceRecipe::AddFuelFromLine(const AString & a_Line, unsigned int a_Line
|
|||||||
Line.erase(Line.begin()); // Remove the beginning "!"
|
Line.erase(Line.begin()); // Remove the beginning "!"
|
||||||
Line.erase(std::remove_if(Line.begin(), Line.end(), isspace), Line.end());
|
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;
|
int BurnTime;
|
||||||
|
|
||||||
const AStringVector & Sides = StringSplit(Line, "=");
|
const AStringVector & Sides = StringSplit(Line, "=");
|
||||||
@ -160,8 +160,8 @@ void cFurnaceRecipe::AddRecipeFromLine(const AString & a_Line, unsigned int a_Li
|
|||||||
|
|
||||||
int CookTime = 200;
|
int CookTime = 200;
|
||||||
float Reward = 0;
|
float Reward = 0;
|
||||||
std::unique_ptr<cItem> InputItem = cpp14::make_unique<cItem>();
|
std::unique_ptr<cItem> InputItem = std::make_unique<cItem>();
|
||||||
std::unique_ptr<cItem> OutputItem = cpp14::make_unique<cItem>();
|
std::unique_ptr<cItem> OutputItem = std::make_unique<cItem>();
|
||||||
|
|
||||||
const AStringVector & Sides = StringSplit(Line, "=");
|
const AStringVector & Sides = StringSplit(Line, "=");
|
||||||
if (Sides.size() != 2)
|
if (Sides.size() != 2)
|
||||||
|
@ -177,7 +177,7 @@ bool cPieceGeneratorBFSTree::TryPlacePieceAtConnector(
|
|||||||
// Place the piece:
|
// Place the piece:
|
||||||
Vector3i NewPos = Conn.m_Piece->RotatePos(Conn.m_Connector.m_Pos, Conn.m_NumCCWRotations);
|
Vector3i NewPos = Conn.m_Piece->RotatePos(Conn.m_Connector.m_Pos, Conn.m_NumCCWRotations);
|
||||||
ConnPos -= NewPos;
|
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:
|
// Add the new piece's connectors to the list of free connectors:
|
||||||
cPiece::cConnectors Connectors = Conn.m_Piece->GetConnectors();
|
cPiece::cConnectors Connectors = Conn.m_Piece->GetConnectors();
|
||||||
|
@ -398,7 +398,7 @@ std::unique_ptr<cPrefab> cPrefabPiecePool::LoadPrefabFromCubesetVer1(
|
|||||||
);
|
);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return cpp14::make_unique<cPrefab>(area);
|
return std::make_unique<cPrefab>(area);
|
||||||
} // if (SchematicFileName)
|
} // if (SchematicFileName)
|
||||||
|
|
||||||
// There's no referenced schematic file, load from BlockDefinitions / BlockData.
|
// There's no referenced schematic file, load from BlockDefinitions / BlockData.
|
||||||
@ -452,7 +452,7 @@ std::unique_ptr<cPrefab> cPrefabPiecePool::LoadPrefabFromCubesetVer1(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cpp14::make_unique<cPrefab>(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ);
|
return std::make_unique<cPrefab>(BlockDefStr, BlockDataStr, SizeX, SizeY, SizeZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
// a tick is 50 ms
|
||||||
using cTickTime = std::chrono::duration<int, std::ratio_multiply<std::chrono::milliseconds::period, std::ratio<50>>>;
|
using cTickTime = std::chrono::duration<int, std::ratio_multiply<std::chrono::milliseconds::period, std::ratio<50>>>;
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the arrow entity:
|
// 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();
|
auto ArrowPtr = Arrow.get();
|
||||||
if (!ArrowPtr->Initialize(std::move(Arrow), *a_Player->GetWorld()))
|
if (!ArrowPtr->Initialize(std::move(Arrow), *a_Player->GetWorld()))
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ public:
|
|||||||
// Cast a hook:
|
// Cast a hook:
|
||||||
auto & Random = GetRandomProvider();
|
auto & Random = GetRandomProvider();
|
||||||
auto CountDownTime = Random.RandInt(100, 900) - static_cast<int>(a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchLure) * 100);
|
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->GetEyePosition(), a_Player->GetLookVector() * 15,
|
||||||
a_Player->GetUniqueID(),
|
a_Player->GetUniqueID(),
|
||||||
CountDownTime
|
CountDownTime
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Place the item frame:
|
// 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();
|
auto ItemFramePtr = ItemFrame.get();
|
||||||
if (!ItemFramePtr->Initialize(std::move(ItemFrame), *a_World))
|
if (!ItemFramePtr->Initialize(std::move(ItemFrame), *a_World))
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto PaintingTitle = gPaintingTitlesList[a_World->GetTickRandomNumber(ARRAYCOUNT(gPaintingTitlesList) - 1)];
|
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();
|
auto PaintingPtr = Painting.get();
|
||||||
if (!PaintingPtr->Initialize(std::move(Painting), *a_World))
|
if (!PaintingPtr->Initialize(std::move(Painting), *a_World))
|
||||||
{
|
{
|
||||||
|
@ -211,7 +211,7 @@ std::unique_ptr<cLogger::cListener> MakeConsoleListener(bool a_IsService)
|
|||||||
{
|
{
|
||||||
if (a_IsService)
|
if (a_IsService)
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cNullConsoleListener>();
|
return std::make_unique<cNullConsoleListener>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -223,24 +223,24 @@ std::unique_ptr<cLogger::cListener> MakeConsoleListener(bool a_IsService)
|
|||||||
HANDLE Console = GetStdHandle(STD_OUTPUT_HANDLE);
|
HANDLE Console = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
GetConsoleScreenBufferInfo(Console, &sbi);
|
GetConsoleScreenBufferInfo(Console, &sbi);
|
||||||
WORD DefaultConsoleAttrib = sbi.wAttributes;
|
WORD DefaultConsoleAttrib = sbi.wAttributes;
|
||||||
return cpp14::make_unique<cWindowsConsoleListener>(Console, DefaultConsoleAttrib);
|
return std::make_unique<cWindowsConsoleListener>(Console, DefaultConsoleAttrib);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cVanillaCPPConsoleListener>();
|
return std::make_unique<cVanillaCPPConsoleListener>();
|
||||||
}
|
}
|
||||||
#elif defined (__linux) || defined (__APPLE__)
|
#elif defined (__linux) || defined (__APPLE__)
|
||||||
// TODO: lookup terminal in terminfo
|
// TODO: lookup terminal in terminfo
|
||||||
if (isatty(fileno(stdout)))
|
if (isatty(fileno(stdout)))
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cANSIConsoleListener>();
|
return std::make_unique<cANSIConsoleListener>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cVanillaCPPConsoleListener>();
|
return std::make_unique<cVanillaCPPConsoleListener>();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return cpp14::make_unique<cVanillaCPPConsoleListener>();
|
return std::make_unique<cVanillaCPPConsoleListener>();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ private:
|
|||||||
|
|
||||||
std::pair<bool, std::unique_ptr<cLogger::cListener>> MakeFileListener()
|
std::pair<bool, std::unique_ptr<cLogger::cListener>> MakeFileListener()
|
||||||
{
|
{
|
||||||
auto listener = cpp14::make_unique<cFileListener>();
|
auto listener = std::make_unique<cFileListener>();
|
||||||
if (!listener->Open())
|
if (!listener->Open())
|
||||||
{
|
{
|
||||||
return {false, nullptr};
|
return {false, nullptr};
|
||||||
|
@ -69,7 +69,7 @@ void cBlaze::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
|||||||
Vector3d Speed = GetLookVector() * 20;
|
Vector3d Speed = GetLookVector() * 20;
|
||||||
Speed.y = Speed.y + 1;
|
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();
|
auto FireChargePtr = FireCharge.get();
|
||||||
FireChargePtr->Initialize(std::move(FireCharge), *m_World);
|
FireChargePtr->Initialize(std::move(FireCharge), *m_World);
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
|||||||
Vector3d Speed = GetLookVector() * 20;
|
Vector3d Speed = GetLookVector() * 20;
|
||||||
Speed.y = Speed.y + 1;
|
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();
|
auto GhastBallPtr = GhastBall.get();
|
||||||
GhastBallPtr->Initialize(std::move(GhastBall), *m_World);
|
GhastBallPtr->Initialize(std::move(GhastBall), *m_World);
|
||||||
|
|
||||||
|
@ -1181,13 +1181,13 @@ std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_MobType)
|
|||||||
{
|
{
|
||||||
case mtMagmaCube:
|
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:
|
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:
|
case mtHorse:
|
||||||
{
|
{
|
||||||
// Horses take a type (species), a colour, and a style (dots, stripes, etc.)
|
// 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;
|
HorseType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cpp14::make_unique<cHorse>(HorseType, HorseColor, HorseStyle, HorseTameTimes);
|
return std::make_unique<cHorse>(HorseType, HorseColor, HorseStyle, HorseTameTimes);
|
||||||
}
|
}
|
||||||
case mtZombieVillager:
|
case mtZombieVillager:
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cZombieVillager>(cVillager::GetRandomProfession());
|
return std::make_unique<cZombieVillager>(cVillager::GetRandomProfession());
|
||||||
}
|
}
|
||||||
case mtBat: return cpp14::make_unique<cBat>();
|
case mtBat: return std::make_unique<cBat>();
|
||||||
case mtBlaze: return cpp14::make_unique<cBlaze>();
|
case mtBlaze: return std::make_unique<cBlaze>();
|
||||||
case mtCaveSpider: return cpp14::make_unique<cCaveSpider>();
|
case mtCaveSpider: return std::make_unique<cCaveSpider>();
|
||||||
case mtChicken: return cpp14::make_unique<cChicken>();
|
case mtChicken: return std::make_unique<cChicken>();
|
||||||
case mtCow: return cpp14::make_unique<cCow>();
|
case mtCow: return std::make_unique<cCow>();
|
||||||
case mtCreeper: return cpp14::make_unique<cCreeper>();
|
case mtCreeper: return std::make_unique<cCreeper>();
|
||||||
case mtEnderDragon: return cpp14::make_unique<cEnderDragon>();
|
case mtEnderDragon: return std::make_unique<cEnderDragon>();
|
||||||
case mtEnderman: return cpp14::make_unique<cEnderman>();
|
case mtEnderman: return std::make_unique<cEnderman>();
|
||||||
case mtGhast: return cpp14::make_unique<cGhast>();
|
case mtGhast: return std::make_unique<cGhast>();
|
||||||
case mtGiant: return cpp14::make_unique<cGiant>();
|
case mtGiant: return std::make_unique<cGiant>();
|
||||||
case mtGuardian: return cpp14::make_unique<cGuardian>();
|
case mtGuardian: return std::make_unique<cGuardian>();
|
||||||
case mtIronGolem: return cpp14::make_unique<cIronGolem>();
|
case mtIronGolem: return std::make_unique<cIronGolem>();
|
||||||
case mtMooshroom: return cpp14::make_unique<cMooshroom>();
|
case mtMooshroom: return std::make_unique<cMooshroom>();
|
||||||
case mtOcelot: return cpp14::make_unique<cOcelot>();
|
case mtOcelot: return std::make_unique<cOcelot>();
|
||||||
case mtPig: return cpp14::make_unique<cPig>();
|
case mtPig: return std::make_unique<cPig>();
|
||||||
case mtRabbit: return cpp14::make_unique<cRabbit>();
|
case mtRabbit: return std::make_unique<cRabbit>();
|
||||||
case mtSheep: return cpp14::make_unique<cSheep>();
|
case mtSheep: return std::make_unique<cSheep>();
|
||||||
case mtSilverfish: return cpp14::make_unique<cSilverfish>();
|
case mtSilverfish: return std::make_unique<cSilverfish>();
|
||||||
case mtSkeleton: return cpp14::make_unique<cSkeleton>();
|
case mtSkeleton: return std::make_unique<cSkeleton>();
|
||||||
case mtSnowGolem: return cpp14::make_unique<cSnowGolem>();
|
case mtSnowGolem: return std::make_unique<cSnowGolem>();
|
||||||
case mtSpider: return cpp14::make_unique<cSpider>();
|
case mtSpider: return std::make_unique<cSpider>();
|
||||||
case mtSquid: return cpp14::make_unique<cSquid>();
|
case mtSquid: return std::make_unique<cSquid>();
|
||||||
case mtWitch: return cpp14::make_unique<cWitch>();
|
case mtWitch: return std::make_unique<cWitch>();
|
||||||
case mtWither: return cpp14::make_unique<cWither>();
|
case mtWither: return std::make_unique<cWither>();
|
||||||
case mtWitherSkeleton: return cpp14::make_unique<cWitherSkeleton>();
|
case mtWitherSkeleton: return std::make_unique<cWitherSkeleton>();
|
||||||
case mtWolf: return cpp14::make_unique<cWolf>();
|
case mtWolf: return std::make_unique<cWolf>();
|
||||||
case mtZombie: return cpp14::make_unique<cZombie>();
|
case mtZombie: return std::make_unique<cZombie>();
|
||||||
case mtZombiePigman: return cpp14::make_unique<cZombiePigman>();
|
case mtZombiePigman: return std::make_unique<cZombiePigman>();
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ASSERT(!"Unhandled mob type whilst trying to spawn mob!");
|
ASSERT(!"Unhandled mob type whilst trying to spawn mob!");
|
||||||
|
@ -46,7 +46,7 @@ bool cSkeleton::Attack(std::chrono::milliseconds a_Dt)
|
|||||||
Vector3d Speed = (GetTarget()->GetPosition() + Inaccuracy - GetPosition()) * 5;
|
Vector3d Speed = (GetTarget()->GetPosition() + Inaccuracy - GetPosition()) * 5;
|
||||||
Speed.y += Random.RandInt(-1, 1);
|
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();
|
auto ArrowPtr = Arrow.get();
|
||||||
if (!ArrowPtr->Initialize(std::move(Arrow), *m_World))
|
if (!ArrowPtr->Initialize(std::move(Arrow), *m_World))
|
||||||
{
|
{
|
||||||
|
@ -79,7 +79,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI)
|
|||||||
double AddX = (i % 2 - 0.5) * m_Size / 4.0;
|
double AddX = (i % 2 - 0.5) * m_Size / 4.0;
|
||||||
double AddZ = (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->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ);
|
||||||
NewSlime->SetYaw(Random.RandReal(360.0f));
|
NewSlime->SetYaw(Random.RandReal(360.0f));
|
||||||
m_World->SpawnMobFinalize(std::move(NewSlime));
|
m_World->SpawnMobFinalize(std::move(NewSlime));
|
||||||
|
@ -177,7 +177,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo)
|
|||||||
m_SettingsFilename = a_OverridesRepo->GetValue("Server","ConfigFile");
|
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);
|
bool IsNewIniFile = !IniFile->ReadFile(m_SettingsFilename);
|
||||||
|
|
||||||
if (IsNewIniFile)
|
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");
|
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...");
|
LOG("Starting server...");
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ struct sMemCallbacks:
|
|||||||
cSetChunkData::cSetChunkData(int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty) :
|
cSetChunkData::cSetChunkData(int a_ChunkX, int a_ChunkZ, bool a_ShouldMarkDirty) :
|
||||||
m_ChunkX(a_ChunkX),
|
m_ChunkX(a_ChunkX),
|
||||||
m_ChunkZ(a_ChunkZ),
|
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_ChunkData(m_Pool),
|
||||||
m_IsLightValid(false),
|
m_IsLightValid(false),
|
||||||
m_IsHeightMapValid(false),
|
m_IsHeightMapValid(false),
|
||||||
|
@ -60,18 +60,18 @@ std::unique_ptr<cRedstoneHandler> cIncrementalRedstoneSimulator::CreateComponent
|
|||||||
{
|
{
|
||||||
case E_BLOCK_ACTIVATOR_RAIL:
|
case E_BLOCK_ACTIVATOR_RAIL:
|
||||||
case E_BLOCK_DETECTOR_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_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_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_HEAVY_WEIGHTED_PRESSURE_PLATE:
|
||||||
case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
|
case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
|
||||||
case E_BLOCK_STONE_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_ACACIA_FENCE_GATE:
|
||||||
case E_BLOCK_BIRCH_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_IRON_TRAPDOOR:
|
||||||
case E_BLOCK_JUNGLE_FENCE_GATE:
|
case E_BLOCK_JUNGLE_FENCE_GATE:
|
||||||
case E_BLOCK_SPRUCE_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_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_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_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_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_LEVER:
|
||||||
case E_BLOCK_STONE_BUTTON:
|
case E_BLOCK_STONE_BUTTON:
|
||||||
case E_BLOCK_WOODEN_BUTTON: return cpp14::make_unique<cRedstoneToggleHandler>();
|
case E_BLOCK_WOODEN_BUTTON: return std::make_unique<cRedstoneToggleHandler>();
|
||||||
|
|
||||||
case E_BLOCK_BLOCK_OF_REDSTONE: return cpp14::make_unique<cRedstoneBlockHandler>();
|
case E_BLOCK_BLOCK_OF_REDSTONE: return std::make_unique<cRedstoneBlockHandler>();
|
||||||
case E_BLOCK_COMMAND_BLOCK: return cpp14::make_unique<cCommandBlockHandler>();
|
case E_BLOCK_COMMAND_BLOCK: return std::make_unique<cCommandBlockHandler>();
|
||||||
case E_BLOCK_HOPPER: return cpp14::make_unique<cHopperHandler>();
|
case E_BLOCK_HOPPER: return std::make_unique<cHopperHandler>();
|
||||||
case E_BLOCK_NOTE_BLOCK: return cpp14::make_unique<cNoteBlockHandler>();
|
case E_BLOCK_NOTE_BLOCK: return std::make_unique<cNoteBlockHandler>();
|
||||||
case E_BLOCK_REDSTONE_WIRE: return cpp14::make_unique<cRedstoneWireHandler>();
|
case E_BLOCK_REDSTONE_WIRE: return std::make_unique<cRedstoneWireHandler>();
|
||||||
case E_BLOCK_TNT: return cpp14::make_unique<cTNTHandler>();
|
case E_BLOCK_TNT: return std::make_unique<cTNTHandler>();
|
||||||
case E_BLOCK_TRAPPED_CHEST: return cpp14::make_unique<cTrappedChestHandler>();
|
case E_BLOCK_TRAPPED_CHEST: return std::make_unique<cTrappedChestHandler>();
|
||||||
case E_BLOCK_TRIPWIRE_HOOK: return cpp14::make_unique<cTripwireHookHandler>();
|
case E_BLOCK_TRIPWIRE_HOOK: return std::make_unique<cTripwireHookHandler>();
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (cBlockDoorHandler::IsDoorBlockType(a_BlockType))
|
if (cBlockDoorHandler::IsDoorBlockType(a_BlockType))
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cDoorHandler>();
|
return std::make_unique<cDoorHandler>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cBlockInfo::FullyOccupiesVoxel(a_BlockType))
|
if (cBlockInfo::FullyOccupiesVoxel(a_BlockType))
|
||||||
{
|
{
|
||||||
return cpp14::make_unique<cSolidBlockHandler>();
|
return std::make_unique<cSolidBlockHandler>();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ void cSpawnPrepare::PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_Spa
|
|||||||
{
|
{
|
||||||
int chunkX, chunkZ;
|
int chunkX, chunkZ;
|
||||||
prep->DecodeChunkCoords(i, 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
|
} // for i
|
||||||
|
|
||||||
// Wait for the lighting thread to prepare everything. Event is set in the Call() callback:
|
// 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;
|
int chunkX, chunkZ;
|
||||||
DecodeChunkCoords(m_NextIdx, 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;
|
m_NextIdx += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ cWorld::cWorld(
|
|||||||
|
|
||||||
cFile::CreateFolderRecursive(m_DataPath);
|
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);
|
m_ChunkMap->TrackInDeadlockDetect(a_DeadlockDetect, m_WorldName);
|
||||||
|
|
||||||
// Load the scoreboard
|
// Load the scoreboard
|
||||||
@ -419,11 +419,11 @@ cWorld::cWorld(
|
|||||||
m_BlockTickQueueCopy.reserve(1000);
|
m_BlockTickQueueCopy.reserve(1000);
|
||||||
|
|
||||||
// Simulators:
|
// 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_WaterSimulator = InitializeFluidSimulator(IniFile, "Water", E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER);
|
||||||
m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA);
|
m_LavaSimulator = InitializeFluidSimulator(IniFile, "Lava", E_BLOCK_LAVA, E_BLOCK_STATIONARY_LAVA);
|
||||||
m_SandSimulator = cpp14::make_unique<cSandSimulator>(*this, IniFile);
|
m_SandSimulator = std::make_unique<cSandSimulator>(*this, IniFile);
|
||||||
m_FireSimulator = cpp14::make_unique<cFireSimulator>(*this, IniFile);
|
m_FireSimulator = std::make_unique<cFireSimulator>(*this, IniFile);
|
||||||
m_RedstoneSimulator = InitializeRedstoneSimulator(IniFile);
|
m_RedstoneSimulator = InitializeRedstoneSimulator(IniFile);
|
||||||
|
|
||||||
// Water, Lava and Redstone simulators get registered in their initialize function.
|
// 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 SpeedY = static_cast<float>(a_FlyAwaySpeed * Random.RandInt(40, 50));
|
||||||
float SpeedZ = static_cast<float>(a_FlyAwaySpeed * Random.RandInt(-10, 10));
|
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();
|
auto PickupPtr = Pickup.get();
|
||||||
PickupPtr->Initialize(std::move(Pickup), *this);
|
PickupPtr->Initialize(std::move(Pickup), *this);
|
||||||
}
|
}
|
||||||
@ -2007,7 +2007,7 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, Vector3d a_Pos, Vector3d
|
|||||||
continue;
|
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();
|
auto pickupPtr = pickup.get();
|
||||||
pickupPtr->Initialize(std::move(pickup), *this);
|
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)
|
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();
|
auto pickupPtr = pickup.get();
|
||||||
if (!pickupPtr->Initialize(std::move(pickup), *this))
|
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)
|
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 fallingBlockPtr = fallingBlock.get();
|
||||||
auto ID = fallingBlock->GetUniqueID();
|
auto ID = fallingBlock->GetUniqueID();
|
||||||
if (!fallingBlockPtr->Initialize(std::move(fallingBlock), *this))
|
if (!fallingBlockPtr->Initialize(std::move(fallingBlock), *this))
|
||||||
@ -2056,7 +2056,7 @@ UInt32 cWorld::SpawnExperienceOrb(Vector3d a_Pos, int a_Reward)
|
|||||||
return cEntity::INVALID_ID;
|
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();
|
auto expOrbPtr = expOrb.get();
|
||||||
if (!expOrbPtr->Initialize(std::move(expOrb), *this))
|
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();
|
auto & Random = GetRandomProvider();
|
||||||
for (auto Reward : Rewards)
|
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();
|
auto ExpOrbPtr = ExpOrb.get();
|
||||||
double SpeedX = Random.RandReal(-SpeedLimit, SpeedLimit);
|
double SpeedX = Random.RandReal(-SpeedLimit, SpeedLimit);
|
||||||
double SpeedY = Random.RandReal(0.5);
|
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;
|
std::unique_ptr<cMinecart> Minecart;
|
||||||
switch (a_MinecartType)
|
switch (a_MinecartType)
|
||||||
{
|
{
|
||||||
case E_ITEM_MINECART: Minecart = cpp14::make_unique<cRideableMinecart> (a_Pos, a_Content, a_BlockHeight); break;
|
case E_ITEM_MINECART: Minecart = std::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_CHEST_MINECART: Minecart = std::make_unique<cMinecartWithChest> (a_Pos); break;
|
||||||
case E_ITEM_FURNACE_MINECART: Minecart = cpp14::make_unique<cMinecartWithFurnace>(a_Pos); break;
|
case E_ITEM_FURNACE_MINECART: Minecart = std::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_TNT: Minecart = std::make_unique<cMinecartWithTNT> (a_Pos); break;
|
||||||
case E_ITEM_MINECART_WITH_HOPPER: Minecart = cpp14::make_unique<cMinecartWithHopper> (a_Pos); break;
|
case E_ITEM_MINECART_WITH_HOPPER: Minecart = std::make_unique<cMinecartWithHopper> (a_Pos); break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
return cEntity::INVALID_ID;
|
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)
|
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();
|
auto BoatPtr = Boat.get();
|
||||||
if (!BoatPtr->Initialize(std::move(Boat), *this))
|
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)
|
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();
|
auto TNTPtr = TNT.get();
|
||||||
if (!TNTPtr->Initialize(std::move(TNT), *this))
|
if (!TNTPtr->Initialize(std::move(TNT), *this))
|
||||||
{
|
{
|
||||||
@ -3594,7 +3594,7 @@ void cWorld::cChunkGeneratorCallbacks::OnChunkGenerated(cChunkDesc & a_ChunkDesc
|
|||||||
cChunkDef::BlockNibbles BlockMetas;
|
cChunkDef::BlockNibbles BlockMetas;
|
||||||
a_ChunkDesc.CompressBlockMetas(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.GetChunkX(), a_ChunkDesc.GetChunkZ(),
|
||||||
a_ChunkDesc.GetBlockTypes(), BlockMetas,
|
a_ChunkDesc.GetBlockTypes(), BlockMetas,
|
||||||
nullptr, nullptr, // We don't have lighting, chunk will be lighted when needed
|
nullptr, nullptr, // We don't have lighting, chunk will be lighted when needed
|
||||||
|
@ -462,7 +462,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT
|
|||||||
} // for y
|
} // for y
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
auto SetChunkData = cpp14::make_unique<cSetChunkData>(
|
auto SetChunkData = std::make_unique<cSetChunkData>(
|
||||||
a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ,
|
a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ,
|
||||||
BlockTypes, MetaData,
|
BlockTypes, MetaData,
|
||||||
IsLightValid ? BlockLight : nullptr,
|
IsLightValid ? BlockLight : nullptr,
|
||||||
@ -900,7 +900,7 @@ OwnedBlockEntity cWSSAnvil::LoadBeaconFromNBT(const cParsedNBT & a_NBT, int a_Ta
|
|||||||
return nullptr;
|
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");
|
int CurrentLine = a_NBT.FindChildByName(a_TagIdx, "Levels");
|
||||||
if (CurrentLine >= 0)
|
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));
|
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
|
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:
|
// Fuel has to be loaded at first, because of slot events:
|
||||||
int Fuel = a_NBT.FindChildByName(a_TagIdx, "Fuel");
|
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
|
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);
|
LoadItemGridFromNBT(Chest->GetContents(), a_NBT, Items);
|
||||||
return std::move(Chest);
|
return std::move(Chest);
|
||||||
}
|
}
|
||||||
@ -1050,7 +1050,7 @@ OwnedBlockEntity cWSSAnvil::LoadCommandBlockFromNBT(const cParsedNBT & a_NBT, in
|
|||||||
return nullptr;
|
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");
|
int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command");
|
||||||
if (currentLine >= 0)
|
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
|
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);
|
LoadItemGridFromNBT(Dispenser->GetContents(), a_NBT, Items);
|
||||||
return std::move(Dispenser);
|
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
|
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);
|
LoadItemGridFromNBT(Dropper->GetContents(), a_NBT, Items);
|
||||||
return std::move(Dropper);
|
return std::move(Dropper);
|
||||||
}
|
}
|
||||||
@ -1134,7 +1134,7 @@ OwnedBlockEntity cWSSAnvil::LoadFlowerPotFromNBT(const cParsedNBT & a_NBT, int a
|
|||||||
return nullptr;
|
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;
|
cItem Item;
|
||||||
|
|
||||||
int currentLine = a_NBT.FindChildByName(a_TagIdx, "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
|
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);
|
Furnace->SetLoading(true);
|
||||||
|
|
||||||
// Load slots:
|
// 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
|
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);
|
LoadItemGridFromNBT(Hopper->GetContents(), a_NBT, Items);
|
||||||
return std::move(Hopper);
|
return std::move(Hopper);
|
||||||
}
|
}
|
||||||
@ -1256,7 +1256,7 @@ OwnedBlockEntity cWSSAnvil::LoadJukeboxFromNBT(const cParsedNBT & a_NBT, int a_T
|
|||||||
return nullptr;
|
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");
|
int Record = a_NBT.FindChildByName(a_TagIdx, "Record");
|
||||||
if (Record >= 0)
|
if (Record >= 0)
|
||||||
{
|
{
|
||||||
@ -1278,7 +1278,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobSpawnerFromNBT(const cParsedNBT & a_NBT, int
|
|||||||
return nullptr;
|
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):
|
// Load entity (Cuberite worlds):
|
||||||
int Type = a_NBT.FindChildByName(a_TagIdx, "Entity");
|
int Type = a_NBT.FindChildByName(a_TagIdx, "Entity");
|
||||||
@ -1327,7 +1327,7 @@ OwnedBlockEntity cWSSAnvil::LoadMobHeadFromNBT(const cParsedNBT & a_NBT, int a_T
|
|||||||
return nullptr;
|
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");
|
int currentLine = a_NBT.FindChildByName(a_TagIdx, "SkullType");
|
||||||
if (currentLine >= 0)
|
if (currentLine >= 0)
|
||||||
@ -1401,7 +1401,7 @@ OwnedBlockEntity cWSSAnvil::LoadNoteBlockFromNBT(const cParsedNBT & a_NBT, int a
|
|||||||
return nullptr;
|
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");
|
int note = a_NBT.FindChildByName(a_TagIdx, "note");
|
||||||
if (note >= 0)
|
if (note >= 0)
|
||||||
{
|
{
|
||||||
@ -1423,7 +1423,7 @@ OwnedBlockEntity cWSSAnvil::LoadSignFromNBT(const cParsedNBT & a_NBT, int a_TagI
|
|||||||
return nullptr;
|
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");
|
int currentLine = a_NBT.FindChildByName(a_TagIdx, "Text1");
|
||||||
if (currentLine >= 0)
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Boat.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1656,7 +1656,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN
|
|||||||
BLOCKTYPE Type = static_cast<BLOCKTYPE>(a_NBT.GetInt(TypeIdx));
|
BLOCKTYPE Type = static_cast<BLOCKTYPE>(a_NBT.GetInt(TypeIdx));
|
||||||
NIBBLETYPE Meta = static_cast<NIBBLETYPE>(a_NBT.GetByte(MetaIdx));
|
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))
|
if (!LoadEntityBaseFromNBT(*FallingBlock.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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
|
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))
|
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Minecart.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1779,7 +1779,7 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a
|
|||||||
return;
|
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))
|
if (!LoadEntityBaseFromNBT(*Pickup.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*TNT.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*ExpOrb.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1892,7 +1892,7 @@ void cWSSAnvil::LoadItemFrameFromNBT(cEntityList & a_Entities, const cParsedNBT
|
|||||||
return;
|
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))
|
if (!LoadEntityBaseFromNBT(*ItemFrame.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*LeashKnot.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
@ -1942,7 +1942,7 @@ void cWSSAnvil::LoadPaintingFromNBT(cEntityList & a_Entities, const cParsedNBT &
|
|||||||
return;
|
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))
|
if (!LoadEntityBaseFromNBT(*Painting.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*Arrow.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*SplashPotion.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*Snowball.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*Egg.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*Fireball.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*FireCharge.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadProjectileBaseFromNBT(*Enderpearl.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2365,7 +2365,7 @@ void cWSSAnvil::LoadHorseFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
|
|||||||
int Color = a_NBT.GetInt(ColorIdx);
|
int Color = a_NBT.GetInt(ColorIdx);
|
||||||
int Style = a_NBT.GetInt(StyleIdx);
|
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))
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2428,7 +2428,7 @@ void cWSSAnvil::LoadMagmaCubeFromNBT(cEntityList & a_Entities, const cParsedNBT
|
|||||||
|
|
||||||
int Size = a_NBT.GetInt(SizeIdx);
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2566,7 +2566,7 @@ void cWSSAnvil::LoadRabbitFromNBT(cEntityList & a_Entities, const cParsedNBT & a
|
|||||||
int Type = a_NBT.GetInt(TypeIdx);
|
int Type = a_NBT.GetInt(TypeIdx);
|
||||||
int MoreCarrotTicks = a_NBT.GetInt(MoreCarrotTicksIdx);
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2606,7 +2606,7 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
|
|||||||
Color = static_cast<int>(a_NBT.GetByte(ColorIdx));
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2672,11 +2672,11 @@ void cWSSAnvil::LoadSkeletonFromNBT(cEntityList & a_Entities, const cParsedNBT &
|
|||||||
std::unique_ptr<cMonster> Monster;
|
std::unique_ptr<cMonster> Monster;
|
||||||
if ((TypeIdx > 0) && (a_NBT.GetByte(TypeIdx) == 1))
|
if ((TypeIdx > 0) && (a_NBT.GetByte(TypeIdx) == 1))
|
||||||
{
|
{
|
||||||
Monster = cpp14::make_unique<cWitherSkeleton>();
|
Monster = std::make_unique<cWitherSkeleton>();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Monster = cpp14::make_unique<cSkeleton>();
|
Monster = std::make_unique<cSkeleton>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
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);
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2795,7 +2795,7 @@ void cWSSAnvil::LoadVillagerFromNBT(cEntityList & a_Entities, const cParsedNBT &
|
|||||||
|
|
||||||
int Type = a_NBT.GetInt(TypeIdx);
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
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)
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -3045,7 +3045,7 @@ void cWSSAnvil::LoadZombieVillagerFromNBT(cEntityList & a_Entities, const cParse
|
|||||||
|
|
||||||
cVillager::eVillagerType Profession = static_cast<cVillager::eVillagerType>(a_NBT.GetInt(ProfessionIdx));
|
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))
|
if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -256,7 +256,7 @@ static DWORD WINAPI serviceWorkerThread(LPVOID lpParam)
|
|||||||
while (!cRoot::m_TerminateEventRaised)
|
while (!cRoot::m_TerminateEventRaised)
|
||||||
{
|
{
|
||||||
// Do the normal startup
|
// Do the normal startup
|
||||||
UniversalMain(cpp14::make_unique<cMemorySettingsRepository>());
|
UniversalMain(std::make_unique<cMemorySettingsRepository>());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
@ -380,7 +380,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
|
|||||||
cmd.parse(argc, argv);
|
cmd.parse(argc, argv);
|
||||||
|
|
||||||
// Copy the parsed args' values into a settings repository:
|
// Copy the parsed args' values into a settings repository:
|
||||||
auto repo = cpp14::make_unique<cMemorySettingsRepository>();
|
auto repo = std::make_unique<cMemorySettingsRepository>();
|
||||||
if (confArg.isSet())
|
if (confArg.isSet())
|
||||||
{
|
{
|
||||||
AString conf_file = confArg.getValue();
|
AString conf_file = confArg.getValue();
|
||||||
@ -441,7 +441,7 @@ static std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char
|
|||||||
catch (const TCLAP::ArgException & exc)
|
catch (const TCLAP::ArgException & exc)
|
||||||
{
|
{
|
||||||
fmt::print("Error reading command line {0} for arg {1}", exc.error(), exc.argId());
|
fmt::print("Error reading command line {0} for arg {1}", exc.error(), exc.argId());
|
||||||
return cpp14::make_unique<cMemorySettingsRepository>();
|
return std::make_unique<cMemorySettingsRepository>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ int TestRequest1()
|
|||||||
{
|
{
|
||||||
LOG("Running test 1");
|
LOG("Running test 1");
|
||||||
auto evtFinished = std::make_shared<cEvent>();
|
auto evtFinished = std::make_shared<cEvent>();
|
||||||
auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished);
|
auto callbacks = std::make_unique<cCallbacks>(evtFinished);
|
||||||
AStringMap options;
|
AStringMap options;
|
||||||
options["MaxRedirects"] = "0";
|
options["MaxRedirects"] = "0";
|
||||||
auto res = cUrlClient::Get("http://github.com", std::move(callbacks), AStringMap(), AString(), options);
|
auto res = cUrlClient::Get("http://github.com", std::move(callbacks), AStringMap(), AString(), options);
|
||||||
@ -138,7 +138,7 @@ int TestRequest2()
|
|||||||
{
|
{
|
||||||
LOG("Running test 2");
|
LOG("Running test 2");
|
||||||
auto evtFinished = std::make_shared<cEvent>();
|
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));
|
auto res = cUrlClient::Get("http://github.com", std::move(callbacks));
|
||||||
if (res.first)
|
if (res.first)
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ int TestRequest3()
|
|||||||
{
|
{
|
||||||
LOG("Running test 3");
|
LOG("Running test 3");
|
||||||
auto evtFinished = std::make_shared<cEvent>();
|
auto evtFinished = std::make_shared<cEvent>();
|
||||||
auto callbacks = cpp14::make_unique<cCallbacks>(evtFinished);
|
auto callbacks = std::make_unique<cCallbacks>(evtFinished);
|
||||||
AStringMap options;
|
AStringMap options;
|
||||||
options["MaxRedirects"] = "0";
|
options["MaxRedirects"] = "0";
|
||||||
auto res = cUrlClient::Get("https://github.com", std::move(callbacks), AStringMap(), AString(), options);
|
auto res = cUrlClient::Get("https://github.com", std::move(callbacks), AStringMap(), AString(), options);
|
||||||
@ -184,7 +184,7 @@ int TestRequest4()
|
|||||||
{
|
{
|
||||||
LOG("Running test 4");
|
LOG("Running test 4");
|
||||||
auto evtFinished = std::make_shared<cEvent>();
|
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));
|
auto res = cUrlClient::Get("https://github.com", std::move(callbacks));
|
||||||
if (res.first)
|
if (res.first)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user