stewbeet.plugins.compatibilities.simpledrawer
The compatibilities.simpledrawer plugin provides integration with the SimpleDrawer datapack's
compacting drawer functionality. It automatically detects material blocks and their variants
(ingots, nuggets) from your definitions and generates the necessary functions and data
to enable automatic compacting/decompacting in SimpleDrawer's compacting drawers.
Required: Your definition plugin (see definitions_setup.md for details)
Optional: SimpleDrawer datapack (external dependency)
Material Structure: Items must follow naming conventions (material_block, material_ingot, material_nugget)
Some Features Showcase
Automatic compatibility with SimpleDrawer's compating drawer:
Source Code: stewbeet/plugins/compatibilities/simpledrawer/__init__.py
What it does
- Integrates custom materials with SimpleDrawer's compacting drawer system
- Automatically detects material blocks and their variants (ingots, nuggets)
- Generates conversion ratio calculations for proper compacting
- Creates material data structures for SimpleDrawer compatibility
- Handles both regular and raw material variants
- Sets up proper NBT data and storage for material identification
Configuration
Basic Example Configuration
pipeline:
- ...
- stewbeet.plugins.compatibilities.simpledrawer
- ...
# No specific configuration required - automatically detects materials
# Works with existing material definitions that follow naming conventions
# Materials must have proper smithed.dict structure in custom_data (automatic if you used definitions helper functions)Configuration Options for item definitions
| Option | Type | Default | Description |
|---|---|---|---|
material_block | string | Auto-detected | Material blocks ending with _block (e.g., steel_block) |
material_ingot | string | Auto-detected | Material ingots (e.g., steel_ingot, steel_fragment) |
material_nugget | string | Auto-detected | Material nuggets (e.g., steel_nugget) |
smithed.dict | object | Required | Smithed convention structure in custom_data for material identification |
Features
Material Detection and Variant Discovery
Automatically scans definitions for material blocks and identifies their variants:
- π§± Detects blocks ending with
_blocksuffix - π·οΈ Extracts material base from smithed.dict structure
- π Handles both regular materials and raw material variants
- π Identifies ingot variants (base, _ingot, _fragment suffixes)
- β¨ Discovers nugget forms when available
Conversion Ratio Calculation
Calculates conversion ratios between material variants:
- π Analyzes crafting recipes to determine conversion rates
- π’ Supports both shaped and shapeless recipe patterns
- π§± Calculates ingots per block ratio (default: 9)
- β¨ Determines nuggets per ingot ratio (default: 9)
- π Handles single-ingredient recipe detection
SimpleDrawer Integration
Creates the necessary function tags and data structures for mod integration:
- π·οΈ Links to SimpleDrawer's material function tag system
- π¦ Creates material detection functions with NBT checking
- π― Sets up proper namespace and item identification
- β‘ Optimizes with success flags to prevent redundant processing
Material Data Structure Generation
Generates material data for each detected material:
- π·οΈ Creates material identification with proper naming
- π’ Sets conversion ratios for ingots and nuggets
- π¦ Links item data from project storage
- π― Organizes data by material type (block=0, ingot=1, nugget=2)
- β Sets success flags for proper mod interaction
Variant-Specific Function Generation
Creates individual functions for each material variant:
- π Organizes functions by material base name
- π― Creates variant-specific entry points (block, ingot, nugget)
- π Links to main material processing function
- βοΈ Sets appropriate type identifiers for SimpleDrawer
Next steps
- Using datapack libraries: the integrations this plugin targets.
- All plugins: the rest of the pipeline, in the order it runs.
- Configuring the build: enabling, ordering and configuring plugins.