1
0

Merge pull request #3897 from peterbell10/PlaceSound

cBlockInfo: Remove/deprecate place sound
This commit is contained in:
Tiger Wang 2017-08-13 12:37:37 +01:00 committed by GitHub
commit fdd4b6e7c4
3 changed files with 62 additions and 16 deletions

View File

@ -202,7 +202,7 @@ return
Type = "string", Type = "string",
}, },
}, },
Notes = "Returns the name of the sound that is played when placing the block of this type.", Notes = "(<b>DEPRECATED</b>) Not used by cuberite internally and always returns an empty string.",
}, },
GetSpreadLightFalloff = GetSpreadLightFalloff =
{ {
@ -378,16 +378,6 @@ return
Type = "bool", Type = "bool",
Notes = "Can a piston break this block?", Notes = "Can a piston break this block?",
}, },
m_PlaceSound =
{
Type = "string",
Notes = "The name of the sound that is placed when a block is placed.",
},
m_RequiresSpecialTool =
{
Type = "bool",
Notes = "Does this block require a tool to drop?",
},
m_SpreadLightFalloff = m_SpreadLightFalloff =
{ {
Type = "number", Type = "number",

View File

@ -291,6 +291,62 @@ tolua_lerror:
static int tolua_cBlockInfo_GetPlaceSound(lua_State * tolua_S)
{
cLuaState L(tolua_S);
if (
!L.CheckParamStaticSelf("cBlockInfo") ||
!L.CheckParamNumber(2)
)
{
return 0;
}
L.Push("");
LOGWARNING("cBlockInfo:GetPlaceSound() is deprecated");
L.LogStackTrace(0);
return 1;
}
static int tolua_get_cBlockInfo_m_PlaceSound(lua_State * tolua_S)
{
cLuaState L(tolua_S);
if (!L.CheckParamSelf("const cBlockInfo"))
{
return 0;
}
L.Push("");
LOGWARNING("cBlockInfo.m_PlaceSound is deprecated");
L.LogStackTrace(0);
return 1;
}
static int tolua_set_cBlockInfo_m_PlaceSound(lua_State * tolua_S)
{
cLuaState L(tolua_S);
if (!L.CheckParamSelf("cBlockInfo"))
{
return 0;
}
LOGWARNING("cBlockInfo.m_PlaceSound is deprecated");
L.LogStackTrace(0);
return 0;
}
/* method: Trace of class cTracer */ /* method: Trace of class cTracer */
static int tolua_cTracer_Trace(lua_State * a_LuaState) static int tolua_cTracer_Trace(lua_State * a_LuaState)
{ {
@ -439,6 +495,11 @@ void DeprecatedBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "StringToMobType", tolua_AllToLua_StringToMobType00); tolua_function(tolua_S, "StringToMobType", tolua_AllToLua_StringToMobType00);
tolua_beginmodule(tolua_S, "cBlockInfo");
tolua_function(tolua_S, "GetPlaceSound", tolua_cBlockInfo_GetPlaceSound);
tolua_variable(tolua_S, "m_PlaceSound", tolua_get_cBlockInfo_m_PlaceSound, tolua_set_cBlockInfo_m_PlaceSound);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cTracer"); tolua_beginmodule(tolua_S, "cTracer");
tolua_function(tolua_S, "Trace", tolua_cTracer_Trace); tolua_function(tolua_S, "Trace", tolua_cTracer_Trace);
tolua_endmodule(tolua_S); tolua_endmodule(tolua_S);

View File

@ -55,9 +55,6 @@ public:
/** Block height */ /** Block height */
float m_BlockHeight; float m_BlockHeight;
/** Sound when placing this block */
AString m_PlaceSound;
/** Block's hardness. The greater the value the longer the player needs to break the block. */ /** Block's hardness. The greater the value the longer the player needs to break the block. */
float m_Hardness; float m_Hardness;
@ -85,7 +82,6 @@ public:
inline static bool FullyOccupiesVoxel (BLOCKTYPE a_Type) { return Get(a_Type).m_FullyOccupiesVoxel; } inline static bool FullyOccupiesVoxel (BLOCKTYPE a_Type) { return Get(a_Type).m_FullyOccupiesVoxel; }
inline static bool CanBeTerraformed (BLOCKTYPE a_Type) { return Get(a_Type).m_CanBeTerraformed; } inline static bool CanBeTerraformed (BLOCKTYPE a_Type) { return Get(a_Type).m_CanBeTerraformed; }
inline static float GetBlockHeight (BLOCKTYPE a_Type) { return Get(a_Type).m_BlockHeight; } inline static float GetBlockHeight (BLOCKTYPE a_Type) { return Get(a_Type).m_BlockHeight; }
inline static AString GetPlaceSound (BLOCKTYPE a_Type) { return Get(a_Type).m_PlaceSound; }
inline static float GetHardness (BLOCKTYPE a_Type) { return Get(a_Type).m_Hardness; } inline static float GetHardness (BLOCKTYPE a_Type) { return Get(a_Type).m_Hardness; }
// tolua_end // tolua_end
@ -105,7 +101,6 @@ public:
, m_FullyOccupiesVoxel(false) , m_FullyOccupiesVoxel(false)
, m_CanBeTerraformed(false) , m_CanBeTerraformed(false)
, m_BlockHeight(1.0) , m_BlockHeight(1.0)
, m_PlaceSound()
, m_Hardness(0.0f) , m_Hardness(0.0f)
, m_Handler() , m_Handler()
{} {}