diff options
Diffstat (limited to 'src/Bindings/ManualBindings_World.cpp')
-rw-r--r-- | src/Bindings/ManualBindings_World.cpp | 595 |
1 files changed, 234 insertions, 361 deletions
diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp index 7713b8823..6d2a3afcf 100644 --- a/src/Bindings/ManualBindings_World.cpp +++ b/src/Bindings/ManualBindings_World.cpp @@ -53,8 +53,7 @@ static bool CheckParamVectorOr3Numbers(cLuaState & L, const char * a_VectorName, /** Get a vector from the stack, which may be represented in lua as either a `Vector3<T>` or 3 numbers */ -template <typename T> -static bool GetStackVectorOr3Numbers(cLuaState & L, int a_Index, Vector3<T> & a_Return) +template <typename T> static bool GetStackVectorOr3Numbers(cLuaState & L, int a_Index, Vector3<T> & a_Return) { if (L.GetStackValue(a_Index, a_Return)) { @@ -68,19 +67,14 @@ static bool GetStackVectorOr3Numbers(cLuaState & L, int a_Index, Vector3<T> & a_ /** Template for the bindings for the DoWithXYZAt(X, Y, Z) functions that don't need to check their coords. */ -template <class BlockEntityType, BLOCKTYPE... BlockTypes> -static int DoWithBlockEntityAt(lua_State * tolua_S) +template <class BlockEntityType, BLOCKTYPE... BlockTypes> static int DoWithBlockEntityAt(lua_State * tolua_S) { cLuaState L(tolua_S); int OffsetIndex; // Check params: - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamFunction(OffsetIndex) || - !L.CheckParamEnd(OffsetIndex + 1) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamFunction(OffsetIndex) || !L.CheckParamEnd(OffsetIndex + 1)) { return 0; } @@ -90,11 +84,8 @@ static int DoWithBlockEntityAt(lua_State * tolua_S) cLuaState::cRef FnRef; // Get parameters: - if ( - !L.GetStackValues(1, Self) || - !GetStackVectorOr3Numbers(L, 2, Position) || - !L.GetStackValues(OffsetIndex, FnRef) - ) + if (!L.GetStackValues(1, Self) || !GetStackVectorOr3Numbers(L, 2, Position) || + !L.GetStackValues(OffsetIndex, FnRef)) { return 0; } @@ -105,24 +96,29 @@ static int DoWithBlockEntityAt(lua_State * tolua_S) } if (!FnRef.IsValid()) { - return L.ApiParamError(fmt::format(FMT_STRING("Expected a valid callback function for parameter {}"), OffsetIndex)); + return L.ApiParamError( + fmt::format(FMT_STRING("Expected a valid callback function for parameter {}"), OffsetIndex) + ); } // Call the DoWith function: - bool res = Self->DoWithBlockEntityAt(Position, [&L, &FnRef](cBlockEntity & a_BlockEntity) - { - if constexpr (sizeof...(BlockTypes) != 0) + bool res = Self->DoWithBlockEntityAt( + Position, + [&L, &FnRef](cBlockEntity & a_BlockEntity) { - if (((a_BlockEntity.GetBlockType() != BlockTypes) && ...)) + if constexpr (sizeof...(BlockTypes) != 0) { - return false; + if (((a_BlockEntity.GetBlockType() != BlockTypes) && ...)) + { + return false; + } } - } - bool ret = false; - L.Call(FnRef, static_cast<BlockEntityType *>(&a_BlockEntity), cLuaState::Return, ret); - return ret; - }); + bool ret = false; + L.Call(FnRef, static_cast<BlockEntityType *>(&a_BlockEntity), cLuaState::Return, ret); + return ret; + } + ); // Push the result as the return value: L.Push(res); @@ -133,21 +129,13 @@ static int DoWithBlockEntityAt(lua_State * tolua_S) -template < - class Ty1, - class Ty2, - bool (Ty1::*ForEachFn)(const cBoundingBox &, cFunctionRef<bool(Ty2 &)>) -> +template <class Ty1, class Ty2, bool (Ty1::*ForEachFn)(const cBoundingBox &, cFunctionRef<bool(Ty2 &)>)> static int ForEachInBox(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamUserType(2, "cBoundingBox") || - !L.CheckParamFunction(3) || - !L.CheckParamEnd(4) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamUserType(2, "cBoundingBox") || !L.CheckParamFunction(3) || + !L.CheckParamEnd(4)) { return 0; } @@ -159,14 +147,18 @@ static int ForEachInBox(lua_State * tolua_S) L.GetStackValues(1, Self, Box, FnRef); if ((Self == nullptr) || (Box == nullptr)) { - return L.ApiParamError(fmt::format(FMT_STRING("Invalid world ({}) or boundingbox ({})"), fmt::ptr(Self), fmt::ptr(Box))); + return L.ApiParamError( + fmt::format(FMT_STRING("Invalid world ({}) or boundingbox ({})"), fmt::ptr(Self), fmt::ptr(Box)) + ); } if (!FnRef.IsValid()) { return L.ApiParamError("Expected a valid callback function for parameter #2"); } - bool res = (Self->*ForEachFn)(*Box, [&](Ty2 & a_Item) + bool res = (Self->*ForEachFn)( + *Box, + [&](Ty2 & a_Item) { bool ret = false; if (!L.Call(FnRef, &a_Item, cLuaState::Return, ret)) @@ -189,17 +181,11 @@ static int ForEachInBox(lua_State * tolua_S) -template <class BlockEntityType, BLOCKTYPE... BlockTypes> -static int ForEachBlockEntityInChunk(lua_State * tolua_S) +template <class BlockEntityType, BLOCKTYPE... BlockTypes> static int ForEachBlockEntityInChunk(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamNumber(2, 3) || - !L.CheckParamFunction(4) || - !L.CheckParamEnd(5) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamNumber(2, 3) || !L.CheckParamFunction(4) || !L.CheckParamEnd(5)) { return 0; } @@ -220,20 +206,24 @@ static int ForEachBlockEntityInChunk(lua_State * tolua_S) } // Call the ForEach function: - bool res = Self->ForEachBlockEntityInChunk(ChunkX, ChunkZ, [&L, &FnRef](cBlockEntity & a_BlockEntity) - { - if constexpr (sizeof...(BlockTypes) != 0) + bool res = Self->ForEachBlockEntityInChunk( + ChunkX, + ChunkZ, + [&L, &FnRef](cBlockEntity & a_BlockEntity) { - if (((a_BlockEntity.GetBlockType() != BlockTypes) && ...)) + if constexpr (sizeof...(BlockTypes) != 0) { - return false; + if (((a_BlockEntity.GetBlockType() != BlockTypes) && ...)) + { + return false; + } } - } - bool ret = false; - L.Call(FnRef, static_cast<BlockEntityType *>(&a_BlockEntity), cLuaState::Return, ret); - return ret; - }); + bool ret = false; + L.Call(FnRef, static_cast<BlockEntityType *>(&a_BlockEntity), cLuaState::Return, ret); + return ret; + } + ); // Push the result as the return value: L.Push(res); @@ -247,18 +237,17 @@ static int ForEachBlockEntityInChunk(lua_State * tolua_S) static int tolua_cWorld_BroadcastBlockAction(lua_State * tolua_S) { /* Function signature: - void BroadcastBlockAction(number a_BlockX, number a_BlockY, number a_BlockZ, number a_number1, number a_number2, number a_BlockType, cClientHandle a_Exclude) + void BroadcastBlockAction(number a_BlockX, number a_BlockY, number a_BlockZ, number a_number1, number a_number2, + number a_BlockType, cClientHandle a_Exclude) --or-- - void BroadcastBlockAction(Vector3<int> a_BlockPos, number a_Byte1, number a_Byte2, number a_BlockType, cClientHandle a_Exclude) + void BroadcastBlockAction(Vector3<int> a_BlockPos, number a_Byte1, number a_Byte2, number a_BlockType, cClientHandle + a_Exclude) */ cLuaState L(tolua_S); int Byte1Index; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, Byte1Index) || - !L.CheckParamNumber(Byte1Index, Byte1Index + 2) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, Byte1Index) || + !L.CheckParamNumber(Byte1Index, Byte1Index + 2)) { return 0; } @@ -266,7 +255,8 @@ static int tolua_cWorld_BroadcastBlockAction(lua_State * tolua_S) if (Byte1Index != 3) // Not the vector overload { L.LogStackTrace(); - LOGWARN("BroadcastBlockAction with 3 position arguments is deprecated, use vector-parametered version instead."); + LOGWARN("BroadcastBlockAction with 3 position arguments is deprecated, use vector-parametered version instead." + ); } // Read the params: @@ -276,11 +266,8 @@ static int tolua_cWorld_BroadcastBlockAction(lua_State * tolua_S) BLOCKTYPE BlockType; const cClientHandle * Exclude = nullptr; - if ( - !L.GetStackValues(1, Self) || - !GetStackVectorOr3Numbers(L, 2, BlockPos) || - !L.GetStackValues(Byte1Index, Byte1, Byte2, BlockType) - ) + if (!L.GetStackValues(1, Self) || !GetStackVectorOr3Numbers(L, 2, BlockPos) || + !L.GetStackValues(Byte1Index, Byte1, Byte2, BlockType)) { return 0; } @@ -299,18 +286,16 @@ static int tolua_cWorld_BroadcastBlockAction(lua_State * tolua_S) static int tolua_cWorld_BroadcastSoundEffect(lua_State * tolua_S) { /* Function signature: - void BroadcastSoundEffect(string a_SoundName, number a_X, number a_Y, number a_Z, number a_Volume, number a_Pitch, [cClientHandle * a_Exclude]) + void BroadcastSoundEffect(string a_SoundName, number a_X, number a_Y, number a_Z, number a_Volume, number a_Pitch, + [cClientHandle * a_Exclude]) --or-- void BroadcastSoundEffect(string a_SoundName, Vector3d, number a_Volume, number a_Pitch, [cClientHandle a_Exclude]) */ cLuaState L(tolua_S); int VolumeIndex; - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamString(2) || + if (!L.CheckParamSelf("cWorld") || !L.CheckParamString(2) || !CheckParamVectorOr3Numbers(L, "Vector3<double>", 3, VolumeIndex) || - !L.CheckParamNumber(VolumeIndex, VolumeIndex + 1) - ) + !L.CheckParamNumber(VolumeIndex, VolumeIndex + 1)) { return 0; } @@ -318,7 +303,8 @@ static int tolua_cWorld_BroadcastSoundEffect(lua_State * tolua_S) if (VolumeIndex != 4) // Not the vector overload { L.LogStackTrace(); - LOGWARN("BroadcastSoundEffect with 3 position arguments is deprecated, use vector-parametered version instead."); + LOGWARN("BroadcastSoundEffect with 3 position arguments is deprecated, use vector-parametered version instead." + ); } // Read the params: @@ -328,11 +314,8 @@ static int tolua_cWorld_BroadcastSoundEffect(lua_State * tolua_S) float Volume, Pitch; const cClientHandle * Exclude = nullptr; - if ( - !L.GetStackValues(1, Self, SoundName) || - !GetStackVectorOr3Numbers(L, 3, BlockPos) || - !L.GetStackValues(VolumeIndex, Volume, Pitch) - ) + if (!L.GetStackValues(1, Self, SoundName) || !GetStackVectorOr3Numbers(L, 3, BlockPos) || + !L.GetStackValues(VolumeIndex, Volume, Pitch)) { return 0; } @@ -353,16 +336,13 @@ static int tolua_cWorld_BroadcastSoundParticleEffect(lua_State * tolua_S) /* Function signature: World:BroadcastSoundParticleEffect(EffectID a_EffectID, Vector3i a_SrcPos, number a_Data, [cClientHandle a_Exclude]) --or-- - void BroadcastSoundParticleEffect(EffectID a_EffectID, number a_SrcX, number a_SrcY, number a_SrcZ, number a_Data, [cClientHandle a_Exclude]) + void BroadcastSoundParticleEffect(EffectID a_EffectID, number a_SrcX, number a_SrcY, number a_SrcZ, number a_Data, + [cClientHandle a_Exclude]) */ cLuaState L(tolua_S); int DataIndex; - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamNumber(2) || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 3, DataIndex) || - !L.CheckParamNumber(DataIndex) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamNumber(2) || + !CheckParamVectorOr3Numbers(L, "Vector3<int>", 3, DataIndex) || !L.CheckParamNumber(DataIndex)) { return 0; } @@ -370,7 +350,8 @@ static int tolua_cWorld_BroadcastSoundParticleEffect(lua_State * tolua_S) if (DataIndex != 4) // Not the vector overload { L.LogStackTrace(); - LOGWARN("BroadcastSoundParticleEffect with 3 position arguments is deprecated, use vector-parametered version instead."); + LOGWARN("BroadcastSoundParticleEffect with 3 position arguments is deprecated, use vector-parametered version " + "instead."); } // Read the params: @@ -380,11 +361,8 @@ static int tolua_cWorld_BroadcastSoundParticleEffect(lua_State * tolua_S) int Data; cClientHandle * ExcludeClient = nullptr; - if ( - !L.GetStackValues(1, World, EffectId) || - !GetStackVectorOr3Numbers(L, 3, SrcPos) || - !L.GetStackValue(DataIndex, Data) - ) + if (!L.GetStackValues(1, World, EffectId) || !GetStackVectorOr3Numbers(L, 3, SrcPos) || + !L.GetStackValue(DataIndex, Data)) { return 0; } @@ -403,18 +381,17 @@ static int tolua_cWorld_BroadcastSoundParticleEffect(lua_State * tolua_S) static int tolua_cWorld_BroadcastParticleEffect(lua_State * tolua_S) { /* Function signature: - World:BroadcastParticleEffect("Name", PosX, PosY, PosZ, OffX, OffY, OffZ, ParticleData, ParticleAmount, [ExcludeClient], [OptionalParam1], [OptionalParam2]) + World:BroadcastParticleEffect("Name", PosX, PosY, PosZ, OffX, OffY, OffZ, ParticleData, ParticleAmount, + [ExcludeClient], [OptionalParam1], [OptionalParam2]) --or-- - World:BroadcastParticleEffect("Name", SrcPos, Offset, ParticleData, ParticleAmount, [ExcludeClient], [OptionalParam1], [OptionalParam2]) + World:BroadcastParticleEffect("Name", SrcPos, Offset, ParticleData, ParticleAmount, [ExcludeClient], + [OptionalParam1], [OptionalParam2]) */ cLuaState L(tolua_S); int OffsetIndex, ParticleDataIndex; - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamString(2) || + if (!L.CheckParamSelf("cWorld") || !L.CheckParamString(2) || !CheckParamVectorOr3Numbers(L, "Vector3<float>", 3, OffsetIndex) || - !CheckParamVectorOr3Numbers(L, "Vector3<float>", OffsetIndex, ParticleDataIndex) - ) + !CheckParamVectorOr3Numbers(L, "Vector3<float>", OffsetIndex, ParticleDataIndex)) { return 0; } @@ -422,7 +399,8 @@ static int tolua_cWorld_BroadcastParticleEffect(lua_State * tolua_S) if ((OffsetIndex != 4) || (ParticleDataIndex != 5)) // Not the vector overload { L.LogStackTrace(); - LOGWARN("BroadcastParticleEffect with 3 position and 3 offset arguments is deprecated, use vector-parametered version instead."); + LOGWARN("BroadcastParticleEffect with 3 position and 3 offset arguments is deprecated, use vector-parametered " + "version instead."); } // Read the params: @@ -433,12 +411,9 @@ static int tolua_cWorld_BroadcastParticleEffect(lua_State * tolua_S) int ParticleAmount; cClientHandle * ExcludeClient = nullptr; - if ( - !L.GetStackValues(1, World, Name) || - !GetStackVectorOr3Numbers(L, 3, SrcPos) || + if (!L.GetStackValues(1, World, Name) || !GetStackVectorOr3Numbers(L, 3, SrcPos) || !GetStackVectorOr3Numbers(L, OffsetIndex, Offset) || - !L.GetStackValues(ParticleDataIndex, ParticleData, ParticleAmount) - ) + !L.GetStackValues(ParticleDataIndex, ParticleData, ParticleAmount)) { return 0; } @@ -472,11 +447,7 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S) */ cLuaState L(tolua_S); - if ( - !L.CheckParamUserType (1, "cWorld") || - !L.CheckParamTable (2) || - !L.CheckParamFunctionOrNil(3, 4) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamTable(2) || !L.CheckParamFunctionOrNil(3, 4)) { return 0; } @@ -484,7 +455,8 @@ static int tolua_cWorld_ChunkStay(lua_State * tolua_S) // Read the params: cWorld * world; cLuaState::cStackTablePtr chunkCoords; - cLuaState::cOptionalCallbackPtr onChunkAvailable, onAllChunksAvailable; // Callbacks may be unassigned at all - as a request to load / generate chunks + cLuaState::cOptionalCallbackPtr onChunkAvailable, + onAllChunksAvailable; // Callbacks may be unassigned at all - as a request to load / generate chunks if (!L.GetStackValues(1, world, chunkCoords, onChunkAvailable, onAllChunksAvailable)) { LOGWARNING("cWorld:ChunkStay(): Cannot read parameters, bailing out."); @@ -523,13 +495,8 @@ static int tolua_cWorld_DoExplosionAt(lua_State * tolua_S) */ cLuaState L(tolua_S); - if ( - !L.CheckParamUserType (1, "cWorld") || - !L.CheckParamNumber (2, 5) || - !L.CheckParamBool (6) || - !L.CheckParamNumber (7) || - !L.CheckParamEnd (9) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 5) || !L.CheckParamBool(6) || + !L.CheckParamNumber(7) || !L.CheckParamEnd(9)) { return 0; } @@ -612,12 +579,7 @@ static int tolua_cWorld_DoWithPlayerByUUID(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamUUID(2) || - !L.CheckParamFunction(3) || - !L.CheckParamEnd(4) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamUUID(2) || !L.CheckParamFunction(3) || !L.CheckParamEnd(4)) { return 0; } @@ -638,7 +600,9 @@ static int tolua_cWorld_DoWithPlayerByUUID(lua_State * tolua_S) } // Call the function: - bool res = Self->DoWithPlayerByUUID(PlayerUUID, [&](cPlayer & a_Player) + bool res = Self->DoWithPlayerByUUID( + PlayerUUID, + [&](cPlayer & a_Player) { bool ret = false; L.Call(FnRef, &a_Player, cLuaState::Return, ret); @@ -659,14 +623,10 @@ static int tolua_cWorld_DoWithNearestPlayer(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamUserType(2, "Vector3<double>") || - !L.CheckParamNumber(3) || + if (!L.CheckParamSelf("cWorld") || !L.CheckParamUserType(2, "Vector3<double>") || !L.CheckParamNumber(3) || !L.CheckParamFunction(4) || // Params 5 and 6 are optional bools, no check for those - !L.CheckParamEnd(7) - ) + !L.CheckParamEnd(7)) { return 0; } @@ -685,12 +645,18 @@ static int tolua_cWorld_DoWithNearestPlayer(lua_State * tolua_S) } // Call the function: - bool res = Self->DoWithNearestPlayer(Position, RangeLimit, [&](cPlayer & a_Player) - { - bool ret = false; - L.Call(FnRef, &a_Player, cLuaState::Return, ret); - return ret; - }, CheckLineOfSight, IgnoreSpectators); + bool res = Self->DoWithNearestPlayer( + Position, + RangeLimit, + [&](cPlayer & a_Player) + { + bool ret = false; + L.Call(FnRef, &a_Player, cLuaState::Return, ret); + return ret; + }, + CheckLineOfSight, + IgnoreSpectators + ); // Push the result as the return value: L.Push(res); @@ -711,12 +677,8 @@ static int tolua_cWorld_FastSetBlock(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamNumber(OffsetIndex, OffsetIndex + 1) || - !L.CheckParamEnd(OffsetIndex + 2) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamNumber(OffsetIndex, OffsetIndex + 1) || !L.CheckParamEnd(OffsetIndex + 2)) { return 0; } @@ -733,11 +695,8 @@ static int tolua_cWorld_FastSetBlock(lua_State * tolua_S) NIBBLETYPE Meta; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) || - !L.GetStackValues(OffsetIndex, Type, Meta) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position) || + !L.GetStackValues(OffsetIndex, Type, Meta)) { return 0; } @@ -764,12 +723,8 @@ static int tolua_cWorld_ForEachEntityInChunk(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamNumber(2, 3) || - !L.CheckParamFunction(4) || - !L.CheckParamEnd(5) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 3) || !L.CheckParamFunction(4) || + !L.CheckParamEnd(5)) { return 0; } @@ -790,7 +745,10 @@ static int tolua_cWorld_ForEachEntityInChunk(lua_State * tolua_S) } // Call the DoWith function: - bool res = Self->ForEachEntityInChunk(ChunkX, ChunkZ, [&](cEntity & a_Item) + bool res = Self->ForEachEntityInChunk( + ChunkX, + ChunkZ, + [&](cEntity & a_Item) { bool ret = false; L.Call(FnRef, &a_Item, cLuaState::Return, ret); @@ -813,10 +771,7 @@ static int tolua_cWorld_ForEachLoadedChunk(lua_State * tolua_S) // Function signature: ForEachLoadedChunk(callback) -> bool cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamFunction(2) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamFunction(2)) { return 0; } @@ -839,7 +794,10 @@ static int tolua_cWorld_ForEachLoadedChunk(lua_State * tolua_S) L.GetStackValues(2, FnRef); if (!FnRef.IsValid()) { - return cManualBindings::lua_do_error(tolua_S, "Error in function call '#funcname#': Could not get function reference of parameter #2"); + return cManualBindings::lua_do_error( + tolua_S, + "Error in function call '#funcname#': Could not get function reference of parameter #2" + ); } // Call the enumeration: @@ -871,11 +829,8 @@ static int tolua_cWorld_GetBlock(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -890,10 +845,7 @@ static int tolua_cWorld_GetBlock(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -927,11 +879,8 @@ static int tolua_cWorld_GetBlockBlockLight(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -946,10 +895,7 @@ static int tolua_cWorld_GetBlockBlockLight(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -984,11 +930,8 @@ static int tolua_cWorld_GetBlockInfo(lua_State * tolua_S) // Check params: cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -1003,10 +946,7 @@ static int tolua_cWorld_GetBlockInfo(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -1051,11 +991,8 @@ static int tolua_cWorld_GetBlockMeta(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -1070,10 +1007,7 @@ static int tolua_cWorld_GetBlockMeta(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -1107,11 +1041,8 @@ static int tolua_cWorld_GetBlockSkyLight(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -1126,10 +1057,7 @@ static int tolua_cWorld_GetBlockSkyLight(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -1164,11 +1092,8 @@ static int tolua_cWorld_GetBlockTypeMeta(lua_State * tolua_S) // Check params: cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamEnd(OffsetIndex) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamEnd(OffsetIndex)) { return 0; } @@ -1183,10 +1108,7 @@ static int tolua_cWorld_GetBlockTypeMeta(lua_State * tolua_S) Vector3i Position; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position)) { return 0; } @@ -1228,11 +1150,7 @@ static int tolua_cWorld_GetSignLines(lua_State * tolua_S) // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamNumber(2, 4) || - !L.CheckParamEnd(5) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 4) || !L.CheckParamEnd(5)) { return 0; } @@ -1270,10 +1188,7 @@ static int tolua_cWorld_GetTimeOfDay(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamEnd(2) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamEnd(2)) { return 0; } @@ -1302,10 +1217,7 @@ static int tolua_cWorld_GetWorldAge(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamEnd(2) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamEnd(2)) { return 0; } @@ -1338,20 +1250,15 @@ static int tolua_cWorld_PrepareChunk(lua_State * tolua_S) // Check the param types: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType (1, "cWorld") || - !L.CheckParamNumber (2, 3) || - !L.CheckParamFunctionOrNil(4) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 3) || !L.CheckParamFunctionOrNil(4)) { return 0; } // Wrap the Lua callback inside a C++ callback class: - class cCallback: - public cChunkCoordCallback + class cCallback : public cChunkCoordCallback { - public: + public: // cChunkCoordCallback override: virtual void Call(cChunkCoords a_Coords, bool a_IsSuccess) override { @@ -1390,10 +1297,7 @@ static int tolua_cWorld_QueueTask(lua_State * tolua_S) // Retrieve the args: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamFunction(2) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamFunction(2)) { return 0; } @@ -1405,18 +1309,20 @@ static int tolua_cWorld_QueueTask(lua_State * tolua_S) } if (World == nullptr) { - return cManualBindings::lua_do_error(tolua_S, "Error in function call '#funcname#': Not called on an object instance"); + return cManualBindings::lua_do_error( + tolua_S, + "Error in function call '#funcname#': Not called on an object instance" + ); } if (!Task->IsValid()) { - return cManualBindings::lua_do_error(tolua_S, "Error in function call '#funcname#': Could not store the callback parameter"); + return cManualBindings::lua_do_error( + tolua_S, + "Error in function call '#funcname#': Could not store the callback parameter" + ); } - World->QueueTask([Task](cWorld & a_World) - { - Task->Call(&a_World); - } - ); + World->QueueTask([Task](cWorld & a_World) { Task->Call(&a_World); }); return 0; } @@ -1434,12 +1340,8 @@ static int tolua_cWorld_SetBlock(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamNumber(OffsetIndex, OffsetIndex + 1) || - !L.CheckParamEnd(OffsetIndex + 2) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamNumber(OffsetIndex, OffsetIndex + 1) || !L.CheckParamEnd(OffsetIndex + 2)) { return 0; } @@ -1456,11 +1358,8 @@ static int tolua_cWorld_SetBlock(lua_State * tolua_S) NIBBLETYPE Meta; // Read the params: - if ( - !L.GetStackValues(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) || - !L.GetStackValues(OffsetIndex, Type, Meta) - ) + if (!L.GetStackValues(1, World) || !GetStackVectorOr3Numbers(L, 2, Position) || + !L.GetStackValues(OffsetIndex, Type, Meta)) { return 0; } @@ -1493,12 +1392,8 @@ static int tolua_cWorld_SetBlockMeta(lua_State * tolua_S) cLuaState L(tolua_S); int OffsetIndex; - if ( - !L.CheckParamSelf("cWorld") || - !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || - !L.CheckParamNumber(OffsetIndex) || - !L.CheckParamEnd(OffsetIndex + 1) - ) + if (!L.CheckParamSelf("cWorld") || !CheckParamVectorOr3Numbers(L, "Vector3<int>", 2, OffsetIndex) || + !L.CheckParamNumber(OffsetIndex) || !L.CheckParamEnd(OffsetIndex + 1)) { return 0; } @@ -1514,11 +1409,7 @@ static int tolua_cWorld_SetBlockMeta(lua_State * tolua_S) NIBBLETYPE Meta; // Read the params: - if ( - !L.GetStackValue(1, World) || - !GetStackVectorOr3Numbers(L, 2, Position) || - !L.GetStackValue(OffsetIndex, Meta) - ) + if (!L.GetStackValue(1, World) || !GetStackVectorOr3Numbers(L, 2, Position) || !L.GetStackValue(OffsetIndex, Meta)) { return 0; } @@ -1547,12 +1438,8 @@ static int tolua_cWorld_SetSignLines(lua_State * tolua_S) // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamNumber(2, 4) || - !L.CheckParamString(5, 8) || - !L.CheckParamEnd(9) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 4) || !L.CheckParamString(5, 8) || + !L.CheckParamEnd(9)) { return 0; } @@ -1585,11 +1472,7 @@ static int tolua_cWorld_SetTimeOfDay(lua_State * tolua_S) { // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamNumber(2) || - !L.CheckParamEnd(3) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamNumber(2) || !L.CheckParamEnd(3)) { return 0; } @@ -1619,11 +1502,7 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S) // Retrieve the args: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamNumber (2) || - !L.CheckParamFunction(3) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2) || !L.CheckParamFunction(3)) { return 0; } @@ -1636,18 +1515,20 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S) } if (World == nullptr) { - return cManualBindings::lua_do_error(tolua_S, "Error in function call '#funcname#': Not called on an object instance"); + return cManualBindings::lua_do_error( + tolua_S, + "Error in function call '#funcname#': Not called on an object instance" + ); } if (!Task->IsValid()) { - return cManualBindings::lua_do_error(tolua_S, "Error in function call '#funcname#': Could not store the callback parameter"); + return cManualBindings::lua_do_error( + tolua_S, + "Error in function call '#funcname#': Could not store the callback parameter" + ); } - World->ScheduleTask(cTickTime(NumTicks), [Task](cWorld & a_World) - { - Task->Call(&a_World); - } - ); + World->ScheduleTask(cTickTime(NumTicks), [Task](cWorld & a_World) { Task->Call(&a_World); }); return 0; } @@ -1655,15 +1536,11 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S) -static int tolua_cWorld_SpawnSplitExperienceOrbs(lua_State* tolua_S) +static int tolua_cWorld_SpawnSplitExperienceOrbs(lua_State * tolua_S) { cLuaState L(tolua_S); - if ( - !L.CheckParamSelf("cWorld") || - !L.CheckParamUserType(2, "Vector3<double>") || - !L.CheckParamNumber(3) || - !L.CheckParamEnd(4) - ) + if (!L.CheckParamSelf("cWorld") || !L.CheckParamUserType(2, "Vector3<double>") || !L.CheckParamNumber(3) || + !L.CheckParamEnd(4)) { return 0; } @@ -1695,11 +1572,7 @@ static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) // Check params: cLuaState L(tolua_S); - if ( - !L.CheckParamUserType(1, "cWorld") || - !L.CheckParamNumber(2, 3) || - !L.CheckParamEnd(4) - ) + if (!L.CheckParamUserType(1, "cWorld") || !L.CheckParamNumber(2, 3) || !L.CheckParamEnd(4)) { return 0; } @@ -1734,60 +1607,60 @@ static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) void cManualBindings::BindWorld(lua_State * tolua_S) { tolua_beginmodule(tolua_S, nullptr); - tolua_beginmodule(tolua_S, "cWorld"); - tolua_function(tolua_S, "BroadcastBlockAction", tolua_cWorld_BroadcastBlockAction); - tolua_function(tolua_S, "BroadcastSoundEffect", tolua_cWorld_BroadcastSoundEffect); - tolua_function(tolua_S, "BroadcastSoundParticleEffect", tolua_cWorld_BroadcastSoundParticleEffect); - tolua_function(tolua_S, "BroadcastParticleEffect", tolua_cWorld_BroadcastParticleEffect); - tolua_function(tolua_S, "ChunkStay", tolua_cWorld_ChunkStay); - tolua_function(tolua_S, "DoExplosionAt", tolua_cWorld_DoExplosionAt); - tolua_function(tolua_S, "DoWithBeaconAt", DoWithBlockEntityAt<cBeaconEntity, E_BLOCK_BEACON>); - tolua_function(tolua_S, "DoWithBedAt", DoWithBlockEntityAt<cBedEntity, E_BLOCK_BED>); - tolua_function(tolua_S, "DoWithBlockEntityAt", DoWithBlockEntityAt<cBlockEntity>); - tolua_function(tolua_S, "DoWithBrewingstandAt", DoWithBlockEntityAt<cBrewingstandEntity, E_BLOCK_BREWING_STAND>); - tolua_function(tolua_S, "DoWithChestAt", DoWithBlockEntityAt<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>); - tolua_function(tolua_S, "DoWithCommandBlockAt", DoWithBlockEntityAt<cCommandBlockEntity, E_BLOCK_COMMAND_BLOCK>); - tolua_function(tolua_S, "DoWithDispenserAt", DoWithBlockEntityAt<cDispenserEntity, E_BLOCK_DISPENSER>); - tolua_function(tolua_S, "DoWithDropSpenserAt", DoWithBlockEntityAt<cDropSpenserEntity, E_BLOCK_DISPENSER, E_BLOCK_DROPPER>); - tolua_function(tolua_S, "DoWithDropperAt", DoWithBlockEntityAt<cDropperEntity, E_BLOCK_DROPPER>); - tolua_function(tolua_S, "DoWithEntityByID", DoWithID<cWorld, cEntity, &cWorld::DoWithEntityByID>); - tolua_function(tolua_S, "DoWithFlowerPotAt", DoWithBlockEntityAt<cFlowerPotEntity, E_BLOCK_FLOWER_POT>); - tolua_function(tolua_S, "DoWithFurnaceAt", DoWithBlockEntityAt<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>); - tolua_function(tolua_S, "DoWithHopperAt", DoWithBlockEntityAt<cHopperEntity, E_BLOCK_HOPPER>); - tolua_function(tolua_S, "DoWithMobHeadAt", DoWithBlockEntityAt<cMobHeadEntity, E_BLOCK_HEAD>); - tolua_function(tolua_S, "DoWithNearestPlayer", tolua_cWorld_DoWithNearestPlayer); - tolua_function(tolua_S, "DoWithNoteBlockAt", DoWithBlockEntityAt<cNoteEntity, E_BLOCK_NOTE_BLOCK>); - tolua_function(tolua_S, "DoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::DoWithPlayer>); - tolua_function(tolua_S, "DoWithPlayerByUUID", tolua_cWorld_DoWithPlayerByUUID); - tolua_function(tolua_S, "FastSetBlock", tolua_cWorld_FastSetBlock); - tolua_function(tolua_S, "FindAndDoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>); - tolua_function(tolua_S, "ForEachBlockEntityInChunk", ForEachBlockEntityInChunk<cBlockEntity>); - tolua_function(tolua_S, "ForEachBrewingstandInChunk", ForEachBlockEntityInChunk<cBrewingstandEntity, E_BLOCK_BREWING_STAND>); - tolua_function(tolua_S, "ForEachChestInChunk", ForEachBlockEntityInChunk<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>); - tolua_function(tolua_S, "ForEachEntity", ForEach<cWorld, cEntity, &cWorld::ForEachEntity>); - tolua_function(tolua_S, "ForEachEntityInBox", ForEachInBox<cWorld, cEntity, &cWorld::ForEachEntityInBox>); - tolua_function(tolua_S, "ForEachEntityInChunk", tolua_cWorld_ForEachEntityInChunk); - tolua_function(tolua_S, "ForEachFurnaceInChunk", ForEachBlockEntityInChunk<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>); - tolua_function(tolua_S, "ForEachLoadedChunk", tolua_cWorld_ForEachLoadedChunk); - tolua_function(tolua_S, "ForEachPlayer", ForEach<cWorld, cPlayer, &cWorld::ForEachPlayer>); - tolua_function(tolua_S, "GetBlock", tolua_cWorld_GetBlock); - tolua_function(tolua_S, "GetBlockBlockLight", tolua_cWorld_GetBlockBlockLight); - tolua_function(tolua_S, "GetBlockInfo", tolua_cWorld_GetBlockInfo); - tolua_function(tolua_S, "GetBlockMeta", tolua_cWorld_GetBlockMeta); - tolua_function(tolua_S, "GetBlockSkyLight", tolua_cWorld_GetBlockSkyLight); - tolua_function(tolua_S, "GetBlockTypeMeta", tolua_cWorld_GetBlockTypeMeta); - tolua_function(tolua_S, "GetSignLines", tolua_cWorld_GetSignLines); - tolua_function(tolua_S, "GetTimeOfDay", tolua_cWorld_GetTimeOfDay); - tolua_function(tolua_S, "GetWorldAge", tolua_cWorld_GetWorldAge); - tolua_function(tolua_S, "PrepareChunk", tolua_cWorld_PrepareChunk); - tolua_function(tolua_S, "QueueTask", tolua_cWorld_QueueTask); - tolua_function(tolua_S, "ScheduleTask", tolua_cWorld_ScheduleTask); - tolua_function(tolua_S, "SetBlock", tolua_cWorld_SetBlock); - tolua_function(tolua_S, "SetBlockMeta", tolua_cWorld_SetBlockMeta); - tolua_function(tolua_S, "SetSignLines", tolua_cWorld_SetSignLines); - tolua_function(tolua_S, "SetTimeOfDay", tolua_cWorld_SetTimeOfDay); - tolua_function(tolua_S, "SpawnSplitExperienceOrbs", tolua_cWorld_SpawnSplitExperienceOrbs); - tolua_function(tolua_S, "TryGetHeight", tolua_cWorld_TryGetHeight); - tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cWorld"); + tolua_function(tolua_S, "BroadcastBlockAction", tolua_cWorld_BroadcastBlockAction); + tolua_function(tolua_S, "BroadcastSoundEffect", tolua_cWorld_BroadcastSoundEffect); + tolua_function(tolua_S, "BroadcastSoundParticleEffect", tolua_cWorld_BroadcastSoundParticleEffect); + tolua_function(tolua_S, "BroadcastParticleEffect", tolua_cWorld_BroadcastParticleEffect); + tolua_function(tolua_S, "ChunkStay", tolua_cWorld_ChunkStay); + tolua_function(tolua_S, "DoExplosionAt", tolua_cWorld_DoExplosionAt); + tolua_function(tolua_S, "DoWithBeaconAt", DoWithBlockEntityAt<cBeaconEntity, E_BLOCK_BEACON>); + tolua_function(tolua_S, "DoWithBedAt", DoWithBlockEntityAt<cBedEntity, E_BLOCK_BED>); + tolua_function(tolua_S, "DoWithBlockEntityAt", DoWithBlockEntityAt<cBlockEntity>); + tolua_function(tolua_S, "DoWithBrewingstandAt", DoWithBlockEntityAt<cBrewingstandEntity, E_BLOCK_BREWING_STAND>); + tolua_function(tolua_S, "DoWithChestAt", DoWithBlockEntityAt<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>); + tolua_function(tolua_S, "DoWithCommandBlockAt", DoWithBlockEntityAt<cCommandBlockEntity, E_BLOCK_COMMAND_BLOCK>); + tolua_function(tolua_S, "DoWithDispenserAt", DoWithBlockEntityAt<cDispenserEntity, E_BLOCK_DISPENSER>); + tolua_function(tolua_S, "DoWithDropSpenserAt", DoWithBlockEntityAt<cDropSpenserEntity, E_BLOCK_DISPENSER, E_BLOCK_DROPPER>); + tolua_function(tolua_S, "DoWithDropperAt", DoWithBlockEntityAt<cDropperEntity, E_BLOCK_DROPPER>); + tolua_function(tolua_S, "DoWithEntityByID", DoWithID<cWorld, cEntity, &cWorld::DoWithEntityByID>); + tolua_function(tolua_S, "DoWithFlowerPotAt", DoWithBlockEntityAt<cFlowerPotEntity, E_BLOCK_FLOWER_POT>); + tolua_function(tolua_S, "DoWithFurnaceAt", DoWithBlockEntityAt<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>); + tolua_function(tolua_S, "DoWithHopperAt", DoWithBlockEntityAt<cHopperEntity, E_BLOCK_HOPPER>); + tolua_function(tolua_S, "DoWithMobHeadAt", DoWithBlockEntityAt<cMobHeadEntity, E_BLOCK_HEAD>); + tolua_function(tolua_S, "DoWithNearestPlayer", tolua_cWorld_DoWithNearestPlayer); + tolua_function(tolua_S, "DoWithNoteBlockAt", DoWithBlockEntityAt<cNoteEntity, E_BLOCK_NOTE_BLOCK>); + tolua_function(tolua_S, "DoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::DoWithPlayer>); + tolua_function(tolua_S, "DoWithPlayerByUUID", tolua_cWorld_DoWithPlayerByUUID); + tolua_function(tolua_S, "FastSetBlock", tolua_cWorld_FastSetBlock); + tolua_function(tolua_S, "FindAndDoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>); + tolua_function(tolua_S, "ForEachBlockEntityInChunk", ForEachBlockEntityInChunk<cBlockEntity>); + tolua_function(tolua_S, "ForEachBrewingstandInChunk", ForEachBlockEntityInChunk<cBrewingstandEntity, E_BLOCK_BREWING_STAND>); + tolua_function(tolua_S, "ForEachChestInChunk", ForEachBlockEntityInChunk<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>); + tolua_function(tolua_S, "ForEachEntity", ForEach<cWorld, cEntity, &cWorld::ForEachEntity>); + tolua_function(tolua_S, "ForEachEntityInBox", ForEachInBox<cWorld, cEntity, &cWorld::ForEachEntityInBox>); + tolua_function(tolua_S, "ForEachEntityInChunk", tolua_cWorld_ForEachEntityInChunk); + tolua_function(tolua_S, "ForEachFurnaceInChunk", ForEachBlockEntityInChunk<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>); + tolua_function(tolua_S, "ForEachLoadedChunk", tolua_cWorld_ForEachLoadedChunk); + tolua_function(tolua_S, "ForEachPlayer", ForEach<cWorld, cPlayer, &cWorld::ForEachPlayer>); + tolua_function(tolua_S, "GetBlock", tolua_cWorld_GetBlock); + tolua_function(tolua_S, "GetBlockBlockLight", tolua_cWorld_GetBlockBlockLight); + tolua_function(tolua_S, "GetBlockInfo", tolua_cWorld_GetBlockInfo); + tolua_function(tolua_S, "GetBlockMeta", tolua_cWorld_GetBlockMeta); + tolua_function(tolua_S, "GetBlockSkyLight", tolua_cWorld_GetBlockSkyLight); + tolua_function(tolua_S, "GetBlockTypeMeta", tolua_cWorld_GetBlockTypeMeta); + tolua_function(tolua_S, "GetSignLines", tolua_cWorld_GetSignLines); + tolua_function(tolua_S, "GetTimeOfDay", tolua_cWorld_GetTimeOfDay); + tolua_function(tolua_S, "GetWorldAge", tolua_cWorld_GetWorldAge); + tolua_function(tolua_S, "PrepareChunk", tolua_cWorld_PrepareChunk); + tolua_function(tolua_S, "QueueTask", tolua_cWorld_QueueTask); + tolua_function(tolua_S, "ScheduleTask", tolua_cWorld_ScheduleTask); + tolua_function(tolua_S, "SetBlock", tolua_cWorld_SetBlock); + tolua_function(tolua_S, "SetBlockMeta", tolua_cWorld_SetBlockMeta); + tolua_function(tolua_S, "SetSignLines", tolua_cWorld_SetSignLines); + tolua_function(tolua_S, "SetTimeOfDay", tolua_cWorld_SetTimeOfDay); + tolua_function(tolua_S, "SpawnSplitExperienceOrbs", tolua_cWorld_SpawnSplitExperienceOrbs); + tolua_function(tolua_S, "TryGetHeight", tolua_cWorld_TryGetHeight); + tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); } |