Skip to content

Commit

Permalink
Refactored more of Entities and BlockEntities to use Vector3. (cuberi…
Browse files Browse the repository at this point in the history
  • Loading branch information
madmaxoft authored Sep 29, 2019
1 parent ba66434 commit 365cbc6
Show file tree
Hide file tree
Showing 122 changed files with 1,255 additions and 845 deletions.
10 changes: 10 additions & 0 deletions Server/Plugins/APIDump/Classes/BlockEntities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ return
},
Notes = "Returns the block Z-coord of the block entity's block",
},
GetRelPos =
{
Returns =
{
{
Type = "Vector3i",
},
},
Notes = "Returns the relative coords of the block entity's block within its chunk",
},
GetRelX =
{
Returns =
Expand Down
216 changes: 216 additions & 0 deletions Server/Plugins/APIDump/Classes/Geometry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,78 @@ end
{
Notes = "<b>OBSOLETE</b>, use Abs() instead.",
},
addedX =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3d",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the X axis",
},
addedXZ =
{
Params =
{
{
Name = "ofsX",
Type = "number",
},
{
Name = "ofsZ",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3d",
},
},
Notes = "Returns a copy of the vector, moved by the specified offsets on the X and Z axes",
},
addedY =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3d",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Y axis",
},
addedZ =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3d",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Z axis",
},
Clamp =
{
Params =
Expand Down Expand Up @@ -1643,6 +1715,78 @@ end
{
Notes = "<b>OBSOLETE</b>, use Abs() instead.",
},
addedX =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3f",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the X axis",
},
addedXZ =
{
Params =
{
{
Name = "ofsX",
Type = "number",
},
{
Name = "ofsZ",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3f",
},
},
Notes = "Returns a copy of the vector, moved by the specified offsets on the X and Z axes",
},
addedY =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3f",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Y axis",
},
addedZ =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3f",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Z axis",
},
Clamp =
{
Params =
Expand Down Expand Up @@ -2168,6 +2312,78 @@ end
{
Notes = "<b>OBSOLETE</b>, use Abs() instead.",
},
addedX =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3i",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the X axis",
},
addedXZ =
{
Params =
{
{
Name = "ofsX",
Type = "number",
},
{
Name = "ofsZ",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3i",
},
},
Notes = "Returns a copy of the vector, moved by the specified offsets on the X and Z axes",
},
addedY =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3i",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Y axis",
},
addedZ =
{
Params =
{
{
Name = "ofs",
Type = "number",
},
},
Returns =
{
{
Type = "Vector3i",
},
},
Notes = "Returns a copy of the vector, moved by the specified offset on the Z axis",
},
Clamp =
{
Params =
Expand Down
13 changes: 6 additions & 7 deletions src/Bindings/ManualBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3477,14 +3477,13 @@ static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S)
}

NIBBLETYPE a_BlockMeta = static_cast<NIBBLETYPE>(tolua_tonumber(tolua_S, 2, 0));
int a_OutputX, a_OutputY, a_OutputZ;
bool res = self->GetOutputBlockPos(a_BlockMeta, a_OutputX, a_OutputY, a_OutputZ);
tolua_pushboolean(tolua_S, res);
if (res)
auto res = self->GetOutputBlockPos(a_BlockMeta);
tolua_pushboolean(tolua_S, res.first);
if (res.first)
{
tolua_pushnumber(tolua_S, static_cast<lua_Number>(a_OutputX));
tolua_pushnumber(tolua_S, static_cast<lua_Number>(a_OutputY));
tolua_pushnumber(tolua_S, static_cast<lua_Number>(a_OutputZ));
tolua_pushnumber(tolua_S, static_cast<lua_Number>(res.second.x));
tolua_pushnumber(tolua_S, static_cast<lua_Number>(res.second.y));
tolua_pushnumber(tolua_S, static_cast<lua_Number>(res.second.z));
return 4;
}
return 1;
Expand Down
Loading

0 comments on commit 365cbc6

Please sign in to comment.