summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings_BlockArea.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-06-26 08:56:55 +0200
committerMattes D <github@xoft.cz>2017-06-26 10:52:59 +0200
commite05ca494593d780c0ecf358bf66a94b224b35b5b (patch)
treec94b004d4c89aa118f889a2ae988cd354f69ace1 /src/Bindings/ManualBindings_BlockArea.cpp
parentFixed memory leak in cClientHandle. (#3794) (diff)
downloadcuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.gz
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.bz2
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.lz
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.xz
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.tar.zst
cuberite-e05ca494593d780c0ecf358bf66a94b224b35b5b.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/ManualBindings_BlockArea.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/Bindings/ManualBindings_BlockArea.cpp b/src/Bindings/ManualBindings_BlockArea.cpp
index 506c84072..038c571ac 100644
--- a/src/Bindings/ManualBindings_BlockArea.cpp
+++ b/src/Bindings/ManualBindings_BlockArea.cpp
@@ -31,7 +31,7 @@ static int readCuboidOverloadParams(cLuaState & a_LuaState, int a_StartParam, cC
// Assume the 6-number version:
if (!a_LuaState.GetStackValues(a_StartParam, a_Cuboid.p1.x, a_Cuboid.p2.x, a_Cuboid.p1.y, a_Cuboid.p2.y, a_Cuboid.p1.z, a_Cuboid.p2.z))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the bounds parameters, expected 6 numbers.");
+ return a_LuaState.ApiParamError("Cannot read the bounds parameters, expected 6 numbers.");
}
return a_StartParam + 6;
}
@@ -41,7 +41,7 @@ static int readCuboidOverloadParams(cLuaState & a_LuaState, int a_StartParam, cC
cCuboid * c;
if (!a_LuaState.GetStackValues(a_StartParam, c))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the bounds parameter, expected a cCuboid instance.");
+ return a_LuaState.ApiParamError("Cannot read the bounds parameter, expected a cCuboid instance.");
}
a_Cuboid = *c;
return a_StartParam + 1;
@@ -53,7 +53,7 @@ static int readCuboidOverloadParams(cLuaState & a_LuaState, int a_StartParam, cC
Vector3i * p2;
if (!a_LuaState.GetStackValues(a_StartParam, p1, p2))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the bounds parameter, expected two Vector3i instances.");
+ return a_LuaState.ApiParamError("Cannot read the bounds parameter, expected two Vector3i instances.");
}
a_Cuboid.p1 = *p1;
a_Cuboid.p2 = *p2;
@@ -79,7 +79,7 @@ static int readVector3iOverloadParams(cLuaState & a_LuaState, int a_StartParam,
// Assume the 3-number version:
if (!a_LuaState.GetStackValues(a_StartParam, a_Coords.x, a_Coords.y, a_Coords.z))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the %s, expected 3 numbers.", a_ParamName);
+ return a_LuaState.ApiParamError("Cannot read the %s, expected 3 numbers.", a_ParamName);
}
return a_StartParam + 3;
}
@@ -89,7 +89,7 @@ static int readVector3iOverloadParams(cLuaState & a_LuaState, int a_StartParam,
Vector3i * c;
if (!a_LuaState.GetStackValues(a_StartParam, c))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the %s, expected a Vector3i instance.", a_ParamName);
+ return a_LuaState.ApiParamError("Cannot read the %s, expected a Vector3i instance.", a_ParamName);
}
a_Coords = *c;
return a_StartParam + 1;
@@ -111,11 +111,11 @@ static int tolua_cBlockArea_Create(lua_State * a_LuaState)
cBlockArea * self = nullptr;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read self.");
+ return L.ApiParamError("Cannot read self.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
int dataTypes = cBlockArea::baTypes | cBlockArea::baMetas | cBlockArea::baBlockEntities;
@@ -124,13 +124,13 @@ static int tolua_cBlockArea_Create(lua_State * a_LuaState)
L.GetStackValue(dataTypesIdx, dataTypes);
if (!cBlockArea::IsValidDataTypeCombination(dataTypes))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid combination of baDataTypes specified (%d).", dataTypes);
+ return L.ApiParamError("Invalid combination of baDataTypes specified (%d).", dataTypes);
}
// Create the area:
if ((size.x <= 0) || (size.y <= 0) || (size.z <= 0))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid sizes, must be greater than zero, got {%d, %d, %d}", size.x, size.y, size.z);
+ return L.ApiParamError("Invalid sizes, must be greater than zero, got {%d, %d, %d}", size.x, size.y, size.z);
}
ASSERT(self != nullptr);
self->Create(size, dataTypes);
@@ -155,11 +155,11 @@ static int tolua_cBlockArea_FillRelCuboid(lua_State * a_LuaState)
cBlockArea * self = nullptr;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read self.");
+ return L.ApiParamError("Cannot read self.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
// Check and get the overloaded params:
@@ -170,12 +170,12 @@ static int tolua_cBlockArea_FillRelCuboid(lua_State * a_LuaState)
NIBBLETYPE blockMeta = 0, blockLight = 0, blockSkyLight = 0x0f;
if (!L.GetStackValues(nextIdx, dataTypes, blockType))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the datatypes or block type params");
+ return L.ApiParamError("Cannot read the datatypes or block type params");
}
L.GetStackValues(nextIdx + 2, blockMeta, blockLight, blockSkyLight); // These values are optional
if (!cBlockArea::IsValidDataTypeCombination(dataTypes))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid baDataTypes combination (%d).", dataTypes);
+ return L.ApiParamError("Invalid baDataTypes combination (%d).", dataTypes);
}
// Check the coords, shift if needed:
@@ -206,18 +206,18 @@ static int tolua_cBlockArea_GetBlockTypeMeta(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read 'self'");
+ return L.ApiParamError("Cannot read 'self'");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
Vector3i coords;
readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "Coords ({%d, %d, %d}) out of range ({%d, %d, %d} - {%d, %d, %d}).",
+ return L.ApiParamError("Coords ({%d, %d, %d}) out of range ({%d, %d, %d} - {%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetOriginX(), self->GetOriginY(), self->GetOriginZ(),
self->GetOriginX() + self->GetSizeX() - 1, self->GetOriginY() + self->GetSizeY() - 1, self->GetOriginZ() + self->GetSizeZ() - 1
@@ -250,11 +250,11 @@ static int tolua_cBlockArea_GetCoordRange(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' parameter.");
+ return L.ApiParamError("Cannot read the 'self' parameter.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
L.Push(self->GetSizeX() - 1, self->GetSizeY() - 1, self->GetSizeZ() - 1);
@@ -280,15 +280,15 @@ static int tolua_cBlockArea_GetNonAirCropRelCoords(lua_State * a_LuaState)
BLOCKTYPE ignoreBlockType = E_BLOCK_AIR;
if (!L.GetStackValues(1, self, ignoreBlockType))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read params");
+ return L.ApiParamError("Cannot read params");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil");
+ return L.ApiParamError("Invalid 'self', must not be nil");
}
if (!self->HasBlockTypes())
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain baTypes datatype");
+ return L.ApiParamError("The area doesn't contain baTypes datatype");
}
// Calculate the crop coords:
@@ -320,11 +320,11 @@ static int tolua_cBlockArea_GetOrigin(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' parameter.");
+ return L.ApiParamError("Cannot read the 'self' parameter.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
// Push the three origin coords:
@@ -350,26 +350,26 @@ static int tolua_cBlockArea_GetRelBlockTypeMeta(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' parameter.");
+ return L.ApiParamError("Cannot read the 'self' parameter.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
if (!self->HasBlockTypes())
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain baTypes datatype");
+ return L.ApiParamError("The area doesn't contain baTypes datatype");
}
if (!self->HasBlockMetas())
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain baMetas datatype");
+ return L.ApiParamError("The area doesn't contain baMetas datatype");
}
Vector3i coords;
readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidRelCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range (max {%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range (max {%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetSizeX() - 1, self->GetSizeY() - 1, self->GetSizeZ() - 1
);
@@ -401,11 +401,11 @@ static int tolua_cBlockArea_GetSize(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' parameter.");
+ return L.ApiParamError("Cannot read the 'self' parameter.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
L.Push(self->GetSizeX(), self->GetSizeY(), self->GetSizeZ());
@@ -433,11 +433,11 @@ static int tolua_cBlockArea_LoadFromSchematicFile(lua_State * a_LuaState)
AString fileName;
if (!L.GetStackValues(1, self, fileName))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the parameters.");
+ return L.ApiParamError("Cannot read the parameters.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
L.Push(cSchematicFileSerializer::LoadFromSchematicFile(*self, fileName));
@@ -465,11 +465,11 @@ static int tolua_cBlockArea_LoadFromSchematicString(lua_State * a_LuaState)
AString data;
if (!L.GetStackValues(1, self, data))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the parameters.");
+ return L.ApiParamError("Cannot read the parameters.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
L.Push(cSchematicFileSerializer::LoadFromSchematicString(*self, data));
@@ -498,11 +498,11 @@ static int tolua_cBlockArea_Read(lua_State * a_LuaState)
cWorld * world = nullptr;
if (!L.GetStackValues(1, self, world))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read self or world.");
+ return L.ApiParamError("Cannot read self or world.");
}
if (world == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid world instance. The world must be not nil.");
+ return L.ApiParamError("Invalid world instance. The world must be not nil.");
}
// Check and get the overloaded params:
@@ -512,7 +512,7 @@ static int tolua_cBlockArea_Read(lua_State * a_LuaState)
L.GetStackValues(dataTypesIdx, dataTypes);
if (!cBlockArea::IsValidDataTypeCombination(dataTypes))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid baDataTypes combination (%d).", dataTypes);
+ return L.ApiParamError("Invalid baDataTypes combination (%d).", dataTypes);
}
// Check the coords, shift if needed:
@@ -574,7 +574,7 @@ static int tolua_cBlockArea_RelLine(lua_State * a_LuaState)
cBlockArea * self = nullptr;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read self.");
+ return L.ApiParamError("Cannot read self.");
}
// Check and get the overloaded params:
@@ -588,11 +588,11 @@ static int tolua_cBlockArea_RelLine(lua_State * a_LuaState)
L.GetStackValues(idx, dataTypes, blockType, blockMeta, blockLight, blockSkyLight);
if (!cBlockArea::IsValidDataTypeCombination(dataTypes))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid baDataTypes combination (%d).", dataTypes);
+ return L.ApiParamError("Invalid baDataTypes combination (%d).", dataTypes);
}
if ((self->GetDataTypes() & dataTypes) != dataTypes)
{
- return cManualBindings::ApiParamError(a_LuaState, "Requested datatypes not present in the cBlockArea. Got only 0x%02x, requested 0x%02x",
+ return L.ApiParamError("Requested datatypes not present in the cBlockArea. Got only 0x%02x, requested 0x%02x",
self->GetDataTypes(), dataTypes
);
}
@@ -623,11 +623,11 @@ static int tolua_cBlockArea_SaveToSchematicFile(lua_State * a_LuaState)
AString fileName;
if (!L.GetStackValues(1, self, fileName))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the parameters.");
+ return L.ApiParamError("Cannot read the parameters.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
L.Push(cSchematicFileSerializer::SaveToSchematicFile(*self, fileName));
@@ -653,11 +653,11 @@ static int tolua_cBlockArea_SaveToSchematicString(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' parameter.");
+ return L.ApiParamError("Cannot read the 'self' parameter.");
}
if (self == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid 'self', must not be nil.");
+ return L.ApiParamError("Invalid 'self', must not be nil.");
}
AString data;
@@ -691,11 +691,11 @@ static int tolua_cBlockArea_Write(lua_State * a_LuaState)
cWorld * world = nullptr;
if (!L.GetStackValues(1, self, world))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read self or world.");
+ return L.ApiParamError("Cannot read self or world.");
}
if (world == nullptr)
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid world instance. The world must be not nil.");
+ return L.ApiParamError("Invalid world instance. The world must be not nil.");
}
// Check and get the overloaded params:
@@ -707,11 +707,11 @@ static int tolua_cBlockArea_Write(lua_State * a_LuaState)
// Check the dataType parameter validity:
if (!cBlockArea::IsValidDataTypeCombination(dataTypes))
{
- return cManualBindings::ApiParamError(a_LuaState, "Invalid datatype combination (%d).", dataTypes);
+ return L.ApiParamError("Invalid datatype combination (%d).", dataTypes);
}
if ((self->GetDataTypes() & dataTypes) != dataTypes)
{
- return cManualBindings::ApiParamError(a_LuaState, "Requesting datatypes not present in the cBlockArea. Got only 0x%02x, requested 0x%02x",
+ return L.ApiParamError("Requesting datatypes not present in the cBlockArea. Got only 0x%02x, requested 0x%02x",
self->GetDataTypes(), dataTypes
);
}
@@ -766,13 +766,13 @@ static int GetBlock(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check the datatype's presence:
if ((self->GetDataTypes() & DataTypeFlag) == 0)
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatype (%d).", DataTypeFlag);
+ return L.ApiParamError("The area doesn't contain the datatype (%d).", DataTypeFlag);
}
// Read the overloaded params:
@@ -780,7 +780,7 @@ static int GetBlock(lua_State * a_LuaState)
readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetOriginX(), self->GetOriginY(), self->GetOriginZ(),
self->GetOriginX() + self->GetSizeX() - 1, self->GetOriginY() + self->GetSizeY() - 1, self->GetOriginZ() + self->GetSizeZ() - 1
@@ -819,13 +819,13 @@ static int GetRelBlock(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check the datatype's presence:
if ((self->GetDataTypes() & DataTypeFlag) == 0)
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatype (%d).", DataTypeFlag);
+ return L.ApiParamError("The area doesn't contain the datatype (%d).", DataTypeFlag);
}
// Read the overloaded params:
@@ -833,7 +833,7 @@ static int GetRelBlock(lua_State * a_LuaState)
readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidRelCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetSizeX(), self->GetSizeY(), self->GetSizeZ()
);
@@ -871,13 +871,13 @@ static int SetBlock(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check the datatype's presence:
if ((self->GetDataTypes() & DataTypeFlag) == 0)
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatype (%d).", DataTypeFlag);
+ return L.ApiParamError("The area doesn't contain the datatype (%d).", DataTypeFlag);
}
// Read the overloaded params:
@@ -885,7 +885,7 @@ static int SetBlock(lua_State * a_LuaState)
auto idx = readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetOriginX(), self->GetOriginY(), self->GetOriginZ(),
self->GetOriginX() + self->GetSizeX() - 1, self->GetOriginY() + self->GetSizeY() - 1, self->GetOriginZ() + self->GetSizeZ() - 1
@@ -926,13 +926,13 @@ static int SetRelBlock(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check the datatype's presence:
if ((self->GetDataTypes() & DataTypeFlag) == 0)
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatype (%d).", DataTypeFlag);
+ return L.ApiParamError("The area doesn't contain the datatype (%d).", DataTypeFlag);
}
// Read the overloaded params:
@@ -940,7 +940,7 @@ static int SetRelBlock(lua_State * a_LuaState)
auto idx = readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidRelCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetSizeX(), self->GetSizeY(), self->GetSizeZ()
);
@@ -970,13 +970,13 @@ static int tolua_cBlockArea_SetBlockTypeMeta(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check if block types and metas are present:
if (!self->HasBlockTypes() || !self->HasBlockMetas())
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatypes baTypes and baMetas.");
+ return L.ApiParamError("The area doesn't contain the datatypes baTypes and baMetas.");
}
// Read the overloaded params:
@@ -984,7 +984,7 @@ static int tolua_cBlockArea_SetBlockTypeMeta(lua_State * a_LuaState)
auto idx = readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d} - {%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetOriginX(), self->GetOriginY(), self->GetOriginZ(),
self->GetOriginX() + self->GetSizeX() - 1, self->GetOriginY() + self->GetSizeY() - 1, self->GetOriginZ() + self->GetSizeZ() - 1
@@ -995,7 +995,7 @@ static int tolua_cBlockArea_SetBlockTypeMeta(lua_State * a_LuaState)
NIBBLETYPE meta;
if (!L.GetStackValues(idx, block, meta))
{
- return cManualBindings::ApiParamError(a_LuaState, "Bad number for block type or meta type.");
+ return L.ApiParamError("Bad number for block type or meta type.");
}
// Set block type and meta:
@@ -1020,13 +1020,13 @@ static int tolua_cBlockArea_SetRelBlockTypeMeta(lua_State * a_LuaState)
cBlockArea * self;
if (!L.GetStackValues(1, self))
{
- return cManualBindings::ApiParamError(a_LuaState, "Cannot read the 'self' param.");
+ return L.ApiParamError("Cannot read the 'self' param.");
}
// Check if block types and metas are present:
if (!self->HasBlockTypes() || !self->HasBlockMetas())
{
- return cManualBindings::ApiParamError(a_LuaState, "The area doesn't contain the datatypes baTypes and baMetas.");
+ return L.ApiParamError("The area doesn't contain the baTypes or baMetas datatypes (0x%02x).", self->GetDataTypes());
}
// Read the overloaded params:
@@ -1034,7 +1034,7 @@ static int tolua_cBlockArea_SetRelBlockTypeMeta(lua_State * a_LuaState)
auto idx = readVector3iOverloadParams(L, 2, coords, "coords");
if (!self->IsValidRelCoords(coords))
{
- return cManualBindings::ApiParamError(a_LuaState, "The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
+ return L.ApiParamError("The coords ({%d, %d, %d}) are out of range ({%d, %d, %d}).",
coords.x, coords.y, coords.z,
self->GetSizeX(), self->GetSizeY(), self->GetSizeZ()
);
@@ -1044,7 +1044,7 @@ static int tolua_cBlockArea_SetRelBlockTypeMeta(lua_State * a_LuaState)
NIBBLETYPE meta;
if (!L.GetStackValues(idx, block, meta))
{
- return cManualBindings::ApiParamError(a_LuaState, "Bad number for block type or meta type.");
+ return L.ApiParamError("Bad number for block type or meta type.");
}
// Set block type and meta: