mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-25 07:26:13 +00:00
funny
This commit is contained in:
25
Common/Tutorial/StatTask.cpp
Normal file
25
Common/Tutorial/StatTask.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user