4 Commits

Author SHA1 Message Date
feldenr 93bb4afb97 refactor: cleanup block classes and migrate tests to NeoForge
- Removed onDestroyedByPlayer from blocks (now handled by OreBreakEventHandler)
- Updated tests to use NeoForge classes (ModConfigSpec instead of ForgeConfigSpec)
- Fixed EnchantabilityFix annotation and commented out placeholder code
- Updated pack.mcmeta format for 1.21.1
2026-02-02 23:21:11 +01:00
feldenr 0fa495474b fix: register config and update recipe formats for 1.21.1
- Registered ModConfigs.SPEC in CustomOreGenMod to avoid IllegalStateException
- Updated all recipe JSONs to use 'id' instead of 'item' in result fields
- Renamed mekanism recipes folder to match 1.21.1 conventions
2026-02-02 23:20:17 +01:00
feldenr bca6034dd7 fix: restore ore drops and make them configurable via procedure
- Renamed data folders to 1.21.1 standards (singular names)
- Implemented OreBreakEventHandler to call ConfigurableOreDropsProcedure
- Updated procedure and config to handle all custom and variant ores
- Modified loot tables to only handle Silk Touch (manual drops via procedure)
- Fixed missing drops issue caused by folder name mismatch in 1.21.1
2026-02-02 23:11:42 +01:00
feldenr 4b9a4b0a05 Fix custom ore drops and tool enchantability for 1.21 2026-02-02 22:24:52 +01:00
77 changed files with 933 additions and 1544 deletions
@@ -20,6 +20,9 @@ import net.mcreator.customoregen.init.CustomOreGenModTabs;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
import net.mcreator.customoregen.item.ShardDiamondArmorMaterial;
import net.mcreator.customoregen.config.ModConfigs;
import net.neoforged.fml.config.ModConfig;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.List;
@@ -34,7 +37,9 @@ public class CustomOreGenMod {
public CustomOreGenMod(IEventBus modEventBus, ModContainer container) {
// Start of user code block mod constructor
container.registerConfig(ModConfig.Type.COMMON, ModConfigs.SPEC);
// End of user code block mod constructor
NeoForge.EVENT_BUS.register(this);
CustomOreGenModBlocks.REGISTRY.register(modEventBus);
@@ -11,8 +11,6 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
public class ConcentratedcoaloreBlock extends Block {
public ConcentratedcoaloreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 15f).requiresCorrectToolForDrops());
@@ -23,10 +21,4 @@ public class ConcentratedcoaloreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
@@ -11,8 +11,6 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
public class CopperhighoreBlock extends Block {
public CopperhighoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(1f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +21,4 @@ public class CopperhighoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
@@ -11,8 +11,6 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
public class CopperloweroreBlock extends Block {
public CopperloweroreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(4.5f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +21,4 @@ public class CopperloweroreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
@@ -13,9 +13,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class DeepslatediamondoreBlock extends Block {
public DeepslatediamondoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 11f).requiresCorrectToolForDrops());
@@ -26,10 +24,4 @@ public class DeepslatediamondoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class DeepslateironoreBlock extends Block {
public DeepslateironoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class DeepslateironoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class DeepslatelapisoreBlock extends Block {
public DeepslatelapisoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(4.5f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class DeepslatelapisoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class DeepslatepuregoldenoreBlock extends Block {
public DeepslatepuregoldenoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class DeepslatepuregoldenoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -1,8 +1,6 @@
package net.mcreator.customoregen.block;
import org.checkerframework.checker.units.qual.s;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -13,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class DeepslateredstoneoreBlock extends Block {
public DeepslateredstoneoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).lightLevel(s -> 1).requiresCorrectToolForDrops().hasPostProcess((bs, br, bp) -> true).emissiveRendering((bs, br, bp) -> true));
@@ -25,10 +22,4 @@ public class DeepslateredstoneoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,6 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
public class DeepslatesharddiamondoreBlock extends Block {
public DeepslatesharddiamondoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 14.5f).requiresCorrectToolForDrops());
@@ -23,10 +21,4 @@ public class DeepslatesharddiamondoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class HighemeraldoreBlock extends Block {
public HighemeraldoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class HighemeraldoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class IronoreBlock extends Block {
public IronoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(2f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class IronoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class LapisoreBlock extends Block {
public LapisoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class LapisoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class LoweremeraldoreBlock extends Block {
public LoweremeraldoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(4.5f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +22,4 @@ public class LoweremeraldoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class PuregoldenoreBlock extends Block {
public PuregoldenoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f));
@@ -23,10 +22,4 @@ public class PuregoldenoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -1,8 +1,6 @@
package net.mcreator.customoregen.block;
import org.checkerframework.checker.units.qual.s;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.BlockBehaviour;
@@ -13,8 +11,7 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
public class RedstoneoreBlock extends Block {
public RedstoneoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(3f, 10f).lightLevel(s -> 1).requiresCorrectToolForDrops());
@@ -25,10 +22,4 @@ public class RedstoneoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
}
@@ -11,8 +11,6 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.entity.player.Player;
import net.minecraft.core.BlockPos;
import net.mcreator.customoregen.procedures.OreexperienceProcedure;
public class SharddiamondblockoreBlock extends Block {
public SharddiamondblockoreBlock() {
super(BlockBehaviour.Properties.of().sound(SoundType.STONE).strength(1.3f, 10f).requiresCorrectToolForDrops());
@@ -23,10 +21,4 @@ public class SharddiamondblockoreBlock extends Block {
return 15;
}
@Override
public boolean onDestroyedByPlayer(BlockState blockstate, Level world, BlockPos pos, Player entity, boolean willHarvest, FluidState fluid) {
boolean retval = super.onDestroyedByPlayer(blockstate, world, pos, entity, willHarvest, fluid);
OreexperienceProcedure.execute(world, pos.getX(), pos.getY(), pos.getZ(), entity);
return retval;
}
}
@@ -202,8 +202,21 @@ public class ModConfigs {
public final ModConfigSpec.ConfigValue<Integer> impureGoldOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> impureGoldOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> lapisOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> lapisOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> redstoneOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> redstoneOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> emeraldOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> emeraldOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> copperOreMinDrops;
public final ModConfigSpec.ConfigValue<Integer> copperOreMaxDrops;
public final ModConfigSpec.ConfigValue<Integer> oreExperienceDrops;
public DropsConfig(ModConfigSpec.Builder builder) {
builder.push("drops");
@@ -273,7 +286,35 @@ public class ModConfigs {
.defineInRange("goldMaxDrops", 2, 0, 64);
builder.pop();
builder.push("vanilla_ore_variants");
lapisOreMinDrops = builder
.comment("Minimum lapis dropped (default: 4)")
.defineInRange("lapisMinDrops", 4, 0, 64);
lapisOreMaxDrops = builder
.comment("Maximum lapis dropped (default: 9)")
.defineInRange("lapisMaxDrops", 9, 0, 64);
redstoneOreMinDrops = builder
.comment("Minimum redstone dropped (default: 4)")
.defineInRange("redstoneMinDrops", 4, 0, 64);
redstoneOreMaxDrops = builder
.comment("Maximum redstone dropped (default: 5)")
.defineInRange("redstoneMaxDrops", 5, 0, 64);
emeraldOreMinDrops = builder
.comment("Minimum emerald dropped (default: 1)")
.defineInRange("emeraldMinDrops", 1, 0, 64);
emeraldOreMaxDrops = builder
.comment("Maximum emerald dropped (default: 1)")
.defineInRange("emeraldMaxDrops", 1, 0, 64);
copperOreMinDrops = builder
.comment("Minimum copper dropped (default: 2)")
.defineInRange("copperMinDrops", 2, 0, 64);
copperOreMaxDrops = builder
.comment("Maximum copper dropped (default: 5)")
.defineInRange("copperMaxDrops", 5, 0, 64);
builder.pop();
oreExperienceDrops = builder
.comment("Experience dropped when mining custom ores (default: 2)")
.defineInRange("oreExperience", 2, 0, 100);
@@ -0,0 +1,30 @@
package net.mcreator.customoregen.event;
import net.mcreator.customoregen.CustomOreGenMod;
import net.mcreator.customoregen.init.CustomOreGenModItems;
import net.minecraft.core.component.DataComponents;
// import net.minecraft.world.item.enchantment.Enchantable;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.event.ModifyDefaultComponentsEvent;
@EventBusSubscriber(modid = CustomOreGenMod.MODID, bus = EventBusSubscriber.Bus.MOD)
public class EnchantabilityFix {
@SubscribeEvent
public static void modifyComponents(ModifyDefaultComponentsEvent event) {
// Tools - Value 9
/*
event.modify(CustomOreGenModItems.SHARDDIAMONDPICKAXE.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(9)));
event.modify(CustomOreGenModItems.SHARDDIAMONDSHOVEL.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(9)));
event.modify(CustomOreGenModItems.SHARDDIAMONDAXE.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(9)));
event.modify(CustomOreGenModItems.SHARDDIAMONDPAXEL.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(9)));
// Armor - Value 14
event.modify(CustomOreGenModItems.SHARDDIAMONDHELMET.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(14)));
event.modify(CustomOreGenModItems.SHARDDIAMONDCHESTPLATE.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(14)));
event.modify(CustomOreGenModItems.SHARDDIAMONDLEGGINGS.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(14)));
event.modify(CustomOreGenModItems.SHARDDIAMONDBOOTS.get(), builder -> builder.set(DataComponents.ENCHANTABLE, new Enchantable(14)));
*/
}
}
@@ -0,0 +1,52 @@
package net.mcreator.customoregen.event;
import net.neoforged.neoforge.event.level.BlockEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.bus.api.SubscribeEvent;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.entity.player.Player;
import net.mcreator.customoregen.procedures.ConfigurableOreDropsProcedure;
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
import net.mcreator.customoregen.CustomOreGenMod;
@EventBusSubscriber(modid = CustomOreGenMod.MODID)
public class OreBreakEventHandler {
@SubscribeEvent
public static void onBlockBreak(BlockEvent.BreakEvent event) {
BlockState state = event.getState();
Block block = state.getBlock();
Player player = event.getPlayer();
String oreType = null;
if (block == CustomOreGenModBlocks.SHARDDIAMONDBLOCKORE.get() || block == CustomOreGenModBlocks.DEEPSLATESHARDDIAMONDORE.get()) {
oreType = "shard_diamond";
} else if (block == CustomOreGenModBlocks.CONCENTRATEDCOALORE.get()) {
oreType = "concentrated_coal";
} else if (block == CustomOreGenModBlocks.PUREGOLDENORE.get() || block == CustomOreGenModBlocks.DEEPSLATEPUREGOLDENORE.get()) {
oreType = "pure_golden";
} else if (block == CustomOreGenModBlocks.IRONORE.get() || block == CustomOreGenModBlocks.DEEPSLATEIRONORE.get()) {
oreType = "impure_iron";
} else if (block == CustomOreGenModBlocks.DEEPSLATEDIAMONDORE.get()) {
oreType = "concentrated_diamond";
} else if (block == CustomOreGenModBlocks.LAPISORE.get() || block == CustomOreGenModBlocks.DEEPSLATELAPISORE.get()) {
oreType = "lapis";
} else if (block == CustomOreGenModBlocks.REDSTONEORE.get() || block == CustomOreGenModBlocks.DEEPSLATEREDSTONEORE.get()) {
oreType = "redstone";
} else if (block == CustomOreGenModBlocks.HIGHEMERALDORE.get() || block == CustomOreGenModBlocks.LOWEREMERALDORE.get()) {
oreType = "emerald";
} else if (block == CustomOreGenModBlocks.COPPERHIGHORE.get() || block == CustomOreGenModBlocks.COPPERLOWERORE.get()) {
oreType = "copper";
}
if (oreType != null) {
// Ensure the player is using the correct tool to get drops
if (player != null && player.hasCorrectToolForDrops(state)) {
ConfigurableOreDropsProcedure.execute(event.getLevel(), event.getPos().getX(), event.getPos().getY(), event.getPos().getZ(), player, oreType);
}
}
}
}
@@ -107,7 +107,32 @@ public class ConfigurableOreDropsProcedure {
dropItem = new ItemStack(Items.RAW_GOLD);
break;
case "lapis":
minDrops = ModConfigs.DROPS.lapisOreMinDrops.get();
maxDrops = ModConfigs.DROPS.lapisOreMaxDrops.get();
dropItem = new ItemStack(Items.LAPIS_LAZULI);
break;
case "redstone":
minDrops = ModConfigs.DROPS.redstoneOreMinDrops.get();
maxDrops = ModConfigs.DROPS.redstoneOreMaxDrops.get();
dropItem = new ItemStack(Items.REDSTONE);
break;
case "emerald":
minDrops = ModConfigs.DROPS.emeraldOreMinDrops.get();
maxDrops = ModConfigs.DROPS.emeraldOreMaxDrops.get();
dropItem = new ItemStack(Items.EMERALD);
break;
case "copper":
minDrops = ModConfigs.DROPS.copperOreMinDrops.get();
maxDrops = ModConfigs.DROPS.copperOreMaxDrops.get();
dropItem = new ItemStack(Items.RAW_COPPER);
break;
default:
return;
}
@@ -32,7 +32,6 @@ public class OreexperienceProcedure {
}
if (!hasSilkTouch) {
world.destroyBlock(BlockPos.containing(x, y, z), false);
if (world instanceof ServerLevel _level)
_level.addFreshEntity(new ExperienceOrb(_level, x, y, z, 2));
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:concentratedcoalore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/concentratedcoalore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:copper_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/copperhighore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_copper_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/copperlowerore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:diamond_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatediamondore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:deepslateironore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslateironore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_lapis_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatelapisore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:gold_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatepuregoldenore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_redstone_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslateredstoneore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:deepslatesharddiamondore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatesharddiamondore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:emerald_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/highemeraldore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/ironore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:lapis_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/lapisore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_emerald_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/loweremeraldore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:gold_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/puregoldenore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:redstone_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/redstoneore"
}
@@ -0,0 +1,42 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:sharddiamondblockore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"predicates": {
"minecraft:enchantments": [
{
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/sharddiamondblockore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:coal",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:coal_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/concentratedcoalore"
}
@@ -1,85 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": {
"min": 1,
"max": 2
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_copper",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 2,
"max": 5
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:copper_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/copperhighore"
}
@@ -1,85 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": {
"min": 1,
"max": 2
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_copper",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 2,
"max": 6
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_copper_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/copperlowerore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:diamond",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:diamond_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatediamondore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_iron",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:deepslateironore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslateironore"
}
@@ -1,90 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:lapis_lazuli",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 4,
"max": 6
}
},
{
"function": "enchant_with_levels",
"treasure": true,
"levels": {
"min": 1,
"max": 10
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_lapis_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatelapisore"
}
@@ -1,89 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": {
"min": 1,
"max": 2
},
"bonus_rolls": {
"min": 1,
"max": 2
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_gold",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:gold_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatepuregoldenore"
}
@@ -1,85 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": {
"min": 1,
"max": 2
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:redstone",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 4,
"max": 6
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_redstone_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslateredstoneore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:diamondshard",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:deepslatesharddiamondore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/deepslatesharddiamondore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:emerald",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:emerald_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/highemeraldore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_iron",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:iron_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/ironore"
}
@@ -1,90 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:lapis_lazuli",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 4,
"max": 8
}
},
{
"function": "enchant_with_levels",
"treasure": true,
"levels": {
"min": 0,
"max": 5
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:lapis_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/lapisore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:emerald",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:deepslate_emerald_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/loweremeraldore"
}
@@ -1,89 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": {
"min": 1,
"max": 2
},
"bonus_rolls": {
"min": 1,
"max": 2
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:raw_gold",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:gold_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/puregoldenore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:redstone",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 4,
"max": 5
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:redstone_ore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/redstoneore"
}
@@ -1,82 +0,0 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:diamondshard",
"weight": 1,
"conditions": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
}
]
}
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "custom_ore_gen:sharddiamondblockore",
"weight": 1,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
}
]
}
],
"random_sequence": "custom_ore_gen:blocks/sharddiamondblockore"
}
@@ -15,7 +15,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondaxe",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondaxe"
}
}
@@ -12,7 +12,7 @@
}
},
"result": {
"item": "minecraft:diamond",
"count": 1
"count": 1,
"id": "minecraft:diamond"
}
}
@@ -14,7 +14,7 @@
}
},
"result": {
"item": "custom_ore_gen:ore_biome_finder",
"count": 1
"count": 1,
"id": "custom_ore_gen:ore_biome_finder"
}
}
}
@@ -15,7 +15,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondpickaxe",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondpickaxe"
}
}
@@ -18,7 +18,7 @@
}
},
"result": {
"item": "minecraft:sculk_catalyst",
"count": 1
"count": 1,
"id": "minecraft:sculk_catalyst"
}
}
}
@@ -11,7 +11,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondboots",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondboots"
}
}
@@ -15,7 +15,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondchestplate",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondchestplate"
}
}
}
@@ -12,7 +12,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondhelmet",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondhelmet"
}
}
}
@@ -15,7 +15,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondleggings",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondleggings"
}
}
}
@@ -21,7 +21,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondpaxel",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondpaxel"
}
}
}
@@ -15,7 +15,7 @@
}
},
"result": {
"item": "custom_ore_gen:sharddiamondshovel",
"count": 1
"count": 1,
"id": "custom_ore_gen:sharddiamondshovel"
}
}
@@ -0,0 +1,12 @@
{
"type": "mekanism:enriching",
"input": {
"ingredient": {
"tag": "forge:ores/shard_diamond"
}
},
"output": {
"count": 2,
"id": "custom_ore_gen:diamondshard"
}
}
@@ -1,12 +0,0 @@
{
"type": "mekanism:enriching",
"input": {
"ingredient": {
"tag": "forge:ores/shard_diamond"
}
},
"output": {
"item": "custom_ore_gen:diamondshard",
"count": 2
}
}
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"custom_ore_gen:sharddiamondhelmet",
"custom_ore_gen:sharddiamondchestplate",
"custom_ore_gen:sharddiamondleggings",
"custom_ore_gen:sharddiamondboots"
]
}
@@ -0,0 +1,13 @@
{
"replace": false,
"values": [
"custom_ore_gen:sharddiamondpickaxe",
"custom_ore_gen:sharddiamondshovel",
"custom_ore_gen:sharddiamondaxe",
"custom_ore_gen:sharddiamondpaxel",
"custom_ore_gen:sharddiamondhelmet",
"custom_ore_gen:sharddiamondchestplate",
"custom_ore_gen:sharddiamondleggings",
"custom_ore_gen:sharddiamondboots"
]
}
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"custom_ore_gen:sharddiamondpickaxe",
"custom_ore_gen:sharddiamondshovel",
"custom_ore_gen:sharddiamondaxe",
"custom_ore_gen:sharddiamondpaxel"
]
}
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"custom_ore_gen:sharddiamondaxe",
"custom_ore_gen:sharddiamondpaxel"
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 15,
"pack_format": 48,
"description": "Changement de la distribution des ressources sur Minecraft, ne pas utilisé seul sans KubeJS"
}
}
@@ -161,7 +161,7 @@ class OresCommandTest {
@Test
void testEventBusSubscriberAnnotation_IsPresent() {
// Verify the class has the proper event bus subscriber annotation
assertNotNull(OresCommand.class.getAnnotation(net.minecraftforge.fml.common.Mod.EventBusSubscriber.class));
assertNotNull(OresCommand.class.getAnnotation(net.neoforged.fml.common.EventBusSubscriber.class));
}
@Test
@@ -1,6 +1,6 @@
package net.mcreator.customoregen.config;
import net.minecraftforge.common.ForgeConfigSpec;
import net.neoforged.neoforge.common.ModConfigSpec;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
@@ -177,16 +177,16 @@ class ModConfigsTest {
ModConfigs.FeatureToggleConfig features = ModConfigs.FEATURES;
// Verify integer config values
assertTrue(oreGen.shardDiamondOreMinHeight instanceof ForgeConfigSpec.ConfigValue<?>);
assertTrue(toolStats.shardDiamondPickaxeDurability instanceof ForgeConfigSpec.ConfigValue<?>);
assertTrue(drops.shardDiamondOreMinDrops instanceof ForgeConfigSpec.ConfigValue<?>);
assertTrue(oreGen.shardDiamondOreMinHeight instanceof ModConfigSpec.ConfigValue<?>);
assertTrue(toolStats.shardDiamondPickaxeDurability instanceof ModConfigSpec.ConfigValue<?>);
assertTrue(drops.shardDiamondOreMinDrops instanceof ModConfigSpec.ConfigValue<?>);
// Verify double config values
assertTrue(toolStats.shardDiamondPickaxeSpeed instanceof ForgeConfigSpec.DoubleValue);
assertTrue(toolStats.shardDiamondPickaxeSpeed instanceof ModConfigSpec.DoubleValue);
// Verify boolean config values
assertTrue(drops.shardDiamondOreEnableFortune instanceof ForgeConfigSpec.ConfigValue<?>);
assertTrue(features.enableShardDiamondTools instanceof ForgeConfigSpec.ConfigValue<?>);
assertTrue(drops.shardDiamondOreEnableFortune instanceof ModConfigSpec.ConfigValue<?>);
assertTrue(features.enableShardDiamondTools instanceof ModConfigSpec.ConfigValue<?>);
}
@Test