Skip to content

Block sets and DataGen

Patrik Pilát edited this page Jun 14, 2026 · 1 revision

Block Sets and Datagen

Orrery includes a small framework for generating a planet's "block set" — stone, sand, and ore variants — with minimal manual work. This page covers how it works and how to extend it.

What a block set includes

For a planet registered with OrreryBlocks.registerPlanetBlockSet(planetName, ores), the following blocks are created automatically:

  • orrery:<planet>_stone
  • orrery:<planet>_sand
  • orrery:<planet>_<ore>_ore for each ore in the provided list

Each block gets a corresponding BlockItem, registered automatically.

Registration

Block sets are registered once, during mod construction, before the deferred registers are bound to the event bus:

OrreryBlocks.registerPlanetBlockSet("eris", List.of("zinc", "copper", "tungsten", "titanium", "glowstone"));
OrreryBlocks.register(modEventBus);

All registered blocks are tracked in:

OrreryBlocks.PLANET_BLOCKS: Map<String, Map<String, DeferredBlock<Block>>>

keyed first by planet name, then by block key ("stone", "sand", "<ore>_ore").

Models and the ore overlay system

The overlay parent model

Ore blocks use a custom parent model, orrery:block/ore_overlay, defined once at:

assets/orrery/models/block/ore_overlay.json

This model defines two overlapping full-cube elements at the same position: the base layer (#all) and an overlay layer (#overlay) rendered with minecraft:cutout. This mirrors the technique vanilla uses for grass block tinting — two coplanar layers, the top one with transparency.

Overlay textures

Ore overlay textures live at:

assets/orrery/textures/block/overlays/z_<ore>_overlay.png

These are transparent-background textures containing only the ore speckles — no stone background. Overlay textures are shared across all planets: a z_zinc_overlay.png is reused for eris_zinc_ore, ceres_zinc_ore, or any other planet's zinc ore, since the underlying stone texture differs per planet but the ore speckle pattern doesn't need to.

Orrery's current overlay set (zinc, copper, tungsten, titanium, glowstone) was adapted from Northstar Redux's own ore textures for visual consistency.

Datagen for ore models

OrreryBlockStateProvider iterates PLANET_BLOCKS and, for each *_ore block, generates a model referencing:

  • "all"orrery:block/<planet>_stone
  • "overlay"orrery:block/overlays/z_<ore>_overlay

with parent orrery:block/ore_overlay. This means adding a new planet with existing ore types requires no new overlay textures — only the planet's base stone/sand textures.

What you need to supply per planet

  • assets/orrery/textures/block/<planet>_stone.png
  • assets/orrery/textures/block/<planet>_sand.png

What you need to supply per new ore type (only once, ever)

  • assets/orrery/textures/block/overlays/z_<ore>_overlay.png

Language entries

OrreryLanguageProvider generates display names automatically by splitting block keys on underscores and capitalizing each word:

  • "stone" → "Stone"
  • "zinc_ore" → "Zinc Ore"

Combined with the planet's display name (capitalized planet name), this produces entries like "Eris Stone" and "Eris Zinc Ore".

Tags and pickaxe tiers

OrreryBlockTagProvider assigns:

  • minecraft:mineable/pickaxe to stone and all ore blocks
  • minecraft:mineable/shovel to sand blocks
  • Tier-gating tags (needs_stone_tool, needs_iron_tool, etc.) to ores, based on a per-ore-type mapping

The tier mapping is a simple Map<String, TagKey<Block>>:

private static final Map<String, TagKey<Block>> ORE_TOOL_TIERS = Map.of(
    "zinc", BlockTags.NEEDS_STONE_TOOL,
    "tungsten", BlockTags.NEEDS_IRON_TOOL,
    "titanium", BlockTags.NEEDS_IRON_TOOL
    // copper and glowstone intentionally absent — no tier tag needed (wood/any pickaxe)
);

Ores without an entry in this map get mineable/pickaxe only, meaning any pickaxe (including wood) can mine them. This is correct for copper and glowstone.

Loot tables

OrreryBlockLootProvider generates loot tables per block. The current pattern:

  • Stone and sand — drop themselves (dropSelf)
  • Ores that drop raw materials (zinc, copper, tungsten, titanium) — use createMultipleOreDrops(block, rawItem, min, max), which handles Silk Touch (drops the ore block itself) and Fortune (increases raw material yield), with explosion decay applied
  • Ores that drop finished materials directly (glowstone) — same createMultipleOreDrops pattern, but with the finished item (e.g. Items.GLOWSTONE_DUST) in place of a raw material item — matching vanilla's quartz/diamond ore behavior

Referencing items from other mods

Raw material items (e.g. raw_zinc, raw_titanium) may come from Create or Northstar rather than being defined in Orrery. Reference them by exact registry ID via BuiltInRegistries.ITEM:

Item rawZinc = BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("create", "raw_zinc"));

Tags are not suitable for this — a TagKey<Item> resolves to a collection, not a single specific item, so the exact registry ID of the intended drop must be known and referenced directly.

Adding a new ore type — checklist

  1. Create assets/orrery/textures/block/overlays/z_<ore>_overlay.png (transparent background, speckle pattern only)
  2. Decide on pickaxe tier; add an entry to ORE_TOOL_TIERS if it's stone tier or higher
  3. Decide on drop behavior (raw material vs. finished item) and reference the correct item ID in OrreryBlockLootProvider
  4. Add the ore name to registerPlanetBlockSet(...) calls for any planet that should have it
  5. Run ./gradlew runData and verify generated models, lang entries, tags, and loot tables