the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 35 lines 679 B view raw
1#include "stdafx.h" 2#include "net.minecraft.world.entity.h" 3#include "net.minecraft.world.level.tile.h" 4#include "OpenDoorGoal.h" 5 6OpenDoorGoal::OpenDoorGoal(Mob *mob, bool closeDoorAfter) : DoorInteractGoal(mob) 7{ 8 this->mob = mob; 9 closeDoor = closeDoorAfter; 10} 11 12bool OpenDoorGoal::canContinueToUse() 13{ 14 return closeDoor && forgetTime > 0 && DoorInteractGoal::canContinueToUse(); 15} 16 17void OpenDoorGoal::start() 18{ 19 forgetTime = 20; 20 doorTile->setOpen(mob->level, doorX, doorY, doorZ, true); 21} 22 23void OpenDoorGoal::stop() 24{ 25 if (closeDoor) 26 { 27 doorTile->setOpen(mob->level, doorX, doorY, doorZ, false); 28 } 29} 30 31void OpenDoorGoal::tick() 32{ 33 --forgetTime; 34 DoorInteractGoal::tick(); 35}