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>
@@ -0,0 +1,140 @@
|
||||
# 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
|
||||
|
||||
```bash
|
||||
# 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:
|
||||
|
||||
```java
|
||||
// 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:
|
||||
```java
|
||||
// Start of user code block [section_name]
|
||||
// End of user code block [section_name]
|
||||
```
|
||||
|
||||
For example, in `CustomOreGenModItems.java`:
|
||||
```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`)
|
||||
@@ -0,0 +1,56 @@
|
||||
package net.mcreator.customoregen.item;
|
||||
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
import net.mcreator.customoregen.CustomOreGenMod;
|
||||
|
||||
public class ShardDiamondArmorMaterial implements ArmorMaterial {
|
||||
public static final ShardDiamondArmorMaterial INSTANCE = new ShardDiamondArmorMaterial();
|
||||
|
||||
private static final int[] DURABILITY_PER_SLOT = new int[]{250, 300, 280, 230};
|
||||
private static final int[] PROTECTION_PER_SLOT = new int[]{3, 7, 5, 2};
|
||||
|
||||
@Override
|
||||
public int getDurabilityForType(ArmorItem.Type type) {
|
||||
return DURABILITY_PER_SLOT[type.getSlot().getIndex()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefenseForType(ArmorItem.Type type) {
|
||||
return PROTECTION_PER_SLOT[type.getSlot().getIndex()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnchantmentValue() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ARMOR_EQUIP_DIAMOND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(CustomOreGenModItems.DIAMONDSHARD.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return CustomOreGenMod.MODID + ":shard_diamond";
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getToughness() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getKnockbackResistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,10 @@
|
||||
package net.mcreator.customoregen.item;
|
||||
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
|
||||
public class SharddiamondbootsItem extends ArmorItem {
|
||||
public SharddiamondbootsItem() {
|
||||
super(new ArmorMaterial() {
|
||||
public int getDurabilityForType(ArmorItem.Type type) {
|
||||
return 230; // Bottes
|
||||
}
|
||||
|
||||
public int getDefenseForType(ArmorItem.Type type) {
|
||||
return 2; // Protection
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ARMOR_EQUIP_DIAMOND;
|
||||
}
|
||||
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(CustomOreGenModItems.DIAMONDSHARD.get()));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "shard_diamond";
|
||||
}
|
||||
|
||||
public float getToughness() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getKnockbackResistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
}, ArmorItem.Type.BOOTS, new Item.Properties());
|
||||
super(ShardDiamondArmorMaterial.INSTANCE, ArmorItem.Type.BOOTS, new Item.Properties());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,10 @@
|
||||
package net.mcreator.customoregen.item;
|
||||
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
|
||||
public class SharddiamondchestplateItem extends ArmorItem {
|
||||
public SharddiamondchestplateItem() {
|
||||
super(new ArmorMaterial() {
|
||||
public int getDurabilityForType(ArmorItem.Type type) {
|
||||
return 300; // Plastron
|
||||
}
|
||||
|
||||
public int getDefenseForType(ArmorItem.Type type) {
|
||||
return 7; // Protection
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ARMOR_EQUIP_DIAMOND;
|
||||
}
|
||||
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(CustomOreGenModItems.DIAMONDSHARD.get()));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "shard_diamond";
|
||||
}
|
||||
|
||||
public float getToughness() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getKnockbackResistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
}, ArmorItem.Type.CHESTPLATE, new Item.Properties());
|
||||
super(ShardDiamondArmorMaterial.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Properties());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,10 @@
|
||||
package net.mcreator.customoregen.item;
|
||||
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
|
||||
public class SharddiamondhelmetItem extends ArmorItem {
|
||||
public SharddiamondhelmetItem() {
|
||||
super(new ArmorMaterial() {
|
||||
public int getDurabilityForType(ArmorItem.Type type) {
|
||||
return 250; // Casque
|
||||
}
|
||||
|
||||
public int getDefenseForType(ArmorItem.Type type) {
|
||||
return 3; // Protection
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ARMOR_EQUIP_DIAMOND;
|
||||
}
|
||||
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(CustomOreGenModItems.DIAMONDSHARD.get()));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "shard_diamond";
|
||||
}
|
||||
|
||||
public float getToughness() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getKnockbackResistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
}, ArmorItem.Type.HELMET, new Item.Properties());
|
||||
super(ShardDiamondArmorMaterial.INSTANCE, ArmorItem.Type.HELMET, new Item.Properties());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,10 @@
|
||||
package net.mcreator.customoregen.item;
|
||||
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.ArmorMaterial;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
|
||||
public class SharddiamondleggingsItem extends ArmorItem {
|
||||
public SharddiamondleggingsItem() {
|
||||
super(new ArmorMaterial() {
|
||||
public int getDurabilityForType(ArmorItem.Type type) {
|
||||
return 280; // Jambières
|
||||
}
|
||||
|
||||
public int getDefenseForType(ArmorItem.Type type) {
|
||||
return 5; // Protection
|
||||
}
|
||||
|
||||
public int getEnchantmentValue() {
|
||||
return 14;
|
||||
}
|
||||
|
||||
public SoundEvent getEquipSound() {
|
||||
return SoundEvents.ARMOR_EQUIP_DIAMOND;
|
||||
}
|
||||
|
||||
public Ingredient getRepairIngredient() {
|
||||
return Ingredient.of(new ItemStack(CustomOreGenModItems.DIAMONDSHARD.get()));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "shard_diamond";
|
||||
}
|
||||
|
||||
public float getToughness() {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getKnockbackResistance() {
|
||||
return 0.0f;
|
||||
}
|
||||
}, ArmorItem.Type.LEGGINGS, new Item.Properties());
|
||||
super(ShardDiamondArmorMaterial.INSTANCE, ArmorItem.Type.LEGGINGS, new Item.Properties());
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 264 B |
|
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 270 B |
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 274 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1022 B |
|
Before Width: | Height: | Size: 869 B After Width: | Height: | Size: 552 B |