mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-25 11:53:36 +00:00
25 lines
885 B
C++
25 lines
885 B
C++
#include "../../../../Minecraft.World/Build/stdafx.h"
|
|
#include "../../../Minecraft.h"
|
|
#include "../../../Player/LocalPlayer.h"
|
|
#include "../../../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;
|
|
} |