From e506b8fe7ac3fdfb2441ddc67ed94676f1aa2b67 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:37:41 -0600 Subject: [PATCH] refactor: unglob `std::pair` --- .../Textures/Packs/TexturePackRepository.cpp | 6 +- .../Textures/Packs/TexturePackRepository.h | 2 +- .../Stitching/PreStitchedTextureMap.cpp | 34 ++--- .../Stitching/PreStitchedTextureMap.h | 2 +- .../Textures/Stitching/StitchedTexture.cpp | 2 +- .../Textures/Stitching/StitchedTexture.h | 2 +- Minecraft.Client/Utils/ArchiveFile.cpp | 2 +- Minecraft.Client/Utils/MemoryTracker.cpp | 2 +- Minecraft.Client/Utils/StringTable.cpp | 4 +- Minecraft.Client/Utils/WstringLookup.cpp | 4 +- Minecraft.World/Entities/Mobs/Villager.cpp | 136 +++++++++--------- Minecraft.World/Entities/Mobs/Villager.h | 4 +- Minecraft.World/Items/PotionItem.cpp | 6 +- Minecraft.World/Items/PotionItem.h | 4 +- Minecraft.World/Stats/Stat.cpp | 2 +- .../WorldGen/Structures/Village.cpp | 4 +- 16 files changed, 108 insertions(+), 108 deletions(-) diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp index 0977b4ca2..27a4df8e8 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp +++ b/Minecraft.Client/Textures/Packs/TexturePackRepository.cpp @@ -291,14 +291,14 @@ bool TexturePackRepository::canUseWebSkin() return false; } -std::vector< pair > *TexturePackRepository::getTexturePackIdNames() +std::vector< std::pair > *TexturePackRepository::getTexturePackIdNames() { - std::vector< pair > *packList = new std::vector< pair >(); + std::vector< std::pair > *packList = new std::vector< std::pair >(); for(AUTO_VAR(it,texturePacks->begin()); it != texturePacks->end(); ++it) { TexturePack *pack = *it; - packList->push_back( pair(pack->getId(),pack->getName()) ); + packList->push_back( std::pair(pack->getId(),pack->getName()) ); } return packList; } diff --git a/Minecraft.Client/Textures/Packs/TexturePackRepository.h b/Minecraft.Client/Textures/Packs/TexturePackRepository.h index d8c672235..1f8e66b8c 100644 --- a/Minecraft.Client/Textures/Packs/TexturePackRepository.h +++ b/Minecraft.Client/Textures/Packs/TexturePackRepository.h @@ -60,7 +60,7 @@ public: bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added - std::vector< pair > *getTexturePackIdNames(); + std::vector< std::pair > *getTexturePackIdNames(); bool selectTexturePackById(DWORD id); // 4J Added TexturePack *getTexturePackById(DWORD id); // 4J Added diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp index 30fbaefd3..cdcfb0a07 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.cpp @@ -363,11 +363,11 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"compassP1",new SimpleIcon(L"compassP1",slotSize*8,slotSize*14,slotSize*(8+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"compassP2",new SimpleIcon(L"compassP2",slotSize*9,slotSize*14,slotSize*(9+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"compassP3",new SimpleIcon(L"compassP3",slotSize*10,slotSize*14,slotSize*(10+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"compass",L"compass")); - texturesToAnimate.push_back(pair(L"compassP0",L"compass")); - texturesToAnimate.push_back(pair(L"compassP1",L"compass")); - texturesToAnimate.push_back(pair(L"compassP2",L"compass")); - texturesToAnimate.push_back(pair(L"compassP3",L"compass")); + texturesToAnimate.push_back(std::pair(L"compass",L"compass")); + texturesToAnimate.push_back(std::pair(L"compassP0",L"compass")); + texturesToAnimate.push_back(std::pair(L"compassP1",L"compass")); + texturesToAnimate.push_back(std::pair(L"compassP2",L"compass")); + texturesToAnimate.push_back(std::pair(L"compassP3",L"compass")); texturesByName.insert(stringIconMap::value_type(L"diamond",new SimpleIcon(L"diamond",slotSize*7,slotSize*3,slotSize*(7+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"redstone",new SimpleIcon(L"redstone",slotSize*8,slotSize*3,slotSize*(8+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"clay",new SimpleIcon(L"clay",slotSize*9,slotSize*3,slotSize*(9+1),slotSize*(3+1)))); @@ -388,11 +388,11 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"clockP1",new SimpleIcon(L"clockP1",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"clockP2",new SimpleIcon(L"clockP2",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"clockP3",new SimpleIcon(L"clockP3",slotSize*14,slotSize*14,slotSize*(14+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"clock",L"clock")); - texturesToAnimate.push_back(pair(L"clockP0",L"clock")); - texturesToAnimate.push_back(pair(L"clockP1",L"clock")); - texturesToAnimate.push_back(pair(L"clockP2",L"clock")); - texturesToAnimate.push_back(pair(L"clockP3",L"clock")); + texturesToAnimate.push_back(std::pair(L"clock",L"clock")); + texturesToAnimate.push_back(std::pair(L"clockP0",L"clock")); + texturesToAnimate.push_back(std::pair(L"clockP1",L"clock")); + texturesToAnimate.push_back(std::pair(L"clockP2",L"clock")); + texturesToAnimate.push_back(std::pair(L"clockP3",L"clock")); texturesByName.insert(stringIconMap::value_type(L"bowl",new SimpleIcon(L"bowl",slotSize*7,slotSize*4,slotSize*(7+1),slotSize*(4+1)))); texturesByName.insert(stringIconMap::value_type(L"mushroomStew",new SimpleIcon(L"mushroomStew",slotSize*8,slotSize*4,slotSize*(8+1),slotSize*(4+1)))); texturesByName.insert(stringIconMap::value_type(L"yellowDust",new SimpleIcon(L"yellowDust",slotSize*9,slotSize*4,slotSize*(9+1),slotSize*(4+1)))); @@ -607,7 +607,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"rose",new SimpleIcon(L"rose",slotSize*12,slotSize*0,slotSize*(12+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"flower",new SimpleIcon(L"flower",slotSize*13,slotSize*0,slotSize*(13+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"portal",new SimpleIcon(L"portal",slotSize*14,slotSize*0,slotSize*(14+1),slotSize*(0+1)))); - texturesToAnimate.push_back(pair(L"portal",L"portal")); + texturesToAnimate.push_back(std::pair(L"portal",L"portal")); texturesByName.insert(stringIconMap::value_type(L"sapling",new SimpleIcon(L"sapling",slotSize*15,slotSize*0,slotSize*(15+1),slotSize*(0+1)))); texturesByName.insert(stringIconMap::value_type(L"stonebrick",new SimpleIcon(L"stonebrick",slotSize*0,slotSize*1,slotSize*(0+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"bedrock",new SimpleIcon(L"bedrock",slotSize*1,slotSize*1,slotSize*(1+1),slotSize*(1+1)))); @@ -625,7 +625,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"mushroom_brown",new SimpleIcon(L"mushroom_brown",slotSize*13,slotSize*1,slotSize*(13+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"sapling_jungle",new SimpleIcon(L"sapling_jungle",slotSize*14,slotSize*1,slotSize*(14+1),slotSize*(1+1)))); texturesByName.insert(stringIconMap::value_type(L"fire_0",new SimpleIcon(L"fire_0",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1)))); - texturesToAnimate.push_back(pair(L"fire_0",L"fire_0")); + texturesToAnimate.push_back(std::pair(L"fire_0",L"fire_0")); texturesByName.insert(stringIconMap::value_type(L"oreGold",new SimpleIcon(L"oreGold",slotSize*0,slotSize*2,slotSize*(0+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"oreIron",new SimpleIcon(L"oreIron",slotSize*1,slotSize*2,slotSize*(1+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"oreCoal",new SimpleIcon(L"oreCoal",slotSize*2,slotSize*2,slotSize*(2+1),slotSize*(2+1)))); @@ -642,7 +642,7 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"furnace_side",new SimpleIcon(L"furnace_side",slotSize*13,slotSize*2,slotSize*(13+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"dispenser_front",new SimpleIcon(L"dispenser_front",slotSize*14,slotSize*2,slotSize*(14+1),slotSize*(2+1)))); texturesByName.insert(stringIconMap::value_type(L"fire_1",new SimpleIcon(L"fire_1",slotSize*15,slotSize*1,slotSize*(15+1),slotSize*(1+1)))); - texturesToAnimate.push_back(pair(L"fire_1",L"fire_1")); + texturesToAnimate.push_back(std::pair(L"fire_1",L"fire_1")); texturesByName.insert(stringIconMap::value_type(L"sponge",new SimpleIcon(L"sponge",slotSize*0,slotSize*3,slotSize*(0+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"glass",new SimpleIcon(L"glass",slotSize*1,slotSize*3,slotSize*(1+1),slotSize*(3+1)))); texturesByName.insert(stringIconMap::value_type(L"oreDiamond",new SimpleIcon(L"oreDiamond",slotSize*2,slotSize*3,slotSize*(2+1),slotSize*(3+1)))); @@ -803,9 +803,9 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"potatoes_2",new SimpleIcon(L"potatoes_2",slotSize*10,slotSize*12,slotSize*(10+1),slotSize*(12+1)))); texturesByName.insert(stringIconMap::value_type(L"potatoes_3",new SimpleIcon(L"potatoes_3",slotSize*12,slotSize*12,slotSize*(12+1),slotSize*(12+1)))); texturesByName.insert(stringIconMap::value_type(L"water",new SimpleIcon(L"water",slotSize*13,slotSize*12,slotSize*(13+1),slotSize*(12+1)))); - texturesToAnimate.push_back(pair(L"water",L"water")); + texturesToAnimate.push_back(std::pair(L"water",L"water")); texturesByName.insert(stringIconMap::value_type(L"water_flow",new SimpleIcon(L"water_flow",slotSize*14,slotSize*12,slotSize*(14+2),slotSize*(12+2)))); - texturesToAnimate.push_back(pair(L"water_flow",L"water_flow")); + texturesToAnimate.push_back(std::pair(L"water_flow",L"water_flow")); texturesByName.insert(stringIconMap::value_type(L"sandstone_bottom",new SimpleIcon(L"sandstone_bottom",slotSize*0,slotSize*13,slotSize*(0+1),slotSize*(13+1)))); texturesByName.insert(stringIconMap::value_type(L"cloth_9",new SimpleIcon(L"cloth_9",slotSize*1,slotSize*13,slotSize*(1+1),slotSize*(13+1)))); texturesByName.insert(stringIconMap::value_type(L"cloth_1",new SimpleIcon(L"cloth_1",slotSize*2,slotSize*13,slotSize*(2+1),slotSize*(13+1)))); @@ -834,9 +834,9 @@ void PreStitchedTextureMap::loadUVs() texturesByName.insert(stringIconMap::value_type(L"quartzblock_side",new SimpleIcon(L"quartzblock_side",slotSize*11,slotSize*14,slotSize*(11+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"hopper_inside",new SimpleIcon(L"hopper_inside",slotSize*12,slotSize*14,slotSize*(12+1),slotSize*(14+1)))); texturesByName.insert(stringIconMap::value_type(L"lava",new SimpleIcon(L"lava",slotSize*13,slotSize*14,slotSize*(13+1),slotSize*(14+1)))); - texturesToAnimate.push_back(pair(L"lava",L"lava")); + texturesToAnimate.push_back(std::pair(L"lava",L"lava")); texturesByName.insert(stringIconMap::value_type(L"lava_flow",new SimpleIcon(L"lava_flow",slotSize*14,slotSize*14,slotSize*(14+2),slotSize*(14+2)))); - texturesToAnimate.push_back(pair(L"lava_flow",L"lava_flow")); + texturesToAnimate.push_back(std::pair(L"lava_flow",L"lava_flow")); texturesByName.insert(stringIconMap::value_type(L"destroy_0",new SimpleIcon(L"destroy_0",slotSize*0,slotSize*15,slotSize*(0+1),slotSize*(15+1)))); texturesByName.insert(stringIconMap::value_type(L"destroy_1",new SimpleIcon(L"destroy_1",slotSize*1,slotSize*15,slotSize*(1+1),slotSize*(15+1)))); texturesByName.insert(stringIconMap::value_type(L"destroy_2",new SimpleIcon(L"destroy_2",slotSize*2,slotSize*15,slotSize*(2+1),slotSize*(15+1)))); diff --git a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h index f86cfac7f..3d6cac29e 100644 --- a/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h +++ b/Minecraft.Client/Textures/Stitching/PreStitchedTextureMap.h @@ -30,7 +30,7 @@ private: Texture *stitchResult; std::vector animatedTextures; // = new ArrayList(); - std::vector > texturesToAnimate; + std::vector > texturesToAnimate; void loadUVs(); public: diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp index 8b10493a2..014b43eae 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp +++ b/Minecraft.Client/Textures/Stitching/StitchedTexture.cpp @@ -189,7 +189,7 @@ void StitchedTexture::cycleFrames() { if (frameOverride != NULL) { - pair current = frameOverride->at(frame); + std::pair current = frameOverride->at(frame); subFrame++; if (subFrame >= current.second) { diff --git a/Minecraft.Client/Textures/Stitching/StitchedTexture.h b/Minecraft.Client/Textures/Stitching/StitchedTexture.h index d1bbf29aa..edb3c3c05 100644 --- a/Minecraft.Client/Textures/Stitching/StitchedTexture.h +++ b/Minecraft.Client/Textures/Stitching/StitchedTexture.h @@ -14,7 +14,7 @@ protected: std::vector *frames; private: - typedef std::vector > intPairVector; + typedef std::vector > intPairVector; intPairVector *frameOverride; int flags; diff --git a/Minecraft.Client/Utils/ArchiveFile.cpp b/Minecraft.Client/Utils/ArchiveFile.cpp index ef75e26c6..8d2773b7b 100644 --- a/Minecraft.Client/Utils/ArchiveFile.cpp +++ b/Minecraft.Client/Utils/ArchiveFile.cpp @@ -24,7 +24,7 @@ void ArchiveFile::_readHeader(DataInputStream *dis) } else meta->isCompressed = false; - m_index.insert( pair(meta->filename,meta) ); + m_index.insert( std::pair(meta->filename,meta) ); } } diff --git a/Minecraft.Client/Utils/MemoryTracker.cpp b/Minecraft.Client/Utils/MemoryTracker.cpp index 4b5210f66..48a72578d 100644 --- a/Minecraft.Client/Utils/MemoryTracker.cpp +++ b/Minecraft.Client/Utils/MemoryTracker.cpp @@ -10,7 +10,7 @@ std::vector MemoryTracker::TEXTURE_IDS; int MemoryTracker::genLists(int count) { int id = glGenLists(count); - GL_LIST_IDS.insert( pair(id,count) ); + GL_LIST_IDS.insert( std::pair(id,count) ); return id; } diff --git a/Minecraft.Client/Utils/StringTable.cpp b/Minecraft.Client/Utils/StringTable.cpp index 94f3e2ce3..78e763129 100644 --- a/Minecraft.Client/Utils/StringTable.cpp +++ b/Minecraft.Client/Utils/StringTable.cpp @@ -17,13 +17,13 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) int versionNumber = dis.readInt(); int languagesCount = dis.readInt(); - std::vector< pair > langSizeMap; + std::vector< std::pair > langSizeMap; for(int i = 0; i < languagesCount; ++i) { std::wstring langId = dis.readUTF(); int langSize = dis.readInt(); - langSizeMap.push_back( std::vector< pair >::value_type(langId, langSize)); + langSizeMap.push_back( std::vector< std::pair >::value_type(langId, langSize)); } std::vector locales; diff --git a/Minecraft.Client/Utils/WstringLookup.cpp b/Minecraft.Client/Utils/WstringLookup.cpp index fa99e5008..57983dd51 100644 --- a/Minecraft.Client/Utils/WstringLookup.cpp +++ b/Minecraft.Client/Utils/WstringLookup.cpp @@ -21,8 +21,8 @@ UINT WstringLookup::lookup(std::wstring str) { if (str2int.find(str) == str2int.end()) { - pair p = - pair(str, numIDs); + std::pair p = + std::pair(str, numIDs); str2int.insert( p ); int2str.push_back( str ); diff --git a/Minecraft.World/Entities/Mobs/Villager.cpp b/Minecraft.World/Entities/Mobs/Villager.cpp index 457efce57..56d27a026 100644 --- a/Minecraft.World/Entities/Mobs/Villager.cpp +++ b/Minecraft.World/Entities/Mobs/Villager.cpp @@ -16,8 +16,8 @@ #include "../../../Minecraft.Client/Textures/Textures.h" #include "Villager.h" -std::unordered_map > Villager::MIN_MAX_VALUES; -std::unordered_map > Villager::MIN_MAX_PRICES; +std::unordered_map > Villager::MIN_MAX_VALUES; +std::unordered_map > Villager::MIN_MAX_PRICES; void Villager::_init(int profession) { @@ -553,71 +553,71 @@ void Villager::overrideOffers(MerchantRecipeList *recipeList) void Villager::staticCtor() { - MIN_MAX_VALUES[Item::coal_Id] = pair(16, 24); - MIN_MAX_VALUES[Item::ironIngot_Id] = pair(8, 10); - MIN_MAX_VALUES[Item::goldIngot_Id] = pair(8, 10); - MIN_MAX_VALUES[Item::diamond_Id] = pair(4, 6); - MIN_MAX_VALUES[Item::paper_Id] = pair(24, 36); - MIN_MAX_VALUES[Item::book_Id] = pair(11, 13); - //MIN_MAX_VALUES.insert(Item::writtenBook_Id, pair(1, 1)); - MIN_MAX_VALUES[Item::enderPearl_Id] = pair(3, 4); - MIN_MAX_VALUES[Item::eyeOfEnder_Id] = pair(2, 3); - MIN_MAX_VALUES[Item::porkChop_raw_Id] = pair(14, 18); - MIN_MAX_VALUES[Item::beef_raw_Id] = pair(14, 18); - MIN_MAX_VALUES[Item::chicken_raw_Id] = pair(14, 18); - MIN_MAX_VALUES[Item::fish_cooked_Id] = pair(9, 13); - MIN_MAX_VALUES[Item::seeds_wheat_Id] = pair(34, 48); - MIN_MAX_VALUES[Item::seeds_melon_Id] = pair(30, 38); - MIN_MAX_VALUES[Item::seeds_pumpkin_Id] = pair(30, 38); - MIN_MAX_VALUES[Item::wheat_Id] = pair(18, 22); - MIN_MAX_VALUES[Tile::cloth_Id] = pair(14, 22); - MIN_MAX_VALUES[Item::rotten_flesh_Id] = pair(36, 64); + MIN_MAX_VALUES[Item::coal_Id] = std::pair(16, 24); + MIN_MAX_VALUES[Item::ironIngot_Id] = std::pair(8, 10); + MIN_MAX_VALUES[Item::goldIngot_Id] = std::pair(8, 10); + MIN_MAX_VALUES[Item::diamond_Id] = std::pair(4, 6); + MIN_MAX_VALUES[Item::paper_Id] = std::pair(24, 36); + MIN_MAX_VALUES[Item::book_Id] = std::pair(11, 13); + //MIN_MAX_VALUES.insert(Item::writtenBook_Id, std::pair(1, 1)); + MIN_MAX_VALUES[Item::enderPearl_Id] = std::pair(3, 4); + MIN_MAX_VALUES[Item::eyeOfEnder_Id] = std::pair(2, 3); + MIN_MAX_VALUES[Item::porkChop_raw_Id] = std::pair(14, 18); + MIN_MAX_VALUES[Item::beef_raw_Id] = std::pair(14, 18); + MIN_MAX_VALUES[Item::chicken_raw_Id] = std::pair(14, 18); + MIN_MAX_VALUES[Item::fish_cooked_Id] = std::pair(9, 13); + MIN_MAX_VALUES[Item::seeds_wheat_Id] = std::pair(34, 48); + MIN_MAX_VALUES[Item::seeds_melon_Id] = std::pair(30, 38); + MIN_MAX_VALUES[Item::seeds_pumpkin_Id] = std::pair(30, 38); + MIN_MAX_VALUES[Item::wheat_Id] = std::pair(18, 22); + MIN_MAX_VALUES[Tile::cloth_Id] = std::pair(14, 22); + MIN_MAX_VALUES[Item::rotten_flesh_Id] = std::pair(36, 64); - MIN_MAX_PRICES[Item::flintAndSteel_Id] = pair(3, 4); - MIN_MAX_PRICES[Item::shears_Id] = pair(3, 4); - MIN_MAX_PRICES[Item::sword_iron_Id] = pair(7, 11); - MIN_MAX_PRICES[Item::sword_diamond_Id] = pair(12, 14); - MIN_MAX_PRICES[Item::hatchet_iron_Id] = pair(6, 8); - MIN_MAX_PRICES[Item::hatchet_diamond_Id] = pair(9, 12); - MIN_MAX_PRICES[Item::pickAxe_iron_Id] = pair(7, 9); - MIN_MAX_PRICES[Item::pickAxe_diamond_Id] = pair(10, 12); - MIN_MAX_PRICES[Item::shovel_iron_Id] = pair(4, 6); - MIN_MAX_PRICES[Item::shovel_diamond_Id] = pair(7, 8); - MIN_MAX_PRICES[Item::hoe_iron_Id] = pair(4, 6); - MIN_MAX_PRICES[Item::hoe_diamond_Id] = pair(7, 8); - MIN_MAX_PRICES[Item::boots_iron_Id] = pair(4, 6); - MIN_MAX_PRICES[Item::boots_diamond_Id] = pair(7, 8); - MIN_MAX_PRICES[Item::helmet_iron_Id] = pair(4, 6); - MIN_MAX_PRICES[Item::helmet_diamond_Id] = pair(7, 8); - MIN_MAX_PRICES[Item::chestplate_iron_Id] = pair(10, 14); - MIN_MAX_PRICES[Item::chestplate_diamond_Id] = pair(16, 19); - MIN_MAX_PRICES[Item::leggings_iron_Id] = pair(8, 10); - MIN_MAX_PRICES[Item::leggings_diamond_Id] = pair(11, 14); - MIN_MAX_PRICES[Item::boots_chain_Id] = pair(5, 7); - MIN_MAX_PRICES[Item::helmet_chain_Id] = pair(5, 7); - MIN_MAX_PRICES[Item::chestplate_chain_Id] = pair(11, 15); - MIN_MAX_PRICES[Item::leggings_chain_Id] = pair(9, 11); - MIN_MAX_PRICES[Item::bread_Id] = pair(-4, -2); - MIN_MAX_PRICES[Item::melon_Id] = pair(-8, -4); - MIN_MAX_PRICES[Item::apple_Id] = pair(-8, -4); - MIN_MAX_PRICES[Item::cookie_Id] = pair(-10, -7); - MIN_MAX_PRICES[Tile::glass_Id] = pair(-5, -3); - MIN_MAX_PRICES[Tile::bookshelf_Id] = pair(3, 4); - MIN_MAX_PRICES[Item::chestplate_cloth_Id] = pair(4, 5); - MIN_MAX_PRICES[Item::boots_cloth_Id] = pair(2, 4); - MIN_MAX_PRICES[Item::helmet_cloth_Id] = pair(2, 4); - MIN_MAX_PRICES[Item::leggings_cloth_Id] = pair(2, 4); - MIN_MAX_PRICES[Item::saddle_Id] = pair(6, 8); - MIN_MAX_PRICES[Item::expBottle_Id] = pair(-4, -1); - MIN_MAX_PRICES[Item::redStone_Id] = pair(-4, -1); - MIN_MAX_PRICES[Item::compass_Id] = pair(10, 12); - MIN_MAX_PRICES[Item::clock_Id] = pair(10, 12); - MIN_MAX_PRICES[Tile::lightGem_Id] = pair(-3, -1); - MIN_MAX_PRICES[Item::porkChop_cooked_Id] = pair(-7, -5); - MIN_MAX_PRICES[Item::beef_cooked_Id] = pair(-7, -5); - MIN_MAX_PRICES[Item::chicken_cooked_Id] = pair(-8, -6); - MIN_MAX_PRICES[Item::eyeOfEnder_Id] = pair(7, 11); - MIN_MAX_PRICES[Item::arrow_Id] = pair(-12, -8); + MIN_MAX_PRICES[Item::flintAndSteel_Id] = std::pair(3, 4); + MIN_MAX_PRICES[Item::shears_Id] = std::pair(3, 4); + MIN_MAX_PRICES[Item::sword_iron_Id] = std::pair(7, 11); + MIN_MAX_PRICES[Item::sword_diamond_Id] = std::pair(12, 14); + MIN_MAX_PRICES[Item::hatchet_iron_Id] = std::pair(6, 8); + MIN_MAX_PRICES[Item::hatchet_diamond_Id] = std::pair(9, 12); + MIN_MAX_PRICES[Item::pickAxe_iron_Id] = std::pair(7, 9); + MIN_MAX_PRICES[Item::pickAxe_diamond_Id] = std::pair(10, 12); + MIN_MAX_PRICES[Item::shovel_iron_Id] = std::pair(4, 6); + MIN_MAX_PRICES[Item::shovel_diamond_Id] = std::pair(7, 8); + MIN_MAX_PRICES[Item::hoe_iron_Id] = std::pair(4, 6); + MIN_MAX_PRICES[Item::hoe_diamond_Id] = std::pair(7, 8); + MIN_MAX_PRICES[Item::boots_iron_Id] = std::pair(4, 6); + MIN_MAX_PRICES[Item::boots_diamond_Id] = std::pair(7, 8); + MIN_MAX_PRICES[Item::helmet_iron_Id] = std::pair(4, 6); + MIN_MAX_PRICES[Item::helmet_diamond_Id] = std::pair(7, 8); + MIN_MAX_PRICES[Item::chestplate_iron_Id] = std::pair(10, 14); + MIN_MAX_PRICES[Item::chestplate_diamond_Id] = std::pair(16, 19); + MIN_MAX_PRICES[Item::leggings_iron_Id] = std::pair(8, 10); + MIN_MAX_PRICES[Item::leggings_diamond_Id] = std::pair(11, 14); + MIN_MAX_PRICES[Item::boots_chain_Id] = std::pair(5, 7); + MIN_MAX_PRICES[Item::helmet_chain_Id] = std::pair(5, 7); + MIN_MAX_PRICES[Item::chestplate_chain_Id] = std::pair(11, 15); + MIN_MAX_PRICES[Item::leggings_chain_Id] = std::pair(9, 11); + MIN_MAX_PRICES[Item::bread_Id] = std::pair(-4, -2); + MIN_MAX_PRICES[Item::melon_Id] = std::pair(-8, -4); + MIN_MAX_PRICES[Item::apple_Id] = std::pair(-8, -4); + MIN_MAX_PRICES[Item::cookie_Id] = std::pair(-10, -7); + MIN_MAX_PRICES[Tile::glass_Id] = std::pair(-5, -3); + MIN_MAX_PRICES[Tile::bookshelf_Id] = std::pair(3, 4); + MIN_MAX_PRICES[Item::chestplate_cloth_Id] = std::pair(4, 5); + MIN_MAX_PRICES[Item::boots_cloth_Id] = std::pair(2, 4); + MIN_MAX_PRICES[Item::helmet_cloth_Id] = std::pair(2, 4); + MIN_MAX_PRICES[Item::leggings_cloth_Id] = std::pair(2, 4); + MIN_MAX_PRICES[Item::saddle_Id] = std::pair(6, 8); + MIN_MAX_PRICES[Item::expBottle_Id] = std::pair(-4, -1); + MIN_MAX_PRICES[Item::redStone_Id] = std::pair(-4, -1); + MIN_MAX_PRICES[Item::compass_Id] = std::pair(10, 12); + MIN_MAX_PRICES[Item::clock_Id] = std::pair(10, 12); + MIN_MAX_PRICES[Tile::lightGem_Id] = std::pair(-3, -1); + MIN_MAX_PRICES[Item::porkChop_cooked_Id] = std::pair(-7, -5); + MIN_MAX_PRICES[Item::beef_cooked_Id] = std::pair(-7, -5); + MIN_MAX_PRICES[Item::chicken_cooked_Id] = std::pair(-8, -6); + MIN_MAX_PRICES[Item::eyeOfEnder_Id] = std::pair(7, 11); + MIN_MAX_PRICES[Item::arrow_Id] = std::pair(-12, -8); } /** @@ -648,7 +648,7 @@ int Villager::getTradeInValue(int itemId, Random *random) { return 1; } - pair minMax = it->second; + std::pair minMax = it->second; if (minMax.first >= minMax.second) { return minMax.first; @@ -693,7 +693,7 @@ int Villager::getPurchaseCost(int itemId, Random *random) { return 1; } - pair minMax = it->second; + std::pair minMax = it->second; if (minMax.first >= minMax.second) { return minMax.first; diff --git a/Minecraft.World/Entities/Mobs/Villager.h b/Minecraft.World/Entities/Mobs/Villager.h index bc0717375..16fe40d47 100644 --- a/Minecraft.World/Entities/Mobs/Villager.h +++ b/Minecraft.World/Entities/Mobs/Villager.h @@ -109,8 +109,8 @@ public: void overrideOffers(MerchantRecipeList *recipeList); private: - static std::unordered_map > MIN_MAX_VALUES; - static std::unordered_map > MIN_MAX_PRICES; + static std::unordered_map > MIN_MAX_VALUES; + static std::unordered_map > MIN_MAX_PRICES; public: static void staticCtor(); diff --git a/Minecraft.World/Items/PotionItem.cpp b/Minecraft.World/Items/PotionItem.cpp index 4a241f786..a832e9964 100644 --- a/Minecraft.World/Items/PotionItem.cpp +++ b/Minecraft.World/Items/PotionItem.cpp @@ -17,7 +17,7 @@ const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash"; const std::wstring PotionItem::CONTENTS_ICON = L"potion_contents"; // 4J Added -std::vector > PotionItem::s_uniquePotionValues; +std::vector > PotionItem::s_uniquePotionValues; PotionItem::PotionItem(int id) : Item(id) { @@ -327,7 +327,7 @@ Icon *PotionItem::getTexture(const std::wstring &name) // 4J Stu - Based loosely on a function that gets added in java much later on (1.3) -std::vector > *PotionItem::getUniquePotionValues() +std::vector > *PotionItem::getUniquePotionValues() { if (s_uniquePotionValues.empty()) { @@ -361,7 +361,7 @@ std::vector > *PotionItem::getUniquePotionValues() } if( toAdd ) { - s_uniquePotionValues.push_back(pair(effectsHashCode, brew) ); + s_uniquePotionValues.push_back(std::pair(effectsHashCode, brew) ); } } delete effects; diff --git a/Minecraft.World/Items/PotionItem.h b/Minecraft.World/Items/PotionItem.h index c09396c70..c620a812a 100644 --- a/Minecraft.World/Items/PotionItem.h +++ b/Minecraft.World/Items/PotionItem.h @@ -50,8 +50,8 @@ public: static Icon *getTexture(const std::wstring &name); // 4J Stu - Based loosely on a function that gets added in java much later on (1.3) - static std::vector > *getUniquePotionValues(); + static std::vector > *getUniquePotionValues(); private: // 4J Stu - Added to support function above, different from Java implementation - static std::vector > s_uniquePotionValues; + static std::vector > s_uniquePotionValues; }; \ No newline at end of file diff --git a/Minecraft.World/Stats/Stat.cpp b/Minecraft.World/Stats/Stat.cpp index ff44e3811..b36f0bea6 100644 --- a/Minecraft.World/Stats/Stat.cpp +++ b/Minecraft.World/Stats/Stat.cpp @@ -40,7 +40,7 @@ Stat *Stat::postConstruct() //} Stats::all->push_back(this); - pair id1(id,this); + std::pair id1(id,this); #ifdef __PS3__ Stats::statsById->emplace(id1 );// assert(0); // MGH - TODO - FIX - find out where this move function comes from #else diff --git a/Minecraft.World/WorldGen/Structures/Village.cpp b/Minecraft.World/WorldGen/Structures/Village.cpp index c2fb9a2f9..10d8a5cf0 100644 --- a/Minecraft.World/WorldGen/Structures/Village.cpp +++ b/Minecraft.World/WorldGen/Structures/Village.cpp @@ -394,7 +394,7 @@ int Village::modifyStanding(const std::wstring &playerName, int delta) { int current = getStanding(playerName); int newValue = Mth::clamp(current + delta, -30, 10); - playerStanding.insert(pair(playerName, newValue)); + playerStanding.insert(std::pair(playerName, newValue)); return newValue; } @@ -441,7 +441,7 @@ void Village::readAdditionalSaveData(CompoundTag *tag) for (int i = 0; i < playerTags->size(); i++) { CompoundTag *pTag = playerTags->get(i); - playerStanding.insert(pair(pTag->getString(L"Name"), pTag->getInt(L"S"))); + playerStanding.insert(std::pair(pTag->getString(L"Name"), pTag->getInt(L"S"))); } }