diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 70d3e9b2..52f4c043 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -103,7 +103,7 @@ public: */ static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user #else - static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user + static const int GAME_DEFINED_PROFILE_DATA_BYTES = 3*972; // per user #endif unsigned int uiGameDefinedDataChangedBitmask; diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index 1699780c..bd58d398 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -1063,7 +1063,7 @@ void LocalPlayer::awardStat(Stat *stat, byteArray param) // AWARD : Porkchop, cook and eat a porkchop. { Stat *cookPorkchop, *eatPorkchop; - cookPorkchop = GenericStats::itemsCrafted(Item::porkChop_cooked_Id); + cookPorkchop = GenericStats::itemsSmelted(Item::porkChop_cooked_Id); eatPorkchop = GenericStats::itemsUsed(Item::porkChop_cooked_Id); if ( stat == cookPorkchop || stat == eatPorkchop ) diff --git a/Minecraft.World/Achievements.cpp b/Minecraft.World/Achievements.cpp index 913292d0..c130c032 100644 --- a/Minecraft.World/Achievements.cpp +++ b/Minecraft.World/Achievements.cpp @@ -120,7 +120,7 @@ void Achievements::staticCtor() #ifdef _EXTENDED_ACHIEVEMENTS Achievements::eatPorkChop = (new Achievement(eAward_eatPorkChop, L"eatPorkChop", 0, 0, Tile::treeTrunk, (Achievement *) buildSword))->setAwardLocallyOnly()->postConstruct(); #else - Achievements::eatPorkChop = (new Achievement(eAward_eatPorkChop, L"eatPorkChop", 0, 0, Tile::treeTrunk, (Achievement *) buildSword, "034", IDS_ACHIEVE_NAME_EAT_PORKCHOP, IDS_ACHIEVE_DESC_EAT_PORKCHOP))->postConstruct(); + Achievements::eatPorkChop = (new Achievement(eAward_eatPorkChop, L"eatPorkChop", 0, 0, Tile::treeTrunk, (Achievement *) buildSword, "034", IDS_ACHIEVE_NAME_EAT_PORKCHOP, IDS_ACHIEVE_DESC_EAT_PORKCHOP))->setAwardLocallyOnly()->postConstruct(); #endif Achievements::play100Days = (new Achievement(eAward_play100Days, L"play100Days", 0, 0, Tile::treeTrunk, (Achievement *) buildSword, "035", IDS_ACHIEVE_NAME_PLAY_100_DAYS, IDS_ACHIEVE_DESC_PLAY_100_DAYS))->setAwardLocallyOnly()->postConstruct(); Achievements::arrowKillCreeper = (new Achievement(eAward_arrowKillCreeper, L"arrowKillCreeper", 0, 0, Tile::treeTrunk, (Achievement *) buildSword, "036", IDS_ACHIEVE_NAME_ARROW_KILL_CREEPER, IDS_ACHIEVE_DESC_ARROW_KILL_CREEPER))->postConstruct(); diff --git a/Minecraft.World/CommonStats.cpp b/Minecraft.World/CommonStats.cpp index 7885d50a..44d6577c 100644 --- a/Minecraft.World/CommonStats.cpp +++ b/Minecraft.World/CommonStats.cpp @@ -112,6 +112,7 @@ Stat *CommonStats::get_itemsUsed(int itemId) if (itemId == Item::porkChop_cooked_Id) return Stats::blocksPlaced[itemId]; #endif if (itemId == Item::porkChop_cooked_Id) return Stats::blocksPlaced[itemId]; + else return nullptr; //return nullptr; } diff --git a/Minecraft.World/FurnaceResultSlot.cpp b/Minecraft.World/FurnaceResultSlot.cpp index 84e0b747..4ddcc726 100644 --- a/Minecraft.World/FurnaceResultSlot.cpp +++ b/Minecraft.World/FurnaceResultSlot.cpp @@ -77,7 +77,7 @@ void FurnaceResultSlot::checkTakeAchievements(shared_ptr carried) } } -#ifdef _DURANGO + if (!player->level->isClientSide && removeCount > 0) { player->awardStat( @@ -85,11 +85,9 @@ void FurnaceResultSlot::checkTakeAchievements(shared_ptr carried) GenericStats::param_itemsSmelted(carried->id, carried->getAuxValue(), removeCount) ); } -#else if (carried->id == Item::ironIngot_Id) player->awardStat(GenericStats::acquireIron(), GenericStats::param_acquireIron()); if (carried->id == Item::fish_cooked_Id) player->awardStat(GenericStats::cookFish(), GenericStats::param_cookFish()); //if (carried->id == Item::porkChop_cooked_Id) GenericStats::itemsCrafted(Item::porkChop_cooked_Id); -#endif removeCount = 0; } diff --git a/Minecraft.World/GenericStats.cpp b/Minecraft.World/GenericStats.cpp index eaea9eb4..d507c675 100644 --- a/Minecraft.World/GenericStats.cpp +++ b/Minecraft.World/GenericStats.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Monster.h" - +#include "Item.h" #include "GenericStats.h" GenericStats *GenericStats::instance = nullptr; @@ -835,7 +835,10 @@ byteArray GenericStats::param_itemsSmelted(int id, int aux, int count) byteArray GenericStats::param_itemsUsed(shared_ptr plr, shared_ptr itm) { - if ( (plr != nullptr) && (itm != nullptr) ) return instance->getParam_itemsUsed(plr, itm); + if ((plr != nullptr) && (itm != nullptr)) { + if (itm->id == Item::porkChop_cooked_Id) return instance->param_eatPorkChop(); + return instance->getParam_itemsUsed(plr, itm); + } else return instance->getParam_noArgs(); } diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index cec1a45e..8dd4930a 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -2623,7 +2623,7 @@ void Player::startUsingItem(shared_ptr instance, int duration) { setUsingItemFlag(true); } - + //if (GenericStats::itemsUsed(instance->getItem()->id)->id < 0) return; // 4J-JEV, hook for ItemUsed event, and ironbelly achievement. awardStat(GenericStats::itemsUsed(instance->getItem()->id), GenericStats::param_itemsUsed(dynamic_pointer_cast(shared_from_this()),instance)); diff --git a/Minecraft.World/Stat.cpp b/Minecraft.World/Stat.cpp index 97a655c7..686ff671 100644 --- a/Minecraft.World/Stat.cpp +++ b/Minecraft.World/Stat.cpp @@ -16,12 +16,12 @@ void Stat::_init() awardLocallyOnly = false; } -Stat::Stat(int id, const wstring& name, StatFormatter *formatter) : id(id), name(name), formatter(formatter) +Stat::Stat(int id, const wstring& name1, StatFormatter *formatter) : id(id), name(name1), formatter(formatter) { _init(); } -Stat::Stat(int id, const wstring& name) : id(id), name(name), formatter(defaultFormatter) +Stat::Stat(int id, const wstring& name1) : id(id), name(name1), formatter(defaultFormatter) { _init(); } diff --git a/Minecraft.World/Stats.cpp b/Minecraft.World/Stats.cpp index 71e211d1..662621da 100644 --- a/Minecraft.World/Stats.cpp +++ b/Minecraft.World/Stats.cpp @@ -528,8 +528,8 @@ void Stats::buildAdditionalStats() generalStat->postConstruct(); } - biomesVisisted = StatArray(23); - for (unsigned int i = 0; i < 23; i++) + biomesVisisted = StatArray(170); + for (unsigned int i = 0; i < 170; i++) { generalStat = new GeneralStat(offset++, L"biomesVisited." + std::to_wstring(i)); generalStats->push_back(generalStat);