-
Notifications
You must be signed in to change notification settings - Fork 0
Banner Pattern Data Generation
The @GenerateBannerPattern annotation is a data generation annotation that automatically creates banner pattern definitions for Minecraft mods using the Temporal API. It eliminates the need for manual JSON configuration by generating the necessary data providers at runtime.
- Automatic data generation: Creates banner pattern definitions without manual JSON files
- Pattern registration: Registers banner patterns for use in loom and banner crafting
- Integration with data providers: Seamlessly integrates with NeoForge's banner pattern data generation system
- Type safety: Ensures compile-time validation of banner pattern configurations
-
Annotation processing: The annotation is processed by
GenerateBannerPatternStrategyduring the data generation phase -
Field extraction: The strategy extracts the
ResourceKey<BannerPattern>from the annotated field -
Description creation: Creates a
BannerPatternDescriptioncontaining the pattern resource key -
Provider registration: Automatically registers the banner pattern with
ApiBannerPatternProviderfor data generation
Apply the annotation to static fields of type ResourceKey<BannerPattern>:
public final class ModBannerPatterns {
@GenerateBannerPattern
public static final ResourceKey<BannerPattern> CUSTOM_PATTERN =
ResourceUtils.createKey(Registries.BANNER_PATTERN, "custom_pattern");
}The @GenerateBannerPattern annotation has no parameters. It simply marks a ResourceKey<BannerPattern> field for automatic data generation.
The annotation integrates with the Temporal API's strategy system:
-
Strategy implementation:
GenerateBannerPatternStrategyhandles the processing logic -
Provider system: Uses
ApiBannerPatternProviderfor data generation -
Transformer support: Compatible with
BannerPatternTransformerfor additional processing -
Tag integration: Works seamlessly with
@AddBannerPatternTagfor pattern categorization
Use @GenerateBannerPattern when:
- Creating custom banner patterns for your mod
- Defining patterns for use in loom crafting recipes
- Automating data generation for banner customization content
- Ensuring consistent banner pattern configuration across your mod
The annotation is particularly useful for mods with multiple banner patterns, as it centralizes pattern configuration and eliminates manual JSON file management. It's commonly used alongside translation annotations and tag annotations to provide complete pattern definitions with proper localization and categorization.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples