πŸ–ΌοΈ stewbeet.plugins.custom_paintings

πŸ“„ Source Code: stewbeet/plugins/custom_paintings/__init__.py πŸ”—

πŸ”— Dependencies

  • βœ… Required: StewBeet framework initialization
  • βœ… Required: Your definition plugin (see definitions_setup.md for details)
  • βœ… Required: Texture file in the configured textures folder
  • πŸ“ Position: Should run anywhere between definitions_setup and ingame_manual
    (see basic/beet.yml for an example)

πŸ“‹ Overview

The custom_paintings plugin generates custom paintings for datapacks and resource packs based on item definitions.
It automatically creates painting variants, handles texture registration, and manages the placeable paintings tag system.
(This plugin requires valid item definitions in memory and corresponding texture files to function properly.)

Feature Showcase

Item definition example (source):

Generated variant file (source):

Item in inventory:

Painting placed in a world:

🎯 Purpose

  • πŸ› οΈ Custom Painting Generation - Creates custom painting variants from item definitions
  • 🎨 Texture Management - Automatically registers painting textures in resource pack
  • 🏷️ Metadata Handling - Manages painting titles, authors, and dimensions
  • πŸ“¦ Tag System - Generates placeable painting variant tags
  • πŸ—‚οΈ Asset Organization - Properly structures painting assets in the textures/painting/ folder

βš™οΈ Configuration

🎯 Basic Example Configuration

pipeline: - ... - src.setup_definitions # Load item definitions into memory - ... - stewbeet.plugins.custom_paintings # Generate custom paintings - ... meta: stewbeet: textures_folder: "assets/textures" # Required: Path to texture files

πŸ“‹ Configuration Requirements

SettingTypeRequiredDescription
textures_folderstringβœ… YesPath to folder containing .png texture files for paintings

✨ Features

πŸ–ΌοΈ Painting Variant Generation

  • πŸ“ Automatic Metadata - Sets default author (from project_author) and title (from item name)
  • πŸ”§ Custom Properties - Supports width, height, and custom metadata
  • 🏷️ Asset ID Management - Automatically assigns asset_id as first property
  • 🚫 Placeable Control - Optional not_placeable flag to exclude from placement

🎨 Texture Processing

  • πŸ“ Smart Discovery - Automatically finds .png files matching item names
  • πŸ” Path Resolution - Searches recursively in textures folder
  • ⚠️ Duplicate Detection - Warns about multiple matching textures
  • οΏ½ Resource Registration - Places textures in painting/ namespace
  • πŸŽ›οΈ Metadata Support - Handles .mcmeta files for animated textures

🏷️ Tag Management

  • πŸ“‹ Placeable Tag - Automatically generates minecraft:placeable painting variant tag
  • 🎯 Selective Inclusion - Only includes paintings not marked as not_placeable
  • πŸ”§ Namespace Organization - Properly namespaces painting variant references

πŸ“ Item Definition Structure

🎯 Basic Painting Definition

# Example from setup_definitions.py Mem.definitions["stewbeet_painting"] = { "id": "minecraft:painting", core.PAINTING_DATA: { "author": {"text":"Stoupy","color":"yellow"}, # Optional: defaults to project_author "title": {"text":"Da' Icon","color":"gray"}, # Optional: defaults to item name "width": 2, # Required: painting width in blocks "height": 2 # Required: painting height in blocks } }

πŸ–ΌοΈ Advanced Configuration Options

core.PAINTING_DATA: { "author": {"text": "Artist Name", "color": "gold"}, # Author text component "title": {"text": "Painting Title", "color": "blue"}, # Title text component "width": 1, # Width in blocks (1-16) "height": 1, # Height in blocks (1-16) "not_placeable": True # Optional: exclude from placeable tag }

πŸ“ File Structure Example

πŸ–ΌοΈ Texture Organization

assets/textures/
β”œβ”€β”€ stewbeet_painting.png          # Main painting texture
β”œβ”€β”€ subfolder/
β”‚   β”œβ”€β”€ another_painting.png        # Another painting
β”‚   └── another_painting.png.mcmeta # Optional animation metadata
└── ...

πŸ“¦ Generated Files

# Datapack
data/your_namespace/painting_variant/
β”œβ”€β”€ stewbeet_painting.json          # Painting variant definition
└── another_painting.json

data/minecraft/painting_variant_tag/
└── placeable.json                  # Tag containing all placeable paintings

# Resource Pack  
assets/your_namespace/textures/painting/
β”œβ”€β”€ stewbeet_painting.png           # Registered painting texture
β”œβ”€β”€ another_painting.png
└── another_painting.png.mcmeta