From 36daeebed0795a7d9dfc9c7780076bb89e78a7cc Mon Sep 17 00:00:00 2001 From: Mohamed Ashraf Date: Tue, 3 Mar 2026 01:35:55 +0400 Subject: [PATCH] MORE --- Minecraft.World/EnchantmentContainer.cpp | 3 ++- Minecraft.World/Fireball.cpp | 3 ++- Minecraft.World/Inventory.cpp | 1 + Minecraft.World/Monster.cpp | 4 ++-- Minecraft.World/Player.cpp | 15 ++++++++------- Minecraft.World/PlayerEnderChestContainer.cpp | 3 ++- Minecraft.World/RepairMenu.cpp | 4 +++- Minecraft.World/Silverfish.cpp | 3 ++- Minecraft.World/Villager.cpp | 1 + 9 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Minecraft.World/EnchantmentContainer.cpp b/Minecraft.World/EnchantmentContainer.cpp index 6e5541fb3..bdaa8bdcd 100644 --- a/Minecraft.World/EnchantmentContainer.cpp +++ b/Minecraft.World/EnchantmentContainer.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.inventory.h" #include "EnchantmentContainer.h" +#include "../Minecraft.Client/Windows64Media/strings.h" EnchantmentContainer::EnchantmentContainer(EnchantmentMenu *menu) : SimpleContainer(IDS_ENCHANT, 1), m_menu( menu ) { @@ -15,4 +16,4 @@ void EnchantmentContainer::setChanged() { SimpleContainer::setChanged(); m_menu->slotsChanged(); // Remove this param as it's not needed -} \ No newline at end of file +} diff --git a/Minecraft.World/Fireball.cpp b/Minecraft.World/Fireball.cpp index 46be68f74..d8be2d3b0 100644 --- a/Minecraft.World/Fireball.cpp +++ b/Minecraft.World/Fireball.cpp @@ -9,6 +9,7 @@ #include "Fireball.h" #include "net.minecraft.world.level.dimension.h" #include "SharedConstants.h" +#include "../Minecraft.Client/Windows64/Windows64_App.h" // 4J - added common ctor code. @@ -412,4 +413,4 @@ int Fireball::getIcon() ePARTICLE_TYPE Fireball::getTrailParticleType() { return eParticleType_smoke; -} \ No newline at end of file +} diff --git a/Minecraft.World/Inventory.cpp b/Minecraft.World/Inventory.cpp index 8ef3f085e..35d39c3ec 100644 --- a/Minecraft.World/Inventory.cpp +++ b/Minecraft.World/Inventory.cpp @@ -6,6 +6,7 @@ #include "net.minecraft.stats.h" #include "Material.h" #include "Inventory.h" +#include "../Minecraft.Client/Windows64Media/strings.h" const int Inventory::POP_TIME_DURATION = 5; const int Inventory::MAX_INVENTORY_STACK_SIZE = 64; diff --git a/Minecraft.World/Monster.cpp b/Minecraft.World/Monster.cpp index f552089c0..25ec4a5d6 100644 --- a/Minecraft.World/Monster.cpp +++ b/Minecraft.World/Monster.cpp @@ -7,7 +7,7 @@ #include "net.minecraft.world.effect.h" #include "net.minecraft.world.item.enchantment.h" #include "Monster.h" - +#include "../Minecraft.Client/Windows64/Windows64_App.h" #include "../Minecraft.Client/Minecraft.h" @@ -156,4 +156,4 @@ bool Monster::canSpawn() // 4J Stu // Fix for #8265 - AI: Monsters will flash briefly on the screen around Monster Spawners when the game settings are set to Peaceful. return isDarkEnoughToSpawn() && PathfinderMob::canSpawn() && level->difficulty > Difficulty::PEACEFUL; -} \ No newline at end of file +} diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index 3883c9e92..1c89c8582 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -32,9 +32,10 @@ #include "Inventory.h" #include "Player.h" #include "ParticleTypes.h" - +#include +#include #include "../Minecraft.Client/Textures.h" - +#include #include "../Minecraft.Client/LocalPlayer.h" #include "../Minecraft.Client/HumanoidModel.h" #include "SoundTypes.h" @@ -2555,14 +2556,14 @@ int Player::getTexture() } } -int Player::hash_fnct(const shared_ptr k) +int Player::hash_fnct(const std::shared_ptr k) { - // TODO 4J Stu - Should we just be using the pointers and hashing them? + // Hashing the player's name based on platform #ifdef __PS3__ - return (int)boost::hash_value( k->name ); // 4J Stu - Names are completely unique? + return (int)boost::hash_value(k->name); #else - return (int)std::hash_value( k->name ); // 4J Stu - Names are completely unique? -#endif //__PS3__ + return (int)std::hash()(k->name); +#endif // __PS3__ } bool Player::eq_test(const shared_ptr x, const shared_ptr y) diff --git a/Minecraft.World/PlayerEnderChestContainer.cpp b/Minecraft.World/PlayerEnderChestContainer.cpp index 466d97102..b1095bfad 100644 --- a/Minecraft.World/PlayerEnderChestContainer.cpp +++ b/Minecraft.World/PlayerEnderChestContainer.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.tile.entity.h" #include "PlayerEnderChestContainer.h" +#include "../Minecraft.Client/Windows64Media/strings.h" PlayerEnderChestContainer::PlayerEnderChestContainer() : SimpleContainer(IDS_TILE_ENDERCHEST, 9 * 3) { @@ -69,4 +70,4 @@ void PlayerEnderChestContainer::stopOpen() } SimpleContainer::stopOpen(); activeChest = nullptr; -} \ No newline at end of file +} diff --git a/Minecraft.World/RepairMenu.cpp b/Minecraft.World/RepairMenu.cpp index d246b73fb..1655e7d16 100644 --- a/Minecraft.World/RepairMenu.cpp +++ b/Minecraft.World/RepairMenu.cpp @@ -5,6 +5,8 @@ #include "net.minecraft.world.item.h" #include "net.minecraft.world.item.enchantment.h" #include "RepairMenu.h" +#include "../Minecraft.Client/Windows64Media/strings.h" +#include "../Minecraft.Client/Windows64/Windows64_App.h" RepairMenu::RepairMenu(shared_ptr inventory, Level *level, int xt, int yt, int zt, shared_ptr player) { @@ -400,4 +402,4 @@ void RepairMenu::setItemName(const wstring &name) getSlot(RESULT_SLOT)->getItem()->setHoverName(itemName); } createResult(); -} \ No newline at end of file +} diff --git a/Minecraft.World/Silverfish.cpp b/Minecraft.World/Silverfish.cpp index c0104d68b..a235492e7 100644 --- a/Minecraft.World/Silverfish.cpp +++ b/Minecraft.World/Silverfish.cpp @@ -7,6 +7,7 @@ #include "../Minecraft.Client/Textures.h" #include "Silverfish.h" #include "SoundTypes.h" +#include "../Minecraft.Client/Windows64/Windows64_App.h" @@ -208,4 +209,4 @@ bool Silverfish::canSpawn() MobType Silverfish::getMobType() { return ARTHROPOD; -} \ No newline at end of file +} diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index 99d38a6c2..1bdeb5585 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -15,6 +15,7 @@ #include "net.minecraft.world.level.h" #include "../Minecraft.Client/Textures.h" #include "Villager.h" +#include "../Minecraft.Client/Windows64Media/strings.h" unordered_map > Villager::MIN_MAX_VALUES; unordered_map > Villager::MIN_MAX_PRICES;