the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 40 lines 1.4 kB view raw
1#include "stdafx.h" 2#include "..\..\..\Minecraft.World\Entity.h" 3#include "..\..\..\Minecraft.World\Level.h" 4#include "..\..\..\Minecraft.World\ItemInstance.h" 5#include "UseTileTask.h" 6 7UseTileTask::UseTileTask(const int tileId, int x, int y, int z, Tutorial *tutorial, int descriptionId, 8 bool enablePreCompletion, vector<TutorialConstraint *> *inConstraints, bool bShowMinimumTime, bool bAllowFade, bool bTaskReminders) 9 : TutorialTask( tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, bTaskReminders ), 10 x( x ), y( y ), z( z ), tileId( tileId ) 11{ 12 useLocation = true; 13} 14 15UseTileTask::UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId, 16 bool enablePreCompletion, vector<TutorialConstraint *> *inConstraints, bool bShowMinimumTime, bool bAllowFade, bool bTaskReminders) 17 : TutorialTask( tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, bTaskReminders ), 18 tileId( tileId ) 19{ 20 useLocation = false; 21} 22 23bool UseTileTask::isCompleted() 24{ 25 return bIsCompleted; 26} 27 28void UseTileTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly) 29{ 30 if(bTestUseOnly) return; 31 32 if( !enablePreCompletion && !bHasBeenActivated) return; 33 34 if( !useLocation || ( x == this->x && y == this->y && z == this->z ) ) 35 { 36 int t = level->getTile(x, y, z); 37 if( t == tileId ) 38 bIsCompleted = true; 39 } 40}