30#if PROTOCOL_VERSION < 347
38#if PROTOCOL_VERSION < 347
40 unsigned char metadata = 0;
93 std::vector<std::string>
variables = std::vector<std::string>(0);
94 std::vector<BestTool>
best_tools = std::vector<BestTool>(0);
114 const std::string&
GetName()
const;
164 const float tool_efficiency_additional_speed = 0.0f,
const unsigned char haste = 0,
const unsigned char fatigue = 0,
165 const bool on_ground =
true,
const float speed_factor = 1.0f)
const;
167#if PROTOCOL_VERSION < 347
168 static unsigned int IdMetadataToId(
const int id_,
const unsigned char metadata_);
169 static void IdToIdMetadata(
const unsigned int input_id,
int& output_id,
unsigned char& output_metadata);
195 bool operator()(
const std::string* a,
const std::string* b)
const
247 std::map<const std::string*, const std::string*, string_ptr_compare>
variables;
Vector3< double > GetClosestPoint(const Position &block_pos, const Vector3< double > &pos) const
Get the closest point on this blockstate placed at block_pos from a reference pos.
static const std::string * GetUniqueStringPtr(const std::string &s)
bool IsWaterOrWaterlogged() const
const std::string & GetName() const
BlockstateId GetId() const
bool IsDownBubbleColumn() const
bool IsTransparent() const
bool IsFluidOrWaterlogged() const
static std::set< std::string > unique_strings
bool MatchCondition(const std::string &condition) const
Check if a given string condition match this blockstate variables.
std::set< AABB > GetCollidersAtPos(const Position &pos) const
std::vector< size_t > models_indices
unsigned char GetModelId(const Position &pos) const
std::map< const std::string *, const std::string *, string_ptr_compare > variables
void LoadWeightedModels(const std::deque< std::pair< Model, int > > &models_to_load)
float GetHardness() const
bool IsFluidFalling() const
bool IsBubbleColumn() const
TintType GetTintType() const
bool IsPowderSnow() const
Vector3< double > GetHorizontalOffsetAtPos(const Position &pos) const
size_t GetNumModels() const
void LoadProperties(const BlockstateProperties &properties)
static void UpdateModelsWithAtlasData(const Renderer::Atlas *atlas)
std::vector< int > models_weights
std::vector< BestTool > best_tools
bool IsUpBubbleColumn() const
static std::deque< Model > unique_models
bool IsWaterlogged() const
std::bitset< static_cast< size_t >(BlockstateFlags::NUM_FLAGS)> flags
BlockstateId blockstate_id
float GetFriction() const
const std::string * m_name
static size_t GetUniqueModelIndex(const Model &model)
float GetFluidHeight() const
Get fluid height for this block.
const std::string & GetVariableValue(const std::string &variable) const
static std::map< std::string, ProtocolCraft::Json::Value > cached_jsons
bool IsScaffolding() const
const Model & GetModel(const unsigned short index) const
float GetMiningTimeSeconds(const ToolType tool_type, const ToolMaterial tool_material, const float tool_efficiency_additional_speed=0.0f, const unsigned char haste=0, const unsigned char fatigue=0, const bool on_ground=true, const float speed_factor=1.0f) const
Compute the amount of time (in s) required to mine this block.
bool GetBoolFromCondition(const ProtocolCraft::Json::Value &condition) const
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
unsigned int BlockstateId
bool climbable
True if can be used as a ladder.
bool powder_snow
True if this block is powder_snow.
ProtocolCraft::Json::Value down_bubble_column
True if this block is a bubble column going down.
bool cobweb
True if this block is cobweb.
bool water
True for water.
std::vector< std::string > variables
bool honey
True if this block is honey.
float friction
Slipperiness coefficient.
std::vector< BestTool > best_tools
bool slime
True if this block is slime.
float horizontal_offset
Max horizontal offset value of the colliders (for bamboo and pointed dripstone)
float hardness
Digging hardness.
bool berry_bush
True if this block is sweet_berry_bush.
ProtocolCraft::Json::Value colliders
bool transparent
True if not a full 1x1x1 block OR at least one face texture has transparency.
ProtocolCraft::Json::Value solid
True if can't go through it.
bool soul_sand
True if this block is soul_sand.
bool custom
True if the model is a custom one (chests/banners etc...)
ProtocolCraft::Json::Value waterlogged
True for blocks that are always waterlogged (kelp, seagrass...)
bool any_tool_harvest
True if this block drops item when broken with no tool.
bool air
True if the block is air (air, cave_air, void and structure_void are counted as air)
bool hazardous
True if block can hurt when walking in/on it.
ProtocolCraft::Json::Value up_bubble_column
True if this block is a bubble column going up.
bool scaffolding
True if this block is scaffolding.
bool bed
True if this block has the BEDS tag.
bool operator()(const std::string *a, const std::string *b) const