fix: resolve build errors and link tool/armor stats to config

This commit is contained in:
2026-02-03 11:23:06 +01:00
parent 7bd578797b
commit d0ae2916ad
144 changed files with 4822 additions and 2709 deletions
@@ -137,6 +137,9 @@ public class ModConfigs {
public final ModConfigSpec.ConfigValue<Integer> shardDiamondShovelDurability;
public final ModConfigSpec.DoubleValue shardDiamondShovelSpeed;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondShovelAttackDamage;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondPaxelDurability;
public final ModConfigSpec.DoubleValue shardDiamondPaxelSpeed;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondPaxelAttackDamage;
public ToolStatsConfig(ModConfigSpec.Builder builder) {
builder.push("tool_stats");
@@ -171,10 +174,48 @@ public class ModConfigs {
shardDiamondShovelAttackDamage = builder
.comment("Attack damage of Shard Diamond Shovel (default: 2)")
.defineInRange("shovelAttackDamage", 2, 0, 20);
shardDiamondPaxelDurability = builder
.comment("Durability of Shard Diamond Paxel (default: 1000)")
.defineInRange("paxelDurability", 1000, 1, 5000);
shardDiamondPaxelSpeed = builder
.comment("Mining speed of Shard Diamond Paxel (default: 6.5)")
.defineInRange("paxelSpeed", 6.5, 0.1, 20.0);
shardDiamondPaxelAttackDamage = builder
.comment("Attack damage of Shard Diamond Paxel (default: 4)")
.defineInRange("paxelAttackDamage", 4, 0, 20);
builder.pop();
builder.push("shard_diamond_armor");
shardDiamondHelmetDurability = builder
.comment("Durability of Shard Diamond Helmet (default: 250)")
.defineInRange("helmetDurability", 250, 1, 5000);
shardDiamondChestplateDurability = builder
.comment("Durability of Shard Diamond Chestplate (default: 300)")
.defineInRange("chestplateDurability", 300, 1, 5000);
shardDiamondLeggingsDurability = builder
.comment("Durability of Shard Diamond Leggings (default: 280)")
.defineInRange("leggingsDurability", 280, 1, 5000);
shardDiamondBootsDurability = builder
.comment("Durability of Shard Diamond Boots (default: 230)")
.defineInRange("bootsDurability", 230, 1, 5000);
shardDiamondArmorToughness = builder
.comment("Toughness of Shard Diamond Armor (default: 1.0)")
.defineInRange("armorToughness", 1.0, 0.0, 10.0);
shardDiamondArmorKnockbackResistance = builder
.comment("Knockback resistance of Shard Diamond Armor (default: 0.0)")
.defineInRange("armorKnockbackResistance", 0.0, 0.0, 1.0);
builder.pop();
builder.pop();
}
public final ModConfigSpec.ConfigValue<Integer> shardDiamondHelmetDurability;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondChestplateDurability;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondLeggingsDurability;
public final ModConfigSpec.ConfigValue<Integer> shardDiamondBootsDurability;
public final ModConfigSpec.DoubleValue shardDiamondArmorToughness;
public final ModConfigSpec.DoubleValue shardDiamondArmorKnockbackResistance;
}
// Configuration pour les drops des minerais
@@ -5,6 +5,7 @@ import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.mcreator.customoregen.config.ModConfigs;
/**
* Base class for Shard Diamond armor items with custom stats matching Forge
@@ -17,16 +18,15 @@ public abstract class ShardDiamondArmorItem extends ArmorItem {
}
/**
* Override durability to match original stats:
* helmet: 250, chestplate: 300, leggings: 280, boots: 230
* Override durability to match config
*/
@Override
public int getMaxDamage(ItemStack stack) {
return switch (getType()) {
case HELMET -> 250;
case CHESTPLATE -> 300;
case LEGGINGS -> 280;
case BOOTS -> 230;
case HELMET -> ModConfigs.TOOL_STATS.shardDiamondHelmetDurability.get();
case CHESTPLATE -> ModConfigs.TOOL_STATS.shardDiamondChestplateDurability.get();
case LEGGINGS -> ModConfigs.TOOL_STATS.shardDiamondLeggingsDurability.get();
case BOOTS -> ModConfigs.TOOL_STATS.shardDiamondBootsDurability.get();
default -> super.getMaxDamage(stack);
};
}
@@ -47,11 +47,11 @@ public abstract class ShardDiamondArmorItem extends ArmorItem {
}
/**
* Override toughness to match original stat: 1.0f
* Override toughness to match config
*/
@Override
public float getToughness() {
return 1.0f;
return ModConfigs.TOOL_STATS.shardDiamondArmorToughness.get().floatValue();
}
/**
@@ -10,20 +10,21 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.mcreator.customoregen.config.ModConfigs;
public class SharddiamondaxeItem extends AxeItem {
public SharddiamondaxeItem() {
super(new Tier() {
public int getUses() {
return 200;
return ModConfigs.TOOL_STATS.shardDiamondAxeDurability.get();
}
public float getSpeed() {
return 7f;
return ModConfigs.TOOL_STATS.shardDiamondAxeSpeed.get().floatValue();
}
public float getAttackDamageBonus() {
return 0f;
return ModConfigs.TOOL_STATS.shardDiamondAxeAttackDamage.get().floatValue();
}
public int getEnchantmentValue() {
@@ -11,20 +11,21 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Block;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.mcreator.customoregen.config.ModConfigs;
public class SharddiamondpaxelItem extends PickaxeItem {
public SharddiamondpaxelItem() {
super(new Tier() {
public int getUses() {
return 1000;
return ModConfigs.TOOL_STATS.shardDiamondPaxelDurability.get();
}
public float getSpeed() {
return 6.5f;
return ModConfigs.TOOL_STATS.shardDiamondPaxelSpeed.get().floatValue();
}
public float getAttackDamageBonus() {
return 0f;
return ModConfigs.TOOL_STATS.shardDiamondPaxelAttackDamage.get().floatValue();
}
public int getEnchantmentValue() {
@@ -11,20 +11,21 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.mcreator.customoregen.config.ModConfigs;
public class SharddiamondpickaxeItem extends PickaxeItem {
public SharddiamondpickaxeItem() {
super(new Tier() {
public int getUses() {
return 200; // Hardcoded - config not loaded yet
return ModConfigs.TOOL_STATS.shardDiamondPickaxeDurability.get();
}
public float getSpeed() {
return 7f;
return ModConfigs.TOOL_STATS.shardDiamondPickaxeSpeed.get().floatValue();
}
public float getAttackDamageBonus() {
return 0f;
return ModConfigs.TOOL_STATS.shardDiamondPickaxeAttackDamage.get().floatValue();
}
public int getEnchantmentValue() {
@@ -11,20 +11,21 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.mcreator.customoregen.config.ModConfigs;
public class SharddiamondshovelItem extends ShovelItem {
public SharddiamondshovelItem() {
super(new Tier() {
public int getUses() {
return 200;
return ModConfigs.TOOL_STATS.shardDiamondShovelDurability.get();
}
public float getSpeed() {
return 4f;
return ModConfigs.TOOL_STATS.shardDiamondShovelSpeed.get().floatValue();
}
public float getAttackDamageBonus() {
return 0f;
return ModConfigs.TOOL_STATS.shardDiamondShovelAttackDamage.get().floatValue();
}
public int getEnchantmentValue() {
@@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:concentratedcoalore"
}
],
"results": [
{
"item": "minecraft:coal",
"count": 2
},
{
"item": "minecraft:coal",
"chance": 0.5
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:concentrateddiamondore"
}
],
"results": [
{
"item": "minecraft:diamond",
"count": 2
},
{
"item": "minecraft:diamond",
"chance": 0.5
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 350
}
@@ -0,0 +1,27 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:deepslateconcentratedcoalore"
}
],
"results": [
{
"item": "minecraft:coal",
"count": 2
},
{
"item": "minecraft:coal",
"chance": 0.5
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,27 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:deepslateconcentrateddiamondore"
}
],
"results": [
{
"item": "minecraft:diamond",
"count": 2
},
{
"item": "minecraft:diamond",
"chance": 0.5
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 350
}
@@ -0,0 +1,27 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:deepslatehighlapisore"
}
],
"results": [
{
"item": "minecraft:lapis_lazuli",
"count": 10
},
{
"item": "minecraft:lapis_lazuli",
"chance": 0.5
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,27 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:deepslatehighredstoneore"
}
],
"results": [
{
"item": "minecraft:redstone",
"count": 6
},
{
"item": "minecraft:redstone",
"chance": 0.5
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,27 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:deepslatesharddiamondore"
}
],
"results": [
{
"item": "custom_ore_gen:diamondshard",
"count": 3
},
{
"item": "custom_ore_gen:diamondshard",
"chance": 0.5
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:highlapisore"
}
],
"results": [
{
"item": "minecraft:lapis_lazuli",
"count": 8
},
{
"item": "minecraft:lapis_lazuli",
"chance": 0.5
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"item": "custom_ore_gen:highredstoneore"
}
],
"results": [
{
"item": "minecraft:redstone",
"count": 5
},
{
"item": "minecraft:redstone",
"chance": 0.5
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,23 @@
{
"type": "create:crushing",
"ingredients": [
{
"tag": "forge:ores/shard_diamond"
}
],
"results": [
{
"item": "custom_ore_gen:diamondshard",
"count": 3
},
{
"item": "custom_ore_gen:diamondshard",
"chance": 0.5
},
{
"item": "minecraft:experience_nugget",
"chance": 0.75
}
],
"processingTime": 250
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:ashcoalore"
}
],
"results": [
{
"item": "minecraft:coal",
"count": 2
},
{
"item": "minecraft:coal",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslateashcoalore"
}
],
"results": [
{
"item": "minecraft:coal",
"count": 2
},
{
"item": "minecraft:coal",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslatehighcopperore"
}
],
"results": [
{
"item": "minecraft:raw_copper",
"count": 5
},
{
"item": "minecraft:raw_copper",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslatehighemeraldore"
}
],
"results": [
{
"item": "minecraft:emerald",
"count": 2
},
{
"item": "minecraft:emerald",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslategoldore"
}
],
"results": [
{
"item": "minecraft:raw_gold",
"count": 2
},
{
"item": "minecraft:raw_gold",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslateironore"
}
],
"results": [
{
"item": "minecraft:raw_iron",
"count": 2
},
{
"item": "minecraft:raw_iron",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslatelowercopperore"
}
],
"results": [
{
"item": "minecraft:raw_copper",
"count": 5
},
{
"item": "minecraft:raw_copper",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslateloweremeraldore"
}
],
"results": [
{
"item": "minecraft:emerald",
"count": 2
},
{
"item": "minecraft:emerald",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,27 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:deepslatepuregoldenore"
}
],
"results": [
{
"item": "minecraft:raw_gold",
"count": 2
},
{
"item": "minecraft:raw_gold",
"chance": 0.25
},
{
"item": "minecraft:cobbled_deepslate",
"chance": 0.125
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:highcopperore"
}
],
"results": [
{
"item": "minecraft:raw_copper",
"count": 4
},
{
"item": "minecraft:raw_copper",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:highemeraldore"
}
],
"results": [
{
"item": "minecraft:emerald",
"count": 2
},
{
"item": "minecraft:emerald",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:goldore"
}
],
"results": [
{
"item": "minecraft:raw_gold",
"count": 2
},
{
"item": "minecraft:raw_gold",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:ironore"
}
],
"results": [
{
"item": "minecraft:raw_iron",
"count": 2
},
{
"item": "minecraft:raw_iron",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:lowercopperore"
}
],
"results": [
{
"item": "minecraft:raw_copper",
"count": 4
},
{
"item": "minecraft:raw_copper",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:loweremeraldore"
}
],
"results": [
{
"item": "minecraft:emerald",
"count": 2
},
{
"item": "minecraft:emerald",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,23 @@
{
"type": "create:milling",
"ingredients": [
{
"item": "custom_ore_gen:puregoldenore"
}
],
"results": [
{
"item": "minecraft:raw_gold",
"count": 2
},
{
"item": "minecraft:raw_gold",
"chance": 0.25
},
{
"item": "minecraft:experience_nugget",
"chance": 0.5
}
],
"processingTime": 150
}
@@ -0,0 +1,16 @@
{
"type": "create:mixing",
"ingredients": [
{
"item": "custom_ore_gen:diamondshard",
"count": 9
}
],
"results": [
{
"item": "minecraft:diamond",
"count": 1
}
],
"processingTime": 100
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:tempered_biomes",
"features": "custom_ore_gen:concentratedcoalore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:copperhighore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:copperlowerore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:cold_biomes",
"features": "custom_ore_gen:deepslatediamondore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:tempered_biomes",
"features": "custom_ore_gen:deepslateironore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:cold_biomes",
"features": "custom_ore_gen:deepslatelapisore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:deepslatepuregoldenore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:deepslateredstoneore",
"step": "underground_ores"
}
@@ -1,8 +0,0 @@
{
"type": "forge:add_features",
"biomes": {
"type": "forge:any"
},
"features": "custom_ore_gen:deepslatesharddiamondore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:mountain_biomes",
"features": "custom_ore_gen:highemeraldore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:tempered_biomes",
"features": "custom_ore_gen:ironore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:cold_biomes",
"features": "custom_ore_gen:lapisore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:rare_biomes",
"features": "custom_ore_gen:loweremeraldore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:puregoldenore",
"step": "underground_ores"
}
@@ -1,6 +0,0 @@
{
"type": "forge:add_features",
"biomes": "#custom_ore_gen:hot_biomes",
"features": "custom_ore_gen:redstoneore",
"step": "underground_ores"
}
@@ -1,8 +0,0 @@
{
"type": "forge:add_features",
"biomes": {
"type": "forge:any"
},
"features": "custom_ore_gen:sharddiamondblockore",
"step": "underground_ores"
}