-
Notifications
You must be signed in to change notification settings - Fork 0
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.
For a planet registered with OrreryBlocks.registerPlanetBlockSet(planetName, ores), the following blocks are created automatically:
orrery:<planet>_stoneorrery:<planet>_sand-
orrery:<planet>_<ore>_orefor each ore in the provided list
Each block gets a corresponding BlockItem, registered automatically.
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").
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.
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.
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.
assets/orrery/textures/block/<planet>_stone.pngassets/orrery/textures/block/<planet>_sand.png
assets/orrery/textures/block/overlays/z_<ore>_overlay.png
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".
OrreryBlockTagProvider assigns:
-
minecraft:mineable/pickaxeto stone and all ore blocks -
minecraft:mineable/shovelto 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.
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
createMultipleOreDropspattern, but with the finished item (e.g.Items.GLOWSTONE_DUST) in place of a raw material item — matching vanilla's quartz/diamond ore behavior
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.
- Create
assets/orrery/textures/block/overlays/z_<ore>_overlay.png(transparent background, speckle pattern only) - Decide on pickaxe tier; add an entry to
ORE_TOOL_TIERSif it's stone tier or higher - Decide on drop behavior (raw material vs. finished item) and reference the correct item ID in
OrreryBlockLootProvider - Add the ore name to
registerPlanetBlockSet(...)calls for any planet that should have it - Run
./gradlew runDataand verify generated models, lang entries, tags, and loot tables