From 32b38fb2649fb282b6446c4e544866c0161aa7da Mon Sep 17 00:00:00 2001 From: mohe2015 Date: Sun, 6 Nov 2016 19:30:19 +0100 Subject: Anticheat fastbreak (#3411) Added block hardness checks when breaking blocks. --- src/BlockInfo.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/BlockInfo.h') diff --git a/src/BlockInfo.h b/src/BlockInfo.h index d42987794..adf370c13 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -70,6 +70,9 @@ public: /** Sound when placing this block */ AString m_PlaceSound; + /** Block's hardness. The greater the value the longer the player needs to break the block. */ + float m_Hardness; + // tolua_end /** Associated block handler. */ @@ -89,6 +92,7 @@ public: 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 AString GetPlaceSound (BLOCKTYPE a_Type) { return Get(a_Type).m_PlaceSound; } + inline static float GetHardness (BLOCKTYPE a_Type) { return Get(a_Type).m_Hardness; } // tolua_end @@ -112,6 +116,7 @@ protected: , m_CanBeTerraformed(false) , m_BlockHeight(1.0) , m_PlaceSound("") + , m_Hardness(0.0f) , m_Handler(nullptr) {} -- cgit v1.2.3