added missing ores

This commit is contained in:
Jottyfan
2026-01-01 12:21:41 +01:00
parent 5334234ba5
commit b1c7a86a07
79 changed files with 777 additions and 16 deletions

View File

@@ -22,9 +22,9 @@ import net.minecraft.world.phys.BlockHitResult;
public class BlockOre extends Block {
private SoundEvent soundEvent;
private ItemStack dropItems;
private ItemStack[] dropItems;
public BlockOre(Properties properties, SoundEvent soundEvent, ItemStack dropItems) {
public BlockOre(Properties properties, SoundEvent soundEvent, ItemStack... dropItems) {
super(properties.requiresCorrectToolForDrops());
this.soundEvent = soundEvent;
this.dropItems = dropItems;
@@ -32,8 +32,8 @@ public class BlockOre extends Block {
@Override
protected List<ItemStack> getDrops(BlockState state, Builder builder) {
ItemStack droppable = dropItems == null ? new ItemStack(this.asItem()) : dropItems;
return Arrays.asList(new ItemStack[] { droppable });
ItemStack[] droppable = dropItems == null ? new ItemStack[] { new ItemStack(this.asItem()) } : dropItems;
return Arrays.asList(droppable);
}
@Override

View File

@@ -3,10 +3,6 @@ package de.jottyfan.minecraft.block;
import java.util.function.Function;
import de.jottyfan.minecraft.Quickly;
import de.jottyfan.minecraft.blockentity.QuicklyBlockEntity;
import de.jottyfan.minecraft.blockentity.BlockStackerEntity;
import de.jottyfan.minecraft.blockentity.DrillBlockEntity;
import de.jottyfan.minecraft.blockentity.ItemHoarderBlockEntity;
import de.jottyfan.minecraft.item.QuicklyItems;
import de.jottyfan.minecraft.tab.QuicklyTab;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
@@ -19,10 +15,10 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
/**
@@ -57,10 +53,17 @@ public class QuicklyBlocks {
public static final Block ITEMHOARDER = registerBlock("itemhoarder", properties -> new Itemhoarder(properties));
public static final Block DRILL = registerBlock("drill", properties -> new BlockDrill(properties));
public static final Block STACKER = registerBlock("blockstacker", properties -> new BlockStacker(properties.strength(2.5f)));
public static final Block DIRTSALPETER = registerBlock("dirtsalpeter", properties -> new BlockOre(properties.strength(2.2f), null, new ItemStack(QuicklyItems.SALPETER, 1), new ItemStack(Items.DIRT)));
public static final Block SANDSALPETER = registerBlock("sandsalpeter", properties -> new BlockOre(properties.strength(1.5f), null, new ItemStack(QuicklyItems.SALPETER, 2), new ItemStack(Items.SAND)));
public static final Block OREDEEPSLATESULFOR = registerBlock("oredeepslatesulfor", properties -> new BlockOre(properties.strength(2.0f), null, new ItemStack(QuicklyItems.SULFOR, 4)));
public static final Block ORENETHERSULFOR = registerBlock("orenethersulfor", properties -> new BlockOre(properties.strength(2.0f), null, new ItemStack(QuicklyItems.SULFOR)));
public static final Block ORESALPETER = registerBlock("oresalpeter", properties -> new BlockOre(properties.strength(1.9f), null, new ItemStack(QuicklyItems.SALPETER, 2)));
public static final Block ORESANDSALPETER = registerBlock("oresandsalpeter", properties -> new BlockOre(properties.strength(1.5f), null, new ItemStack(QuicklyItems.SALPETER, 7)));
public static final Block ORESULFOR = registerBlock("oresulfor", properties -> new BlockOre(properties.strength(1.9f), null, new ItemStack(QuicklyItems.SULFOR)));
public static final Block ORESPEEDPOWDER = registerBlock("orespeedpowder", properties -> new BlockOre(properties.strength(2.0f), null, new ItemStack(QuicklyItems.SPEEDPOWDER)));
public static final Block OREDEEPSLATESPEEDPOWDER = registerBlock("oredeepslatespeedpowder", properties -> new BlockOre(properties.strength(2.1f), null, new ItemStack(QuicklyItems.SPEEDPOWDER, 2)));
// TODO: add salpeter ore, sulfor ore
// TODO: merge lavahoarder and emptylavahoarder into one block using a BooleanProperty for the lava fill state
// TODO: repair block stacker bugs; transport seems to only use the max container size slot
private static final Block registerBlock(String name, Properties properties) {
return QuicklyBlocks.registerBlock(name, properties, p -> new Block(p));
@@ -84,8 +87,17 @@ public class QuicklyBlocks {
ItemGroupEvents.modifyEntriesEvent(QuicklyTab.QUICKLY_TAB).register(block -> {
block.accept(KELPBUNDLE);
block.accept(TURQUOISEBLOCK);
block.accept(DIRTSALPETER);
block.accept(SANDSALPETER);
block.accept(ORESALPETER);
block.accept(ORESULFOR);
block.accept(ORETURQUOISE);
block.accept(ORESPEEDPOWDER);
block.accept(ORESANDSALPETER);
block.accept(OREDEEPSLATETURQUOISE);
block.accept(OREDEEPSLATESULFOR);
block.accept(OREDEEPSLATESPEEDPOWDER);
block.accept(ORENETHERSULFOR);
block.accept(EMPTYLAVAHOARDER);
block.accept(SPEEDPOWDER);
block.accept(QUICKIEPOWDER);

View File

@@ -17,7 +17,24 @@ import net.minecraft.world.level.levelgen.placement.PlacedFeature;
*/
public class QuicklyFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORETURQUOISE = genCf("oreturquoise");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESULFOR = genCf("oresulfor");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_OREDEEPSLATESULFUR = genCf("oredepslatesulfor");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESALPETER = genCf("oresalpeter");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORENETHERSULFOR = genCf("orenethersulfor");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_DIRTSALPETER = genCf("dirtsalpeter");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_SANDSALPETER = genCf("sandsalpeter");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESANDSALPETER = genCf("oresandsalpeter");
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORESPEEDPOWDER = genCf("orespeedpowder");
public static final ResourceKey<PlacedFeature> PF_ORETURQUOISE = genPf("oreturquoise");
public static final ResourceKey<PlacedFeature> PF_ORESULFOR = genPf("oresulfor");
public static final ResourceKey<PlacedFeature> PF_OREDEEPSLATESULFOR = genPf("oredeepslatesulfor");
public static final ResourceKey<PlacedFeature> PF_ORESALPETER = genPf("oresalpeter");
public static final ResourceKey<PlacedFeature> PF_ORENETHERSULFOR = genPf("orenethersulfor");
public static final ResourceKey<PlacedFeature> PF_DIRTSALPETER = genPf("dirtsalpeter");
public static final ResourceKey<PlacedFeature> PF_SANDSALPETER = genPf("sandsalpeter");
public static final ResourceKey<PlacedFeature> PF_ORESANDSALPETER = genPf("oresandsalpeter");
public static final ResourceKey<PlacedFeature> PF_ORESPEEDPOWDER = genPf("orespeedpowder");
private static final ResourceKey<ConfiguredFeature<?, ?>> genCf(String name) {
return ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name));
@@ -29,5 +46,14 @@ public class QuicklyFeatures {
public static final void registerFeatures() {
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORETURQUOISE);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORESULFOR);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORESALPETER);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_DIRTSALPETER);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_SANDSALPETER);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORESANDSALPETER);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_OREDEEPSLATESULFOR);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORESPEEDPOWDER);
BiomeModifications.addFeature(BiomeSelectors.foundInTheNether(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORENETHERSULFOR);
}
}

View File

@@ -44,8 +44,9 @@ public class QuicklyItems {
public static final Item SPEEDINGOT = registerItem("speedingot");
public static final Item QUICKIEINGOT = registerItem("quickieingot");
public static final Item MAGNIFIER = registerItem("magnifier");
public static final Item SALPETER = registerItem("salpeter");
public static final Item SULFOR = registerItem("sulfor");
// TODO: salpeter, sulfor
// TODO: carrot stack
// TODO: tools
@@ -99,6 +100,8 @@ public class QuicklyItems {
item.accept(COPPERSTRING);
item.accept(COPPERSTICK);
item.accept(COPPERSTUB);
item.accept(SALPETER);
item.accept(SULFOR);
item.accept(MAGNIFIER);
item.accept(ARMOR_TURQUOISE_HELMET);
item.accept(ARMOR_TURQUOISE_CHESTPLATE);