How to use cLineBlockTracer in cpp? I'm currently working on boats and I noticed that you can only spawn boats by looking at a block not at water. I'm currently using
Wait I think I got it.
Yes I got it. The example in World.cpp was a little outdated.
class cLineBlockTracer : public cBlockTracer::cCallbacks { public: Vector3d Pos; virtual bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override { if (a_BlockType != E_BLOCK_AIR) { Pos = Vector3d(a_BlockX, a_BlockY, a_BlockZ); return true; } return false } } Callbacks;but I get these errors:
Code:
1>g:\mcserver\nieuwste versie\trunk\src\items\ItemBoat.h(44) : error C3668: 'cItemBoatHandler::OnItemUse::cLineBlockTracer::OnNextBlock' : method with override specifier 'override' did not override any base class methods
1>g:\mcserver\nieuwste versie\trunk\src\items\ItemBoat.h(49) : error C2259: 'cItemBoatHandler::OnItemUse::cLineBlockTracer' : cannot instantiate abstract class
1> due to following members:
1> 'bool cBlockTracer::cCallbacks::OnNextBlock(int,int,int,BLOCKTYPE,NIBBLETYPE,char)' : is abstract
1> g:\mcserver\nieuwste versie\trunk\src\BlockTracer.h(34) : see declaration of 'cBlockTracer::cCallbacks::OnNextBlock'
Wait I think I got it.
Yes I got it. The example in World.cpp was a little outdated.