added turquoise ore
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package de.jottyfan.minecraft;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import de.jottyfan.minecraft.block.QuicklyBlocks;
|
||||
import de.jottyfan.minecraft.feature.QuicklyFeatures;
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
@@ -18,5 +21,9 @@ public class Quickly implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
LOGGER.info("loading {}", MOD_ID);
|
||||
|
||||
QuicklyItems.registerModItems();
|
||||
QuicklyBlocks.registerModBlocks();
|
||||
QuicklyFeatures.registerFeatures();
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,5 @@ public class QuicklyClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
QuicklyItems.registerModItems();
|
||||
QuicklyBlocks.registerModBlocks();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootParams.Builder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockOreDeepslateTurquoise extends BlockOreTurquoise {
|
||||
|
||||
public BlockOreDeepslateTurquoise(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> getDrops(BlockState state, Builder builder) {
|
||||
return Arrays.asList(new ItemStack[] { new ItemStack(QuicklyItems.RAWTURQUOISE, 2) });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package de.jottyfan.minecraft.block;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import de.jottyfan.minecraft.item.QuicklyItems;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.AmethystBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootParams.Builder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class BlockOreTurquoise extends AmethystBlock {
|
||||
|
||||
public BlockOreTurquoise(Properties properties) {
|
||||
super(properties.strength(3.0f).sound(SoundType.AMETHYST).requiresCorrectToolForDrops());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ItemStack> getDrops(BlockState state, Builder builder) {
|
||||
return Arrays.asList(new ItemStack[] { new ItemStack(QuicklyItems.RAWTURQUOISE) });
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,19 @@ import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
*/
|
||||
public class QuicklyBlocks {
|
||||
public static final Block KELPBUNDLE = registerBlock("kelpbundle",
|
||||
Properties.of().instabreak().sound(SoundType.WET_GRASS).strength(0.1f).friction(0.95f), p -> new Block(p));
|
||||
Properties.of().instabreak().sound(SoundType.WET_GRASS).strength(0.1f).friction(0.95f));
|
||||
public static final Block TURQUOISEBLOCK = registerBlock("blockturquoise", Properties.of().strength(1.5f));
|
||||
public static final Block ORETURQUOISE = registerBlock("oreturquoise", p -> new BlockOreTurquoise(p));
|
||||
public static final Block OREDEEPSLATETURQUOISE = registerBlock("oredeepslateturquoise",
|
||||
p -> new BlockOreDeepslateTurquoise(p));
|
||||
|
||||
private static final Block registerBlock(String name, Properties properties) {
|
||||
return QuicklyBlocks.registerBlock(name, properties, p -> new Block(p));
|
||||
}
|
||||
|
||||
private static final Block registerBlock(String name, Function<Properties, Block> function) {
|
||||
return QuicklyBlocks.registerBlock(name, Properties.of(), function);
|
||||
}
|
||||
|
||||
private static final Block registerBlock(String name, Properties properties, Function<Properties, Block> function) {
|
||||
Identifier identifier = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name);
|
||||
@@ -38,6 +50,9 @@ public class QuicklyBlocks {
|
||||
public static void registerModBlocks() {
|
||||
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.BUILDING_BLOCKS).register(block -> {
|
||||
block.accept(KELPBUNDLE);
|
||||
block.accept(TURQUOISEBLOCK);
|
||||
block.accept(ORETURQUOISE);
|
||||
block.accept(OREDEEPSLATETURQUOISE);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package de.jottyfan.minecraft.feature;
|
||||
|
||||
import de.jottyfan.minecraft.Quickly;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jotty
|
||||
*
|
||||
*/
|
||||
public class QuicklyFeatures {
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> CF_ORETURQUOISE = genCf("oreturquoise");
|
||||
public static final ResourceKey<PlacedFeature> PF_ORETURQUOISE = genPf("oreturquoise");
|
||||
|
||||
private static final ResourceKey<ConfiguredFeature<?, ?>> genCf(String name) {
|
||||
return ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static final ResourceKey<PlacedFeature> genPf(String name) {
|
||||
return ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name));
|
||||
}
|
||||
|
||||
public static final void registerFeatures() {
|
||||
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Decoration.UNDERGROUND_ORES, PF_ORETURQUOISE);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,21 @@ import net.minecraft.world.item.Item.Properties;
|
||||
*
|
||||
*/
|
||||
public class QuicklyItems {
|
||||
public static final Item STUB = registerItem("stub", new Item.Properties(), p -> new Stub(p));
|
||||
public static final Item STUB = registerItem("stub", properties -> new Stub(properties));
|
||||
public static final Item RAWTURQUOISE = registerItem("rawturquoise");
|
||||
public static final Item TURQUOISEINGOT = registerItem("turquoiseingot");
|
||||
|
||||
private static final Item registerItem(String name) {
|
||||
return QuicklyItems.registerItem(name, new Item.Properties());
|
||||
}
|
||||
|
||||
private static final Item registerItem(String name, Item.Properties properties) {
|
||||
return QuicklyItems.registerItem(name, properties, p -> new Item(p));
|
||||
}
|
||||
|
||||
private static final Item registerItem(String name, Function<Properties, Item> function) {
|
||||
return QuicklyItems.registerItem(name, new Item.Properties(), function);
|
||||
}
|
||||
|
||||
private static final Item registerItem(String name, Item.Properties properties, Function<Properties, Item> function) {
|
||||
Identifier identifier = Identifier.fromNamespaceAndPath(Quickly.MOD_ID, name);
|
||||
@@ -31,6 +45,8 @@ public class QuicklyItems {
|
||||
public static void registerModItems() {
|
||||
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.TOOLS_AND_UTILITIES).register(item -> {
|
||||
item.accept(STUB);
|
||||
item.accept(RAWTURQUOISE);
|
||||
item.accept(TURQUOISEINGOT);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user