chore: remove MCreator workspace file, backups and obsolete docs

- Delete custom_ore_gen.mcreator (MCreator workspace definition) and
  the tracked .mcreator/ backup directory; add .mcreator/ to .gitignore
- Delete CONFIG_INTEGRATION_GUIDE.md (obsolete MCreator how-to,
  self-described as historical)
- README/CLAUDE/AGENTS: update package path (com.aulyrius.customoregen),
  drop MCreator workflow instructions, fix stale config/item docs
This commit is contained in:
feldenr
2026-07-30 11:19:44 +02:00
parent e3e4296c33
commit 9a159226aa
15 changed files with 42 additions and 6183 deletions
+32 -52
View File
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Overview
Custom Ore Gem is a Minecraft **NeoForge** 1.21.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.
Custom Ore Gem is a Minecraft **NeoForge** 1.21.1 mod (mod ID: `custom_ore_gen`) that modifies ore distribution and adds Diamond Shard-tier tools and armor. Originally scaffolded with MCreator, the project is now **fully hand-maintained** - no file is regenerated automatically.
**Note**: This mod replaces vanilla ore distribution with custom biome-based ore generation. For full functionality, it's recommended to use with KubeJS to remove vanilla ores (manual setup required).
@@ -31,37 +31,30 @@ The built JAR is named `custom_ore_gen-{version}.jar` and appears in `build/libs
## Architecture
### MCreator Workflow
### Code Ownership
This project uses MCreator. Files marked with `MCreator note: This file will be REGENERATED on each build.` at the top will be completely overwritten on each build. These include:
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModBlocks.java`
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModItems.java`
- `src/main/java/net/mcreator/customoregen/init/CustomOreGenModTabs.java`
**Protected User Code Blocks**: Only `CustomOreGenModItems.java` contains protected user code blocks:
```java
// Start of user code block custom items
// End of user code block custom items
```
**Always preserve code between these markers** when editing. All custom items (Ore Biome Finder, Shard Diamond armor, Paxel) are registered in this section.
The project was originally generated by MCreator but is no longer maintained with it.
Every file in `src/main/java` is hand-maintained and safe to edit; there is no
regeneration step and no protected code blocks.
### Package Structure
```
net.mcreator.customoregen/
├── CustomOreGenMod.java # Main mod class, registers event bus
com.aulyrius.customoregen/
├── CustomOreGenMod.java # Main mod class
├── OresCommand.java # /ores command implementation
├── ShardDiamondArmorMaterial.java # Armor material class for Shard Diamond armor
├── OreTypes.java # Block -> ore type mapping (single source of truth)
├── block/ # Ore block classes (17 blocks)
├── item/ # Items (Diamond Shard, tools, armor, Paxel, OreBiomeFinder)
├── config/ # NeoForge configuration system (ModConfigs.java)
├── config/ # NeoForge configuration system (ModConfigs, ConfigHelper)
├── event/ # Event handlers (OreBreakEventHandler)
├── procedures/ # Game logic (ConfigurableOreDropsProcedure, OreexperienceProcedure)
├── loot/ # CustomOreLootModifier (Global Loot Modifier for drops)
├── mixin/ # MultiNoiseBiomeSourceMixin (Deep Dark latitude lock)
├── procedures/ # Game logic (ConfigurableOreDropsProcedure, OreDropMath)
├── worldgen/ # Latitude zones, density function, placement, biome gating
└── init/
├── CustomOreGenModBlocks.java # Block registry (deferred register)
├── CustomOreGenModItems.java # Item registry (REGENERATED)
├── CustomOreGenModItems.java # Item registry
└── CustomOreGenModTabs.java # Creative tabs registry
```
@@ -105,15 +98,15 @@ Diamond Shards are an intermediate tier between Iron and Diamond:
### Configuration System
Located in `src/main/java/net/mcreator/customoregen/config/`:
Located in `src/main/java/com/aulyrius/customoregen/config/`:
- `ModConfigs.java` - NeoForge configuration with 4 nested config classes: `OreGenConfig`, `ToolStatsConfig`, `DropsConfig`, `FeatureToggleConfig`
- `ModConfigs.java` - NeoForge configuration with nested config classes: `ToolStatsConfig`, `DropsConfig`, `FeatureToggleConfig`, `LatitudeOreConfig`
- `ConfigHelper.java` - Utility class for accessing config values
- Generated config file: `config/custom_ore_gen-common.toml` (created on first run)
**Current Implementation Status**:
- **✅ Ore Drops**: Fully implemented via `OreBreakEventHandler.java` which listens to `BlockEvent.BreakEvent` and calls `ConfigurableOreDropsProcedure.execute()` for all custom ores
- **⚠️ Tool Stats**: Wired. Tools read their stats from `TOOL_STATS` config when the config is loaded, with a hardcoded fallback when not yet loaded (e.g. `SharddiamondpickaxeItem.java`: `return ModConfigs.isLoaded() ? ModConfigs.TOOL_STATS.shardDiamondPickaxeDurability.get() : 200;`). See also `ConfigHelper.getShardDiamondToolDurability/Speed/Damage`.
- **⚠️ Tool Stats**: Wired. Tools read their stats from `TOOL_STATS` config when the config is loaded, with a hardcoded fallback when not yet loaded (e.g. `SharddiamondpickaxeItem.java`: `return ModConfigs.isLoaded() ? ModConfigs.TOOL_STATS.shardDiamondPickaxeDurability.get() : 200;`).
- **⚠️ Feature Toggles**: Wired (commit `48a0d797`). Toggles in `FeatureToggleConfig` drive ore *generation* via `ConfigGatedFeaturesModifier` + the `config_gated_features` biome modifiers in `data/custom_ore_gen/neoforge/biome_modifier/add_*_ores.json`. A regression test (`ModConfigsTest.testFeatureToggleConfig_declaresAllTogglesReferencedByConfigHelper()`) ensures every toggle string used by `ConfigHelper.isFeatureEnabled()` actually maps to a field on `FeatureToggleConfig`, so a typo can't silently produce a dead toggle. Note: item/block *registration* still always fires (toggling only gates worldgen, not whether the items exist in creative).
- **⚠️ Ore Generation (gating)**: Feature toggles gate *whether* each ore feature is added (see Feature Toggles above). Vein parameters (size, count, height) are hard-coded in the data-driven worldgen JSONs under `data/custom_ore_gen/worldgen/` (`configured_feature/` + `placed_feature/`), exactly like vanilla; there is no runtime-config-driven ore parameter provider.
- **Enchantability**: Works natively in 1.21.1 via the enchantable tags (`data/minecraft/tags/item/enchantable/{mining,weapon,armor,durability}.json`, which include all Shard Diamond tools + armor) combined with `Tier.getEnchantmentValue() == 9` on the tool `Tier`s. The dead `EnchantabilityFix.java` class (which referenced the non-existent `DataComponents.ENCHANTABLE` / `net.minecraft.world.item.enchantment.Enchantable` from an earlier 1.20.5-snapshot API) has been removed.
@@ -123,41 +116,28 @@ Located in `src/main/java/net/mcreator/customoregen/config/`:
The `OreBiomeFinderItem` (`item/OreBiomeFinderItem.java`) and `/ores` command (`OresCommand.java`) detect which mod tags apply to the current biome and list findable ores.
**Implementation Details**:
- Uses `TagKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath("custom_ore_gen", "..."))` to define biome tags
- Checks `level.getBiome(pos()).is()` to test tag membership
- Displays biome ID, applicable tags, and ore list with height ranges
- Hardcoded ore lists by category (COLD_ORES, HOT_ORES, etc.) in `OreBiomeFinderItem.java`
- Both are thin wrappers over `worldgen/OreZoneCatalog.buildZoneReport(x, z)`, which derives
the zone from the Z coordinate via `LatitudeConfig` (cold/temperate/hot thresholds)
- Ore lists per zone live in `OreZoneCatalog` (single source of truth)
## Adding a New Ore
To add a new ore type (requires MCreator for full integration):
The project is fully hand-maintained (no MCreator). To add a new ore type:
1. **Create the block** in MCreator with proper properties (sound type, harvest level, etc.)
2. **Add loot table** at `src/main/resources/data/custom_ore_gen/loot_table/blocks/{orename}.json` (note: `loot_table` not `loot_tables`)
3. **Add configured_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/configured_feature/`
4. **Add placed_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/placed_feature/`
5. **Create biome_modifier** JSON in `src/main/resources/data/custom_ore_gen/neoforge/biome_modifier/` linking to a biome tag (or create a new tag in `tags/worldgen/biome/`)
6. **Add BOP entries** (optional) to appropriate biome tag JSON files with `"required": false` wrapper
7. **Update `OreBiomeFinderItem.java`** to add the new ore to the appropriate category list
8. **Add ore type mapping** in `OreBreakEventHandler.java` if you want configurable drops via `ConfigurableOreDropsProcedure`
1. **Create the block class** in `block/` (copy an existing ore, adjust properties)
2. **Register block + item** in `init/CustomOreGenModBlocks.java` and `init/CustomOreGenModItems.java`
3. **Add loot table** at `src/main/resources/data/custom_ore_gen/loot_table/blocks/{orename}.json` (note: `loot_table` not `loot_tables`)
4. **Add configured_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/configured_feature/`
5. **Add placed_feature** JSON in `src/main/resources/data/custom_ore_gen/worldgen/placed_feature/` (use a `custom_ore_gen:latitude_zone` placement modifier to bind it to a climate zone)
6. **Create biome_modifier** JSON in `src/main/resources/data/custom_ore_gen/neoforge/biome_modifier/` (use `custom_ore_gen:config_gated_features` to make it config-toggleable)
7. **Add BOP entries** (optional) to appropriate biome tag JSON files with `"required": false` wrapper
8. **Update `OreZoneCatalog.java`** to list the new ore in the appropriate zone
9. **Add the ore type mapping** in `OreTypes.java` + a drop spec in `CustomOreLootModifier` if you want configurable drops
## User Code Sections
When editing MCreator-generated files, only modify code between:
```java
// Start of user code block [section_name]
// End of user code block [section_name]
```
For example, in `CustomOreGenModItems.java` (lines 67-78):
```java
// Start of user code block custom items
public static final Supplier<Item> ORE_BIOME_FINDER = REGISTRY.register("ore_biome_finder", () -> new OreBiomeFinderItem());
// ... armor, paxel registrations
// End of user code block custom items
```
**Important**: Custom items like the Ore Biome Finder, Shard Diamond armor, and Paxel are registered in this protected section and will survive MCreator rebuilds.
Historical MCreator "user code block" markers were removed - every source file is
fully editable.
## Event Handlers