πΌοΈ stewbeet.plugins.resource_pack.check_power_of_2
π Source Code: stewbeet/plugins/resource_pack/check_power_of_2/__init__.py π
π Dependencies
- β
Required: Resource pack textures (from previous plugins like
resource_pack.item_models) - π Position: Can run at any position but after textures are added to the project
(seebasic/beet.ymlfor an example)
π Overview
The check_power_of_2 plugin validates that all textures in the resource pack have power-of-2 dimensions.
This validation helps ensure optimal performance and compatibility with Minecraft's texture system.
(This plugin requires textures to be already processed and added to the resource pack.)
Features Showcase
Warning messages:

π― Purpose
- π Validates texture dimensions for power-of-2 compliance (2x2, 4x4, 8x8, 16x16, etc.)
- β οΈ Warns about non-compliant textures that may cause performance issues
- π Checks both item and block textures in the resource pack
- π¨ Excludes animation textures and GUI elements with valid aspect ratios
- π‘οΈ Helps maintain texture optimization standards
βοΈ Configuration
π― Basic Example Configuration
pipeline: - ... - "stewbeet.plugins.resource_pack.check_power_of_2" - ...
π Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
| No configuration options | - | - | This plugin runs without any configuration parameters |
β¨ Features
π Power-of-2 Validation
- π Checks texture dimensions using binary bit counting (
bin(dimension).count("1") == 1) - β Validates that width and height are powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024...)
- π― Focuses on item and block textures using pattern matching (
*item/*,*block/*)
π¨ Smart Filtering
- π± Excludes animation textures (where height is divisible by width and not square)
- πΌοΈ Skips GUI textures and valid rectangular sprites
- π Only flags problematic square textures or invalid aspect ratios
- β‘ Reduces false positives for intentional non-square textures
β οΈ Warning System
- π Generates detailed warning messages for non-compliant textures
- π Shows exact file paths and dimensions for easy identification
- π Lists all problematic textures in a single comprehensive report
Note: This plugin provides validation benefits rather than direct code implementation for performance optimization.