Skip to main content

Module container

Module container 

Source
Expand description

Container trait for anything that holds items.

Containers are the base abstraction for anything that can hold items, including player inventories, chests, barrels, furnaces, etc.

ModulesΒ§

crafting πŸ”’
Crafting containers and related types.
helper πŸ”’
NBT loading shared by containers.
result πŸ”’
simple πŸ”’

StructsΒ§

CraftingContainer
A container for crafting grid items.
ResultContainer
A simple container for holding a single crafting result.
SimpleContainer
A Simple Container

ConstantsΒ§

DEFAULT_DISTANCE_BUFFER
Extra reach allowed when validating containers and menus.

TraitsΒ§

Container
Something that contains items. I also use container interchangeably with inventory as they mean approximately the same thing. But inventory could also refer to the player’s inventory. Example: crate::player::player_inventory::PlayerInventory, crate::inventory::container::SimpleContainer

FunctionsΒ§

calculate_redstone_signal_from_container
Calculates the redstone comparator signal strength (0-15) from a container.
clear_or_count_matching_stack πŸ”’
Removes or counts matching items in one stack using vanilla /clear semantics.
load_all_items
Loads the Items list into items, skipping entries that fail to decode or whose slot is out of range.
matching_item_count πŸ”’