class
Rosegold::Block
- Rosegold::Block
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
rosegold/models/block.crConstructors
- .from_block_state_id(state_id : UInt16) : Block
- .new(pull : JSON::PullParser)
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
Instance Method Summary
- #best_tool?(slot : Slot)
- #break_damage(main_hand : Slot, player : Player, creative : Bool = false) : Float64
- #break_time(main_hand : Slot, player : Player, creative : Bool = false) : Int32
- #can_harvest?(slot : Slot)
- #default_state : UInt16
- #display_name : String
- #hardness : Float32
- #harvest_tools : Hash(String, Bool) | Nil
- #id : UInt16
- #id_str : String
- #material : String
- #material_tool_multipliers
- #max_state_id : UInt16
- #min_state_id : UInt16
- #stack_size : UInt8
-
#states : Array(MCData::BlockProperty)
Not individual block states, but the properties that, in combination, make up each block state.
-
#tool_speed_from_any_material(slot : Slot) : Float64 | Nil
Search all materials for the tool's speed multiplier.
Constructor Detail
Instance Method Detail
def states : Array(MCData::BlockProperty)
#
Not individual block states, but the properties that, in combination, make up each block state. Empty array if block has only one state.
Search all materials for the tool's speed multiplier. Handles cases where the block's material doesn't list all valid tools (e.g. obsidian's "incorrect_for_wooden_tool" omits diamond/netherite pickaxes).