mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-07-17 21:38:09 +00:00
Some code updates
This commit is contained in:
@@ -22,7 +22,7 @@ SurvivalMode::SurvivalMode(Minecraft *minecraft) : GameMode(minecraft)
|
||||
|
||||
if (ClientConstants::IS_DEMO_VERSION)
|
||||
{
|
||||
if( dynamic_cast<DemoMode *>(this) == NULL )
|
||||
if( dynamic_cast<DemoMode *>(this) == nullptr )
|
||||
{
|
||||
assert(false);
|
||||
// throw new IllegalStateException("Invalid game mode"); // 4J - removed
|
||||
@@ -65,7 +65,7 @@ bool SurvivalMode::destroyBlock(int x, int y, int z, int face)
|
||||
|
||||
shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
bool couldDestroy = minecraft->player->canDestroy(Tile::tiles[t]);
|
||||
if (item != NULL)
|
||||
if (item != nullptr)
|
||||
{
|
||||
item->mineBlock(t, x, y, z, minecraft->player);
|
||||
if (item->count == 0)
|
||||
@@ -117,7 +117,7 @@ void SurvivalMode::continueDestroyBlock(int x, int y, int z, int face)
|
||||
|
||||
if (destroyTicks % 4 == 0)
|
||||
{
|
||||
if (tile != NULL)
|
||||
if (tile != nullptr)
|
||||
{
|
||||
minecraft->soundEngine->play(tile->soundType->getStepSound(), x + 0.5f, y + 0.5f, z + 0.5f, (tile->soundType->getVolume() + 1) / 8, tile->soundType->getPitch() * 0.5f);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ bool SurvivalMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr
|
||||
{
|
||||
if (Tile::tiles[t]->use(level, x, y, z, player)) return true;
|
||||
}
|
||||
if (item == NULL) return false;
|
||||
if (item == nullptr) return false;
|
||||
return item->useOn(player, level, x, y, z, face);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user