diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 17:36:56 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 17:36:56 +0700 |
| commit | 7ae0c13854d94ac2153cd3bb05ce18044b7cf8bb (patch) | |
| tree | 95006852217f8f113288ea34988ae91c001a5de6 /Minecraft.Client/Common | |
| parent | 07ad68bc156b3ab70401723bb074a29588ad3cb7 (diff) | |
Revert "dynamic_pointer_cast -> std::dynamic_pointer_cast"
This reverts commit 07ad68bc156b3ab70401723bb074a29588ad3cb7.
Diffstat (limited to 'Minecraft.Client/Common')
12 files changed, 30 insertions, 30 deletions
diff --git a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp index f5da4e82..6b99c59e 100644 --- a/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp +++ b/Minecraft.Client/Common/GameRules/AddItemRuleDefinition.cpp @@ -118,9 +118,9 @@ bool AddItemRuleDefinition::addItemToContainer(std::shared_ptr<Container> contai container->setItem( slotId, newItem ); added = true; } - else if(std::dynamic_pointer_cast<Inventory>(container) != NULL) + else if(dynamic_pointer_cast<Inventory>(container) != NULL) { - added = std::dynamic_pointer_cast<Inventory>(container)->add(newItem); + added = dynamic_pointer_cast<Inventory>(container)->add(newItem); } } return added; diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp index ed24510d..5f4bc737 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp @@ -499,7 +499,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, if( e->GetType() == eTYPE_PAINTING ) { - std::shared_ptr<Painting> painting = std::dynamic_pointer_cast<Painting>(e); + std::shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e); double tileX = painting->xTile; double tileZ = painting->zTile; @@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, } else if( e->GetType() == eTYPE_ITEM_FRAME ) { - std::shared_ptr<ItemFrame> frame = std::dynamic_pointer_cast<ItemFrame>(e); + std::shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e); double tileX = frame->xTile; double tileZ = frame->zTile; diff --git a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp index 46be9e25..25b7f6ab 100644 --- a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp +++ b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceContainer.cpp @@ -78,7 +78,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st } level->setTile( worldX, worldY, worldZ, m_tile ); - std::shared_ptr<Container> container = std::dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ )); + std::shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ )); app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ); if ( container != NULL ) diff --git a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp index 18007e62..fcb8a018 100644 --- a/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp +++ b/Minecraft.Client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp @@ -54,7 +54,7 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct } level->setTile( worldX, worldY, worldZ, m_tile ); - std::shared_ptr<MobSpawnerTileEntity> entity = std::dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ )); + std::shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ )); #ifndef _CONTENT_PACKAGE wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ); diff --git a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp index a1746fbd..fcfec29d 100644 --- a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp +++ b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp @@ -62,7 +62,7 @@ int DiggerItemHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<E if(itemFound) { // It's also possible that we could hit TileEntities (eg falling sand) so don't want to give this hint then - if( std::dynamic_pointer_cast<Mob>( entity ) != NULL ) + if( dynamic_pointer_cast<Mob>( entity ) != NULL ) { return IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL; } diff --git a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp index 867e5cdc..990e4d6a 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AnvilMenu.cpp @@ -216,7 +216,7 @@ void IUIScene_AnvilMenu::handleTick() wchar_t temp[256]; swprintf(temp, 256, costString, m_repairMenu->cost); m_costString = temp; - if(!m_repairMenu->getSlot(RepairMenu::RESULT_SLOT)->mayPickup(std::dynamic_pointer_cast<Player>(m_inventory->player->shared_from_this()))) + if(!m_repairMenu->getSlot(RepairMenu::RESULT_SLOT)->mayPickup(dynamic_pointer_cast<Player>(m_inventory->player->shared_from_this()))) { canAfford = false; } diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp index 1c161c77..2c6c69fc 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp @@ -258,7 +258,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) if(pRecipeIngredientsRequired[iRecipe].bCanMake[iPad]) { - pTempItemInst->onCraftedBy(m_pPlayer->level, std::dynamic_pointer_cast<Player>( m_pPlayer->shared_from_this() ), pTempItemInst->count ); + pTempItemInst->onCraftedBy(m_pPlayer->level, dynamic_pointer_cast<Player>( m_pPlayer->shared_from_this() ), pTempItemInst->count ); // TODO 4J Stu - handleCraftItem should do a lot more than what it does, loads of the "can we craft" code should also probably be // shifted to the GameMode pMinecraft->localgameModes[iPad]->handleCraftItem(iRecipe,m_pPlayer); diff --git a/Minecraft.Client/Common/UI/IUIScene_EnchantingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_EnchantingMenu.cpp index c78eaaa1..c73f7dc5 100644 --- a/Minecraft.Client/Common/UI/IUIScene_EnchantingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_EnchantingMenu.cpp @@ -140,7 +140,7 @@ void IUIScene_EnchantingMenu::handleOtherClicked(int iPad, ESceneSection eSectio break; }; Minecraft *pMinecraft = Minecraft::GetInstance(); - if (index >= 0 && m_menu->clickMenuButton(std::dynamic_pointer_cast<Player>(pMinecraft->localplayers[iPad]), index)) + if (index >= 0 && m_menu->clickMenuButton(dynamic_pointer_cast<Player>(pMinecraft->localplayers[iPad]), index)) { pMinecraft->localgameModes[iPad]->handleInventoryButtonClick(m_menu->containerId, index); } diff --git a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp index 5204a4b2..7b9886bc 100644 --- a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp @@ -56,7 +56,7 @@ UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentL wchar_t temp[256]; swprintf(temp, 256, costString, m_repairMenu->cost); m_costString = temp; - if(!m_repairMenu->getSlot(RepairMenu::RESULT_SLOT)->mayPickup(std::dynamic_pointer_cast<Player>(m_inventory->player->shared_from_this()))) + if(!m_repairMenu->getSlot(RepairMenu::RESULT_SLOT)->mayPickup(dynamic_pointer_cast<Player>(m_inventory->player->shared_from_this()))) { expensive = true; } @@ -395,6 +395,6 @@ void UIScene_AnvilMenu::handleDestroy() // another player destroyed the anvil, so shut down the keyboard if it is displayed #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO) InputManager.DestroyKeyboard(); -#endif +#endif UIScene_AbstractContainerMenu::handleDestroy(); } diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index ceed58b3..2dcdf8fe 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -169,7 +169,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) int id = childId; //app.SetXuiServerAction(m_iPad, eXuiServerAction_DropItem, (void *)m_itemIds[id]); ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); - conn->send( GiveItemCommand::preparePacket(std::dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_itemIds[id]) ); + conn->send( GiveItemCommand::preparePacket(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_itemIds[id]) ); } break; case eControl_Mobs: @@ -185,7 +185,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId) { int id = childId; ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); - conn->send( EnchantItemCommand::preparePacket(std::dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_enchantmentIdAndLevels[id].first, m_enchantmentIdAndLevels[id].second) ); + conn->send( EnchantItemCommand::preparePacket(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_enchantmentIdAndLevels[id].first, m_enchantmentIdAndLevels[id].second) ); } break; case eControl_Schematic: diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp index 8d403b7f..eb5bf366 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp @@ -49,7 +49,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, Cust } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) item = player->inventory->getCarried(); } @@ -119,7 +119,7 @@ bool CXuiCtrlSlotItemCtrlBase::isEmpty( HXUIOBJ hObj ) } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) return player->inventory->getCarried() == NULL; } @@ -167,7 +167,7 @@ wstring CXuiCtrlSlotItemCtrlBase::GetItemDescription( HXUIOBJ hObj, vector<wstri } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) { std::shared_ptr<ItemInstance> item = player->inventory->getCarried(); @@ -190,7 +190,7 @@ std::shared_ptr<ItemInstance> CXuiCtrlSlotItemCtrlBase::getItemInstance( HXUIOBJ } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL) return player->inventory->getCarried(); } @@ -268,7 +268,7 @@ int CXuiCtrlSlotItemCtrlBase::GetObjectCount( HXUIOBJ hObj ) } else if(pUserDataContainer->m_iPad >= 0 && pUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iCount = player->inventory->getCarried()->count; @@ -309,7 +309,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj } else if(pThisUserDataContainer->m_iPad >= 0 && pThisUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pThisUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iThisID = player->inventory->getCarried()->id; @@ -336,7 +336,7 @@ bool CXuiCtrlSlotItemCtrlBase::IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj } else if(pOtherUserDataContainer->m_iPad >= 0 && pOtherUserDataContainer->m_iPad < XUSER_MAX_COUNT) { - std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] ); + std::shared_ptr<Player> player = dynamic_pointer_cast<Player>( Minecraft::GetInstance()->localplayers[pOtherUserDataContainer->m_iPad] ); if(player != NULL && player->inventory->getCarried() != NULL) { iOtherID = player->inventory->getCarried()->id; diff --git a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp index bd7ce5f1..a23e97b7 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp @@ -28,7 +28,7 @@ #include "..\..\..\Minecraft.World\net.minecraft.commands.common.h" #include "..\..\..\Minecraft.World\ConsoleSaveFileOriginal.h" -#ifdef _DEBUG_MENUS_ENABLED +#ifdef _DEBUG_MENUS_ENABLED HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) { MapChildControls(); @@ -53,7 +53,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) m_enchantmentIds.push_back(ench->id); m_enchantments.SetText( i, app.GetString( ench->getDescriptionId() ) ); } - + m_mobs.InsertItems( 0, 21 ); m_mobs.SetText( m_mobFactories.size(), L"Chicken" ); @@ -98,7 +98,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) m_mobFactories.push_back(eTYPE_BLAZE); m_mobs.SetText( m_mobFactories.size(), L"Magma Cube" ); m_mobFactories.push_back(eTYPE_LAVASLIME); - + Minecraft *pMinecraft = Minecraft::GetInstance(); m_setTime.SetValue( pMinecraft->level->getLevelData()->getTime() % 24000 ); @@ -128,14 +128,14 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress int id = m_itemIds[nIndex]; //app.SetXuiServerAction(pNotifyPressData->UserIndex, eXuiServerAction_DropItem, (void *)id); ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); - conn->send( GiveItemCommand::preparePacket(std::dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), id) ); + conn->send( GiveItemCommand::preparePacket(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), id) ); } } else if ( hObjPressed == m_mobs ) { nIndex = m_mobs.GetCurSel(); if(nIndex<m_mobFactories.size()) - { + { app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_SpawnMob,(void *)m_mobFactories[nIndex]); } } @@ -143,7 +143,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress { nIndex = m_enchantments.GetCurSel(); ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad()); - conn->send( EnchantItemCommand::preparePacket(std::dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_enchantmentIds[nIndex]) ); + conn->send( EnchantItemCommand::preparePacket(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_enchantmentIds[nIndex]) ); } /*else if( hObjPressed == m_saveToDisc ) // 4J-JEV: Doesn't look like we use this debug option anymore. { @@ -171,7 +171,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress HXUIOBJ hScene; HRESULT hr; //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); @@ -189,7 +189,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress HXUIOBJ hScene; HRESULT hr; //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); @@ -256,7 +256,7 @@ HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotify if( hObjSource == m_setTime ) { Minecraft *pMinecraft = Minecraft::GetInstance(); - + // Need to set the time on both levels to stop the flickering as the local level // tries to predict the time // Only works if we are on the host machine, but shouldn't break if not |
