diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:37:16 +0700 |
| commit | 119bff351450ea16ffda550b6e0f67379b29f708 (patch) | |
| tree | d9f28714afd516bc2450f33b0a77c5e05ff4de90 /Minecraft.Client/ServerPlayerGameMode.cpp | |
| parent | 8a2a62ea1d47364f802cf9aae97668bc4a7007b5 (diff) | |
Revert "shared_ptr -> std::shared_ptr"
This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5.
Diffstat (limited to 'Minecraft.Client/ServerPlayerGameMode.cpp')
| -rw-r--r-- | Minecraft.Client/ServerPlayerGameMode.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.Client/ServerPlayerGameMode.cpp b/Minecraft.Client/ServerPlayerGameMode.cpp index 3bd69310..9b31df0d 100644 --- a/Minecraft.Client/ServerPlayerGameMode.cpp +++ b/Minecraft.Client/ServerPlayerGameMode.cpp @@ -235,9 +235,9 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) int t = level->getTile(x, y, z); int data = level->getData(x, y, z); - + level->levelEvent(player, LevelEvent::PARTICLES_DESTROY_BLOCK, x, y, z, t + (level->getData(x, y, z) << Tile::TILE_NUM_SHIFT)); - + // 4J - In creative mode, the point where we need to tell the renderer that we are about to destroy a tile via destroyingTileAt is quite complicated. // If the player being told is remote, then we always want the client to do it as it does the final update. If the player being told is local, // then we need to update the renderer Here if we are sharing data between host & client as this is the final point where the original data is still intact. @@ -272,7 +272,7 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) if (isCreative()) { - std::shared_ptr<TileUpdatePacket> tup = std::shared_ptr<TileUpdatePacket>( new TileUpdatePacket(x, y, z, level) ); + shared_ptr<TileUpdatePacket> tup = shared_ptr<TileUpdatePacket>( new TileUpdatePacket(x, y, z, level) ); // 4J - a bit of a hack here, but if we want to tell the client that it needs to inform the renderer of a block being destroyed, then send a block 255 instead of a 0. This is handled in ClientConnection::handleTileUpdate if( tup->block == 0 ) { @@ -280,9 +280,9 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) } player->connection->send( tup ); } - else + else { - std::shared_ptr<ItemInstance> item = player->getSelectedItem(); + shared_ptr<ItemInstance> item = player->getSelectedItem(); bool canDestroy = player->canDestroy(Tile::tiles[t]); if (item != NULL) { @@ -301,13 +301,13 @@ bool ServerPlayerGameMode::destroyBlock(int x, int y, int z) } -bool ServerPlayerGameMode::useItem(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, bool bTestUseOnly) +bool ServerPlayerGameMode::useItem(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, bool bTestUseOnly) { if(!player->isAllowedToUse(item)) return false; int oldCount = item->count; int oldAux = item->getAuxValue(); - std::shared_ptr<ItemInstance> itemInstance = item->use(level, player); + shared_ptr<ItemInstance> itemInstance = item->use(level, player); if ((itemInstance != NULL && itemInstance != item) || (itemInstance != NULL && itemInstance->count != oldCount) || (itemInstance != NULL && itemInstance->getUseDuration() > 0)) { player->inventory->items[player->inventory->selected] = itemInstance; @@ -326,7 +326,7 @@ bool ServerPlayerGameMode::useItem(std::shared_ptr<Player> player, Level *level, } -bool ServerPlayerGameMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly, bool *pbUsedItem) +bool ServerPlayerGameMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly, bool *pbUsedItem) { // 4J-PB - Adding a test only version to allow tooltips to be displayed int t = level->getTile(x, y, z); @@ -336,7 +336,7 @@ bool ServerPlayerGameMode::useItemOn(std::shared_ptr<Player> player, Level *leve { if (Tile::tiles[t]->TestUse()) return true; } - else + else { if (Tile::tiles[t]->use(level, x, y, z, player, face, clickX, clickY, clickZ)) { @@ -345,7 +345,7 @@ bool ServerPlayerGameMode::useItemOn(std::shared_ptr<Player> player, Level *leve } } } - + if (item == NULL || !player->isAllowedToUse(item)) return false; if (isCreative()) { |
