Files
feldenr 1876805803 Fix armor textures and implement new armor material system
- Created ShardDiamondArmorMaterial class with proper getName() returning "custom_ore_gen:shard_diamond"
- Updated all armor items to use the new material instance
- Added new armor textures from new_armor folder
- Fixed armor texture loading by using correct modid:name format in getName()
- Added CLAUDE.md for project documentation
- Added armor crafting recipes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 11:24:12 +01:00

5.3 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Custom Ore Gem is a Minecraft Forge 1.20.1 mod (mod ID: custom_ore_gen) that modifies ore distribution and adds Diamond Shard-tier tools and armor. This is an MCreator project - code in src/main/java is partially regenerated on each build.

Key: This mod is designed to work with KubeJS and is not meant to be used standalone.

Build Commands

# Build the mod (generates .jar in build/libs/)
./gradlew build

# Run client for testing
./gradlew runClient

# Run server for testing
./gradlew runServer

# Clean build artifacts
./gradlew clean

The built JAR is named custom_ore_gen-{version}.jar and appears in build/libs/.

Architecture

MCreator Workflow

This project uses MCreator. Important files contain regeneration markers:

// Start of user code block [name]
// End of user code block [name]

Always preserve code between these markers when editing. The file header notes which files are regenerated (e.g., CustomOreGenModItems.java).

Package Structure

net.mcreator.customoregen/
├── CustomOreGenMod.java          # Main mod class, registers event bus
├── OresCommand.java              # /ores command implementation
├── block/                        # Ore block classes (16 blocks)
├── item/                         # Items (Diamond Shard, tools, armor, Paxel, OreBiomeFinder)
├── config/                       # Forge configuration system (ModConfigs.java)
├── procedures/                   # Game logic (ConfigurableOreDropsProcedure, OreexperienceProcedure)
└── init/
    ├── CustomOreGenModBlocks.java  # Block registry (deferred register)
    ├── CustomOreGenModItems.java   # Item registry (REGENERATED)
    └── CustomOreGenModTabs.java    # Creative tabs registry

Ore Generation System

The mod uses Forge biome modifiers to distribute ores based on biome temperature tags. The architecture:

  1. Biome Tags (src/main/resources/data/custom_ore_gen/tags/worldgen/biome/):

    • cold_biomes.json - Cold biomes (lapis, concentrated diamond)
    • hot_biomes.json - Hot biomes (pure gold, copper, redstone)
    • mountain_biomes.json - Mountain biomes (high emerald)
    • rare_biomes.json - Rare biomes (lower emerald)
    • tempered_biomes.json - Temperate biomes (iron, concentrated coal)
  2. Biome Modifiers (src/main/resources/data/custom_ore_gen/forge/biome_modifier/):

    • Each ore has a JSON file linking it to biome tags
    • Special case: deepslatesharddiamondore_biome_modifier.json uses forge:any for all biomes
  3. Worldgen Features (src/main/resources/data/custom_ore_gen/worldgen/):

    • configured_feature/ - Defines ore vein size and height range
    • placed_feature/ - Places the feature in the world

Diamond Shard Progression Tier

Diamond Shards are an intermediate tier between Iron and Diamond:

  • Items: Diamond Shard (diamondshard) - craft 9 shards into 1 diamond
  • Tools: Pickaxe, Shovel, Axe (200 durability), Paxel (1000 durability, combines all three)
  • Armor: Helmet (3), Chestplate (7), Leggings (5), Boots (2) - Total 17 protection, 1060 durability
  • Repair: All Diamond Shard equipment uses Diamond Shards

Configuration System

Located in src/main/java/net/mcreator/customoregen/config/:

  • ModConfigs.java - Forge configuration with 4 sections: ore_generation, tool_stats, drops, features
  • Generated config file: config/custom_ore_gen-common.toml (created on first run)

Note: As documented in CONFIG_INTEGRATION_GUIDE.md, the configuration system is partially implemented. Tool stats read from config, but ore drops require MCreator procedure integration to fully use config values.

Ore Biome Finder

The OreBiomeFinderItem (item/OreBiomeFinderItem.java) and /ores command (OresCommand.java) detect which mod tags apply to the current biome and list findable ores. This works by checking if the biome is in any of the custom biome tags.

Adding a New Ore

To add a new ore type (requires MCreator for full integration):

  1. Create the block in MCreator
  2. Add loot table at src/main/resources/data/custom_ore_gen/loot_tables/blocks/{orename}.json
  3. Add configured_feature JSON in worldgen/configured_feature/
  4. Add placed_feature JSON in worldgen/placed_feature/
  5. Create biome_modifier JSON linking to a biome tag (or create a new tag in tags/worldgen/biome/)
  6. Register in CustomOreGenModBlocks.java

Biomes O' Plenty Integration

The mod includes BOP biome support through additional biome tags. When adding BOP biomes, add them to the appropriate category tag JSON files in tags/worldgen/biome/.

User Code Sections

When editing MCreator-generated files, only modify code between:

// Start of user code block [section_name]
// End of user code block [section_name]

For example, in CustomOreGenModItems.java:

// Start of user code block custom items
// End of user code block custom items

Testing

After making changes:

  1. Run ./gradlew build to verify compilation
  2. Run ./gradlew runClient to test in-game
  3. Check logs in run/logs/ for errors

Version Info

  • Minecraft: 1.20.1
  • Forge: 47.3.0
  • Java: 17
  • Current mod version: 2.0.8 (defined in build.gradle)