summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-23 14:59:42 +0200
committerHowaner <franzi.moos@googlemail.com>2014-10-23 14:59:42 +0200
commit72bb299a4a4f74840c3b368c6669ddc3d32006ee (patch)
tree748fee756010b1f36aa95162f762e21ee0d19c0a /src/BlockEntities
parentMerge branch 'master' into ChunkLoader (diff)
parentFixed a crash in redstone simulator. (diff)
downloadcuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.gz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.bz2
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.lz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.xz
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.tar.zst
cuberite-72bb299a4a4f74840c3b368c6669ddc3d32006ee.zip
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/BeaconEntity.cpp24
-rw-r--r--src/BlockEntities/BlockEntity.cpp2
-rw-r--r--src/BlockEntities/BlockEntity.h4
-rw-r--r--src/BlockEntities/BlockEntityWithItems.h6
-rw-r--r--src/BlockEntities/ChestEntity.cpp6
-rw-r--r--src/BlockEntities/CommandBlockEntity.cpp2
-rw-r--r--src/BlockEntities/DispenserEntity.cpp4
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp22
-rw-r--r--src/BlockEntities/EnderChestEntity.cpp6
-rw-r--r--src/BlockEntities/FlowerPotEntity.cpp2
-rw-r--r--src/BlockEntities/FlowerPotEntity.h2
-rw-r--r--src/BlockEntities/FurnaceEntity.cpp10
-rw-r--r--src/BlockEntities/FurnaceEntity.h2
-rw-r--r--src/BlockEntities/HopperEntity.cpp24
-rw-r--r--src/BlockEntities/MobHeadEntity.h2
-rw-r--r--src/BlockEntities/NoteEntity.h2
-rw-r--r--src/BlockEntities/SignEntity.h2
17 files changed, 66 insertions, 56 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp
index fe5bcf143..85819446c 100644
--- a/src/BlockEntities/BeaconEntity.cpp
+++ b/src/BlockEntities/BeaconEntity.cpp
@@ -2,7 +2,6 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "BeaconEntity.h"
-#include <algorithm>
#include "../BlockArea.h"
#include "../Entities/Player.h"
@@ -98,7 +97,7 @@ bool cBeaconEntity::SetPrimaryEffect(cEntityEffect::eType a_Effect)
m_PrimaryEffect = a_Effect;
// Send window update:
- if (GetWindow() != NULL)
+ if (GetWindow() != nullptr)
{
GetWindow()->SetProperty(1, m_PrimaryEffect);
}
@@ -120,7 +119,7 @@ bool cBeaconEntity::SetSecondaryEffect(cEntityEffect::eType a_Effect)
m_SecondaryEffect = a_Effect;
// Send window update:
- if (GetWindow() != NULL)
+ if (GetWindow() != nullptr)
{
GetWindow()->SetProperty(2, m_SecondaryEffect);
}
@@ -185,7 +184,7 @@ void cBeaconEntity::UpdateBeacon(void)
if (m_BeaconLevel != OldBeaconLevel)
{
// Send window update:
- if (GetWindow() != NULL)
+ if (GetWindow() != nullptr)
{
GetWindow()->SetProperty(0, m_BeaconLevel);
}
@@ -228,7 +227,10 @@ void cBeaconEntity::GiveEffects(void)
virtual bool Item(cPlayer * a_Player)
{
Vector3d PlayerPosition = Vector3d(a_Player->GetPosition());
- PlayerPosition.y = std::min(static_cast<double>(m_PosY), PlayerPosition.y);
+ if (PlayerPosition.y > (double)m_PosY)
+ {
+ PlayerPosition.y = (double)m_PosY;
+ }
// TODO: Vanilla minecraft uses an AABB check instead of a radius one
Vector3d BeaconPosition = Vector3d(m_PosX, m_PosY, m_PosZ);
@@ -253,7 +255,7 @@ void cBeaconEntity::GiveEffects(void)
, m_PrimaryEffect(a_PrimaryEffect)
, m_SecondaryEffect(a_SecondaryEffect)
, m_EffectLevel(a_EffectLevel)
- {}
+ {};
} PlayerCallback(Radius, m_PosX, m_PosY, m_PosZ, m_PrimaryEffect, SecondaryEffect, EffectLevel);
GetWorld()->ForEachPlayer(PlayerCallback);
@@ -281,13 +283,13 @@ bool cBeaconEntity::Tick(float a_Dt, cChunk & a_Chunk)
void cBeaconEntity::UsedBy(cPlayer * a_Player)
{
cWindow * Window = GetWindow();
- if (Window == NULL)
+ if (Window == nullptr)
{
OpenWindow(new cBeaconWindow(m_PosX, m_PosY, m_PosZ, this));
Window = GetWindow();
}
-
- if (Window != NULL)
+
+ if (Window != nullptr)
{
// if (a_Player->GetWindow() != Window)
// -> Because mojang doesn't send a 'close window' packet when you click the cancel button in the beacon inventory ...
@@ -305,3 +307,7 @@ void cBeaconEntity::SendTo(cClientHandle & a_Client)
{
a_Client.SendUpdateBlockEntity(*this);
}
+
+
+
+
diff --git a/src/BlockEntities/BlockEntity.cpp b/src/BlockEntities/BlockEntity.cpp
index 05ad03a3d..3d96e891e 100644
--- a/src/BlockEntities/BlockEntity.cpp
+++ b/src/BlockEntities/BlockEntity.cpp
@@ -48,7 +48,7 @@ cBlockEntity * cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE
__FUNCTION__, a_BlockType, ItemTypeToString(a_BlockType).c_str()
);
ASSERT(!"Requesting creation of an unknown block entity");
- return NULL;
+ return nullptr;
}
diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h
index b04d20340..ffd6ee856 100644
--- a/src/BlockEntities/BlockEntity.h
+++ b/src/BlockEntities/BlockEntity.h
@@ -70,8 +70,8 @@ public:
/// Creates a new block entity for the specified block type
/// If a_World is valid, then the entity is created bound to that world
- /// Returns NULL for unknown block types
- static cBlockEntity * CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World = NULL);
+ /// Returns nullptr for unknown block types
+ static cBlockEntity * CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World = nullptr);
static const char * GetClassStatic(void) // Needed for ManualBindings's ForEach templates
{
diff --git a/src/BlockEntities/BlockEntityWithItems.h b/src/BlockEntities/BlockEntityWithItems.h
index cb7bc2fb4..8c7d4749b 100644
--- a/src/BlockEntities/BlockEntityWithItems.h
+++ b/src/BlockEntities/BlockEntityWithItems.h
@@ -47,7 +47,7 @@ public:
virtual void Destroy(void) override
{
// Drop the contents as pickups:
- ASSERT(m_World != NULL);
+ ASSERT(m_World != nullptr);
cItems Pickups;
m_Contents.CopyToItems(Pickups);
m_Contents.Clear();
@@ -78,9 +78,9 @@ protected:
{
UNUSED(a_SlotNum);
ASSERT(a_Grid == &m_Contents);
- if (m_World != NULL)
+ if (m_World != nullptr)
{
- if (GetWindow() != NULL)
+ if (GetWindow() != nullptr)
{
GetWindow()->BroadcastWholeWindow();
}
diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp
index 19d88b646..0cd9c66e0 100644
--- a/src/BlockEntities/ChestEntity.cpp
+++ b/src/BlockEntities/ChestEntity.cpp
@@ -23,7 +23,7 @@ cChestEntity::cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_
cChestEntity::~cChestEntity()
{
cWindow * Window = GetWindow();
- if (Window != NULL)
+ if (Window != nullptr)
{
Window->OwnerDestroyed();
}
@@ -49,14 +49,14 @@ void cChestEntity::UsedBy(cPlayer * a_Player)
{
// If the window is not created, open it anew:
cWindow * Window = GetWindow();
- if (Window == NULL)
+ if (Window == nullptr)
{
OpenNewWindow();
Window = GetWindow();
}
// Open the window for the player:
- if (Window != NULL)
+ if (Window != nullptr)
{
if (a_Player->GetWindow() != Window)
{
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 1a5a3f01e..b7f938ffd 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -154,7 +154,7 @@ void cCommandBlockEntity::SendTo(cClientHandle & a_Client)
void cCommandBlockEntity::Execute()
{
- ASSERT(m_World != NULL); // Execute should not be called before the command block is attached to a world
+ ASSERT(m_World != nullptr); // Execute should not be called before the command block is attached to a world
if (!m_World->AreCommandBlocksEnabled())
{
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp
index 157862bd1..42a0476b6 100644
--- a/src/BlockEntities/DispenserEntity.cpp
+++ b/src/BlockEntities/DispenserEntity.cpp
@@ -28,7 +28,7 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
NIBBLETYPE Meta = a_Chunk.GetMeta(m_RelX, m_PosY, m_RelZ);
AddDropSpenserDir(DispX, DispY, DispZ, Meta);
cChunk * DispChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(DispX, DispZ);
- if (DispChunk == NULL)
+ if (DispChunk == nullptr)
{
// Would dispense into / interact with a non-loaded chunk, ignore the tick
return;
@@ -190,7 +190,7 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
void cDispenserEntity::SpawnProjectileFromDispenser(int a_BlockX, int a_BlockY, int a_BlockZ, cProjectileEntity::eKind a_Kind, const Vector3d & a_ShootVector)
{
- m_World->CreateProjectile(static_cast<double>(a_BlockX + 0.5), static_cast<double>(a_BlockY + 0.5), static_cast<double>(a_BlockZ + 0.5), a_Kind, NULL, NULL, &a_ShootVector);
+ m_World->CreateProjectile(static_cast<double>(a_BlockX + 0.5), static_cast<double>(a_BlockY + 0.5), static_cast<double>(a_BlockZ + 0.5), a_Kind, nullptr, nullptr, &a_ShootVector);
}
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp
index e39b938a0..3f98836e7 100644
--- a/src/BlockEntities/DropSpenserEntity.cpp
+++ b/src/BlockEntities/DropSpenserEntity.cpp
@@ -28,7 +28,7 @@ cDropSpenserEntity::~cDropSpenserEntity()
{
// Tell window its owner is destroyed
cWindow * Window = GetWindow();
- if (Window != NULL)
+ if (Window != nullptr)
{
Window->OwnerDestroyed();
}
@@ -70,19 +70,19 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
SlotsCnt++;
}
} // for i - m_Contents[]
-
+
if (SlotsCnt == 0)
{
// Nothing in the dropspenser, play the click sound
m_World->BroadcastSoundEffect("random.click", m_PosX * 8, m_PosY * 8, m_PosZ * 8, 1.0f, 1.2f);
return;
}
-
+
int RandomSlot = m_World->GetTickRandomNumber(SlotsCnt - 1);
-
+
// DropSpense the item, using the specialized behavior in the subclasses:
DropSpenseFromSlot(a_Chunk, OccupiedSlots[RandomSlot]);
-
+
// Broadcast a smoke and click effects:
NIBBLETYPE Meta = a_Chunk.GetMeta(m_RelX, m_PosY, m_RelZ);
int SmokeDir = 0;
@@ -132,7 +132,7 @@ bool cDropSpenserEntity::Tick(float a_Dt, cChunk & a_Chunk)
{
return false;
}
-
+
m_ShouldDropSpense = false;
DropSpense(a_Chunk);
return true;
@@ -155,13 +155,13 @@ void cDropSpenserEntity::SendTo(cClientHandle & a_Client)
void cDropSpenserEntity::UsedBy(cPlayer * a_Player)
{
cWindow * Window = GetWindow();
- if (Window == NULL)
+ if (Window == nullptr)
{
OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this));
Window = GetWindow();
}
-
- if (Window != NULL)
+
+ if (Window != nullptr)
{
if (a_Player->GetWindow() != Window)
{
@@ -205,3 +205,7 @@ void cDropSpenserEntity::DropFromSlot(cChunk & a_Chunk, int a_SlotNum)
m_World->SpawnItemPickups(Pickups, MicroX, MicroY, MicroZ, PickupSpeedX, PickupSpeedY, PickupSpeedZ);
}
+
+
+
+
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp
index 0654d97dd..e18490a1e 100644
--- a/src/BlockEntities/EnderChestEntity.cpp
+++ b/src/BlockEntities/EnderChestEntity.cpp
@@ -23,7 +23,7 @@ cEnderChestEntity::cEnderChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, c
cEnderChestEntity::~cEnderChestEntity()
{
cWindow * Window = GetWindow();
- if (Window != NULL)
+ if (Window != nullptr)
{
Window->OwnerDestroyed();
}
@@ -37,14 +37,14 @@ void cEnderChestEntity::UsedBy(cPlayer * a_Player)
{
// If the window is not created, open it anew:
cWindow * Window = GetWindow();
- if (Window == NULL)
+ if (Window == nullptr)
{
OpenNewWindow();
Window = GetWindow();
}
// Open the window for the player:
- if (Window != NULL)
+ if (Window != nullptr)
{
if (a_Player->GetWindow() != Window)
{
diff --git a/src/BlockEntities/FlowerPotEntity.cpp b/src/BlockEntities/FlowerPotEntity.cpp
index ad7b496cc..64b7edd02 100644
--- a/src/BlockEntities/FlowerPotEntity.cpp
+++ b/src/BlockEntities/FlowerPotEntity.cpp
@@ -59,7 +59,7 @@ void cFlowerPotEntity::Destroy(void)
// Drop the contents as pickups:
if (!m_Item.IsEmpty())
{
- ASSERT(m_World != NULL);
+ ASSERT(m_World != nullptr);
cItems Pickups;
Pickups.Add(m_Item);
m_World->SpawnItemPickups(Pickups, m_PosX + 0.5, m_PosY + 0.5, m_PosZ + 0.5);
diff --git a/src/BlockEntities/FlowerPotEntity.h b/src/BlockEntities/FlowerPotEntity.h
index 5b86621f5..fc886c51f 100644
--- a/src/BlockEntities/FlowerPotEntity.h
+++ b/src/BlockEntities/FlowerPotEntity.h
@@ -38,7 +38,7 @@ public:
BLOCKENTITY_PROTODEF(cFlowerPotEntity);
- /** Creates a new flowerpot entity at the specified block coords. a_World may be NULL */
+ /** Creates a new flowerpot entity at the specified block coords. a_World may be nullptr */
cFlowerPotEntity(int a_BlocX, int a_BlockY, int a_BlockZ, cWorld * a_World);
virtual void Destroy(void) override;
diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp
index d8ca15c6c..d2ec2bd1e 100644
--- a/src/BlockEntities/FurnaceEntity.cpp
+++ b/src/BlockEntities/FurnaceEntity.cpp
@@ -26,7 +26,7 @@ enum
cFurnaceEntity::cFurnaceEntity(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cWorld * a_World) :
super(a_BlockType, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
m_BlockMeta(a_BlockMeta),
- m_CurrentRecipe(NULL),
+ m_CurrentRecipe(nullptr),
m_IsDestroyed(false),
m_IsCooking(a_BlockType == E_BLOCK_LIT_FURNACE),
m_NeedCookTime(0),
@@ -45,7 +45,7 @@ cFurnaceEntity::~cFurnaceEntity()
{
// Tell window its owner is destroyed
cWindow * Window = GetWindow();
- if (Window != NULL)
+ if (Window != nullptr)
{
Window->OwnerDestroyed();
}
@@ -145,7 +145,7 @@ void cFurnaceEntity::SendTo(cClientHandle & a_Client)
void cFurnaceEntity::BroadcastProgress(short a_ProgressbarID, short a_Value)
{
cWindow * Window = GetWindow();
- if (Window != NULL)
+ if (Window != nullptr)
{
Window->SetProperty(a_ProgressbarID, a_Value);
}
@@ -306,7 +306,7 @@ void cFurnaceEntity::UpdateOutput(void)
bool cFurnaceEntity::CanCookInputToOutput(void) const
{
- if (m_CurrentRecipe == NULL)
+ if (m_CurrentRecipe == nullptr)
{
// This input cannot be cooked
return false;
@@ -349,7 +349,7 @@ void cFurnaceEntity::UpdateProgressBars(bool a_ForceUpdate)
int CurFuel = (m_FuelBurnTime > 0) ? 200 - (200 * m_TimeBurned / m_FuelBurnTime) : 0;
BroadcastProgress(PROGRESSBAR_FUEL, static_cast<short>(CurFuel));
- int CurCook = (m_NeedCookTime > 0) ? (200 * m_TimeCooked / m_NeedCookTime) : 0;
+ int CurCook = (m_NeedCookTime > 0) ? (200 * m_TimeCooked / m_NeedCookTime) : 0;
BroadcastProgress(PROGRESSBAR_SMELTING_CONFIRM, 200); // Post 1.8, Mojang requires a random packet with an ID of three and value of 200. Wat. Wat. Wat.
BroadcastProgress(PROGRESSBAR_SMELTING, static_cast<short>(CurCook));
}
diff --git a/src/BlockEntities/FurnaceEntity.h b/src/BlockEntities/FurnaceEntity.h
index 8e48810ba..71c2fe127 100644
--- a/src/BlockEntities/FurnaceEntity.h
+++ b/src/BlockEntities/FurnaceEntity.h
@@ -133,7 +133,7 @@ protected:
int m_FuelBurnTime;
/** Amount of ticks that the current fuel has been burning */
- int m_TimeBurned;
+ int m_TimeBurned;
/** Sends the specified progressbar value to all clients of the window */
void BroadcastProgress(short a_ProgressbarID, short a_Value);
diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp
index 9f64ea148..fe3fb85c4 100644
--- a/src/BlockEntities/HopperEntity.cpp
+++ b/src/BlockEntities/HopperEntity.cpp
@@ -86,14 +86,14 @@ void cHopperEntity::UsedBy(cPlayer * a_Player)
{
// If the window is not created, open it anew:
cWindow * Window = GetWindow();
- if (Window == NULL)
+ if (Window == nullptr)
{
OpenNewWindow();
Window = GetWindow();
}
// Open the window for the player:
- if (Window != NULL)
+ if (Window != nullptr)
{
if (a_Player->GetWindow() != Window)
{
@@ -197,7 +197,7 @@ bool cHopperEntity::MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick)
virtual bool Item(cEntity * a_Entity) override
{
- ASSERT(a_Entity != NULL);
+ ASSERT(a_Entity != nullptr);
if (!a_Entity->IsPickup() || a_Entity->IsDestroyed())
{
@@ -299,7 +299,7 @@ bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick)
int OutRelX = OutX - a_Chunk.GetPosX() * cChunkDef::Width;
int OutRelZ = OutZ - a_Chunk.GetPosZ() * cChunkDef::Width;
cChunk * DestChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(OutRelX, OutRelZ);
- if (DestChunk == NULL)
+ if (DestChunk == nullptr)
{
// The destination chunk has been unloaded, don't tick
return false;
@@ -328,7 +328,7 @@ bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick)
case E_BLOCK_HOPPER:
{
cBlockEntityWithItems * BlockEntity = static_cast<cBlockEntityWithItems *>(DestChunk->GetBlockEntity(OutX, OutY, OutZ));
- if (BlockEntity == NULL)
+ if (BlockEntity == nullptr)
{
LOGWARNING("%s: A block entity was not found where expected at {%d, %d, %d}", __FUNCTION__, OutX, OutY, OutZ);
return false;
@@ -355,7 +355,7 @@ bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick)
bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk)
{
cChestEntity * MainChest = static_cast<cChestEntity *>(a_Chunk.GetBlockEntity(m_PosX, m_PosY + 1, m_PosZ));
- if (MainChest == NULL)
+ if (MainChest == nullptr)
{
LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d}", __FUNCTION__, m_PosX, m_PosY + 1, m_PosZ);
return false;
@@ -383,7 +383,7 @@ bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk)
int x = m_RelX + Coords[i].x;
int z = m_RelZ + Coords[i].z;
cChunk * Neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(x, z);
- if (Neighbor == NULL)
+ if (Neighbor == nullptr)
{
continue;
}
@@ -396,7 +396,7 @@ bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk)
}
cChestEntity * SideChest = static_cast<cChestEntity *>(Neighbor->GetBlockEntity(m_PosX + Coords[i].x, m_PosY + 1, m_PosZ + Coords[i].z));
- if (SideChest == NULL)
+ if (SideChest == nullptr)
{
LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d}", __FUNCTION__, m_PosX + Coords[i].x, m_PosY + 1, m_PosZ + Coords[i].z);
}
@@ -422,7 +422,7 @@ bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk)
bool cHopperEntity::MoveItemsFromFurnace(cChunk & a_Chunk)
{
cFurnaceEntity * Furnace = static_cast<cFurnaceEntity *>(a_Chunk.GetBlockEntity(m_PosX, m_PosY + 1, m_PosZ));
- if (Furnace == NULL)
+ if (Furnace == nullptr)
{
LOGWARNING("%s: A furnace entity was not found where expected, at {%d, %d, %d}", __FUNCTION__, m_PosX, m_PosY + 1, m_PosZ);
return false;
@@ -536,7 +536,7 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_Block
{
// Try the chest directly connected to the hopper:
cChestEntity * ConnectedChest = static_cast<cChestEntity *>(a_Chunk.GetBlockEntity(a_BlockX, a_BlockY, a_BlockZ));
- if (ConnectedChest == NULL)
+ if (ConnectedChest == nullptr)
{
LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d}", __FUNCTION__, a_BlockX, a_BlockY, a_BlockZ);
return false;
@@ -566,7 +566,7 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_Block
int x = RelX + Coords[i].x;
int z = RelZ + Coords[i].z;
cChunk * Neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(x, z);
- if (Neighbor == NULL)
+ if (Neighbor == nullptr)
{
continue;
}
@@ -579,7 +579,7 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_Block
}
cChestEntity * Chest = static_cast<cChestEntity *>(Neighbor->GetBlockEntity(a_BlockX + Coords[i].x, a_BlockY, a_BlockZ + Coords[i].z));
- if (Chest == NULL)
+ if (Chest == nullptr)
{
LOGWARNING("%s: A chest entity was not found where expected, at {%d, %d, %d} (%d, %d)", __FUNCTION__, a_BlockX + Coords[i].x, a_BlockY, a_BlockZ + Coords[i].z, x, z);
continue;
diff --git a/src/BlockEntities/MobHeadEntity.h b/src/BlockEntities/MobHeadEntity.h
index 7f69bc5ad..7132ef558 100644
--- a/src/BlockEntities/MobHeadEntity.h
+++ b/src/BlockEntities/MobHeadEntity.h
@@ -36,7 +36,7 @@ public:
BLOCKENTITY_PROTODEF(cMobHeadEntity);
- /** Creates a new mob head entity at the specified block coords. a_World may be NULL */
+ /** Creates a new mob head entity at the specified block coords. a_World may be nullptr */
cMobHeadEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
// tolua_begin
diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h
index 74dbde046..fc5f27d07 100644
--- a/src/BlockEntities/NoteEntity.h
+++ b/src/BlockEntities/NoteEntity.h
@@ -42,7 +42,7 @@ public:
BLOCKENTITY_PROTODEF(cNoteEntity);
- /// Creates a new note entity. a_World may be NULL
+ /// Creates a new note entity. a_World may be nullptr
cNoteEntity(int a_X, int a_Y, int a_Z, cWorld * a_World);
virtual ~cNoteEntity() {}
diff --git a/src/BlockEntities/SignEntity.h b/src/BlockEntities/SignEntity.h
index be13c7a32..52baa486d 100644
--- a/src/BlockEntities/SignEntity.h
+++ b/src/BlockEntities/SignEntity.h
@@ -36,7 +36,7 @@ public:
BLOCKENTITY_PROTODEF(cSignEntity);
- /// Creates a new empty sign entity at the specified block coords and block type (wall or standing). a_World may be NULL
+ /// Creates a new empty sign entity at the specified block coords and block type (wall or standing). a_World may be nullptr
cSignEntity(BLOCKTYPE a_BlockType, int a_X, int a_Y, int a_Z, cWorld * a_World);
// tolua_begin