class
Rosegold::Slot
- Rosegold::Slot
- Reference
- Object
Direct Known Subclasses
Defined in:
rosegold/inventory/slot.crConstructors
Class Method Summary
- .enchantment_registry : Array(String)
- .enchantment_registry=(enchantment_registry : Array(String))
- .max_repair_cost : Int32
- .max_repair_cost=(max_repair_cost : Int32)
- .read(io) : Rosegold::Slot
-
.read_component_patch(io) : Tuple(Hash(String, DataComponent), Set(String))
Reads a DataComponentPatch (add-count, remove-count, then the add/remove entries).
-
.read_item_stack_template(io) : Rosegold::Slot
ItemStackTemplate (775+): item_id and count are read in the OPPOSITE order from Slot (item-then-count), but the trailing DataComponentPatch is identical.
Instance Method Summary
- #components_to_add : Hash(String, DataComponent)
- #components_to_add=(components_to_add : Hash(String, DataComponent))
- #components_to_remove : Set(String)
- #components_to_remove=(components_to_remove : Set(String))
- #count : UInt32
- #count=(count : UInt32)
- #damage
- #decrement
- #durability
- #edible? : Bool
- #efficiency
- #empty?
- #enchanted? : Bool
- #enchantments
- #full?
- #item : MCData::Item
- #item_id_int : UInt32
- #item_id_int=(value : UInt32)
- #make_empty
- #matches?(item_id_int : UInt32)
- #matches?(name : String)
- #matches?(spec : Rosegold::Slot -> _)
- #matches?(&)
- #max_durability
- #max_stack_size
- #name : String
- #needs_repair? : Bool
- #present?
- #repair_cost : Int32
- #swap_with(other)
- #to_s(io)
- #tool_component : DataComponents::Tool | Nil
-
#tool_speed_for_tag(tag : String) : Float32 | Nil
Get the mining speed from the tool component for a given block tag
- #worth_repairing? : Bool
- #write(io)
- #write_item_stack_template(io) : Nil
Constructor Detail
Class Method Detail
Reads a DataComponentPatch (add-count, remove-count, then the add/remove entries). Shared by Slot.read and read_item_stack_template, which differ only in the preceding item_id/count ordering.
ItemStackTemplate (775+): item_id and count are read in the OPPOSITE order from Slot (item-then-count), but the trailing DataComponentPatch is identical. Used by recipe SlotDisplayItemStack and the sulfur_cube_content component.
Instance Method Detail
Get the mining speed from the tool component for a given block tag