|
| 1 | +package net.flatkat.ancient_forgotten.block; |
| 2 | + |
| 3 | +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; |
| 4 | +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; |
| 5 | +import net.flatkat.ancient_forgotten.AncientAndForgotten; |
| 6 | +import net.minecraft.block.Block; |
| 7 | +import net.minecraft.block.Blocks; |
| 8 | +import net.minecraft.item.BlockItem; |
| 9 | +import net.minecraft.item.Item; |
| 10 | +import net.minecraft.registry.Registries; |
| 11 | +import net.minecraft.registry.Registry; |
| 12 | +import net.minecraft.util.Identifier; |
| 13 | + |
| 14 | +public class ModBlocks { |
| 15 | + public static final Block UNKNOWN_BLOCK = registerBlock("unknown_block", |
| 16 | + new Block(FabricBlockSettings.copyOf(Blocks.DIRT))); |
| 17 | + |
| 18 | + private static Block registerBlock(String name, Block block){ |
| 19 | + registerBlockItem(name, block); |
| 20 | + return Registry.register(Registries.BLOCK, new Identifier(AncientAndForgotten.MOD_ID, name), block); |
| 21 | + } |
| 22 | + |
| 23 | + private static Item registerBlockItem(String name, Block block){ |
| 24 | + return Registry.register(Registries.ITEM, new Identifier(AncientAndForgotten.MOD_ID, name), |
| 25 | + new BlockItem(block, new FabricItemSettings())); |
| 26 | + } |
| 27 | + |
| 28 | + public static void registerModBlocks(){ |
| 29 | + AncientAndForgotten.LOGGER.info("Registering ModBlocks for " + AncientAndForgotten.MOD_ID); |
| 30 | + } |
| 31 | +} |
0 commit comments