Some code updates

This commit is contained in:
GabsPuNs
2026-04-09 00:57:05 -04:00
parent fb12bc0860
commit abd2d848cf
59 changed files with 241 additions and 257 deletions

View File

@@ -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);
}