mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 15:43:37 +00:00
27 lines
984 B
C++
27 lines
984 B
C++
#include "../../Minecraft.World/Platform/stdafx.h"
|
|
#include "../../Minecraft.Client/Minecraft.h"
|
|
#include "../../Minecraft.Client/Player/LocalPlayer.h"
|
|
#include "../../Minecraft.Client/GameState/StatsCounter.h"
|
|
#include "../../Minecraft.World/Headers/net.minecraft.stats.h"
|
|
#include "StatTask.h"
|
|
|
|
StatTask::StatTask(Tutorial* tutorial, int descriptionId,
|
|
bool enablePreCompletion, Stat* stat, int variance /*= 1*/)
|
|
: TutorialTask(tutorial, descriptionId, enablePreCompletion, NULL) {
|
|
this->stat = stat;
|
|
|
|
Minecraft* minecraft = Minecraft::GetInstance();
|
|
targetValue =
|
|
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) +
|
|
variance;
|
|
}
|
|
|
|
bool StatTask::isCompleted() {
|
|
if (bIsCompleted) return true;
|
|
|
|
Minecraft* minecraft = Minecraft::GetInstance();
|
|
bIsCompleted =
|
|
minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue(stat) >=
|
|
(unsigned int)targetValue;
|
|
return bIsCompleted;
|
|
} |