4 #include "../Entities/Boat.h" 5 #include "../LineBlockTracer.h" 26 int a_BlockX,
int a_BlockY,
int a_BlockZ,
eBlockFace a_BlockFace
35 public cBlockTracer::cCallbacks
46 virtual bool OnNextBlock(
int a_CBBlockX,
int a_CBBlockY,
int a_CBBlockZ,
BLOCKTYPE a_CBBlockType,
NIBBLETYPE a_CBBlockMeta,
eBlockFace a_CBEntryFace)
override 50 m_Pos.
Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ);
62 Tracer.
Trace(Start.x, Start.y, Start.z, End.x, End.y, End.z);
64 if (!Callbacks.m_HasFound)
69 auto x = Callbacks.m_Pos.x;
70 auto y = Callbacks.m_Pos.y;
71 auto z = Callbacks.m_Pos.z;
BLOCKTYPE GetBlock(Vector3i a_BlockPos)
Returns the block type at the specified position.
bool IsBlockWater(BLOCKTYPE a_BlockType)
unsigned char BLOCKTYPE
The datatype used by blockdata.
bool RemoveOneEquippedItem(void)
Removes one item out of the currently equipped item stack, returns true if successful, false if empty-handed.
virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cBlockPluginInterface &a_PluginInterface, const cItem &a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
Called when the player tries to use the item (right mouse button).
const cItem & GetEquippedItem(void) const
void Set(T a_x, T a_y, T a_z)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
UInt32 SpawnBoat(double a_X, double a_Y, double a_Z, cBoat::eMaterial a_Material)
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld...
Vector3d GetLookVector(void) const
static eMaterial ItemToMaterial(const cItem &a_Item)
Returns the eMaterial that should be used for a boat created from the specified item.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
bool Trace(double a_StartX, double a_StartY, double a_StartZ, double a_EndX, double a_EndY, double a_EndZ)
Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits...
cItemBoatHandler(int a_ItemType)
Vector3d GetEyePosition(void) const
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
std::enable_if< std::is_arithmetic< T >::value, C >::type FloorC(T a_Value)
Floors a value, then casts it to C (an int by default)
cInventory & GetInventory(void)
static const UInt32 INVALID_ID
Special ID that is considered an "invalid value", signifying no entity.