|
5 | 5 | import net.minecraft.block.Block;
|
6 | 6 | import net.minecraft.block.entity.BlockEntityType;
|
7 | 7 | import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
|
| 8 | +import net.minecraft.component.ComponentType; |
8 | 9 | import net.minecraft.item.BlockItem;
|
9 | 10 | import net.minecraft.item.Item;
|
10 | 11 | import net.minecraft.registry.Registries;
|
|
13 | 14 | import net.modfest.scatteredshards.block.ShardBlock;
|
14 | 15 | import net.modfest.scatteredshards.block.ShardBlockEntity;
|
15 | 16 | import net.modfest.scatteredshards.client.render.ShardBlockEntityRenderer;
|
| 17 | +import net.modfest.scatteredshards.item.ShardItem; |
16 | 18 | import net.modfest.scatteredshards.item.ShardTablet;
|
17 | 19 |
|
18 | 20 | public class ScatteredShardsContent {
|
19 | 21 | public static final Identifier SHARD_BLOCK_ID = ScatteredShards.id("shard_block");
|
20 | 22 | public static final Identifier SHARD_TABLET_ID = ScatteredShards.id("shard_tablet");
|
| 23 | + public static final Identifier SHARD_ITEM_ID = ScatteredShards.id("shard_item"); |
21 | 24 |
|
22 | 25 | public static final Block SHARD_BLOCK = new ShardBlock();
|
23 | 26 | public static final Item SHARD_BLOCK_ITEM = new BlockItem(SHARD_BLOCK, new Item.Settings());
|
24 | 27 |
|
25 | 28 | public static final Item SHARD_TABLET = new ShardTablet(new Item.Settings());
|
| 29 | + public static final Item SHARD_ITEM = new ShardItem(new Item.Settings()); |
26 | 30 |
|
27 | 31 | public static final BlockEntityType<ShardBlockEntity> SHARD_BLOCKENTITY = BlockEntityType.Builder.create(ShardBlockEntity::new, SHARD_BLOCK).build();
|
28 | 32 |
|
| 33 | + public static final ComponentType<Identifier> SHARD_ID_COMPONENT = Registry.register( |
| 34 | + Registries.DATA_COMPONENT_TYPE, |
| 35 | + ScatteredShards.id("shard_id"), |
| 36 | + ComponentType.<Identifier>builder().codec(Identifier.CODEC).build() |
| 37 | + ); |
| 38 | + |
29 | 39 | public static void register() {
|
30 | 40 | Registry.register(Registries.BLOCK, SHARD_BLOCK_ID, SHARD_BLOCK);
|
31 | 41 | Registry.register(Registries.ITEM, SHARD_BLOCK_ID, SHARD_BLOCK_ITEM);
|
32 | 42 | Registry.register(Registries.BLOCK_ENTITY_TYPE, SHARD_BLOCK_ID, SHARD_BLOCKENTITY);
|
33 | 43 | Registry.register(Registries.ITEM, SHARD_TABLET_ID, SHARD_TABLET);
|
| 44 | + Registry.register(Registries.ITEM, SHARD_ITEM_ID, SHARD_ITEM); |
34 | 45 | }
|
35 | 46 |
|
36 | 47 | @Environment(EnvType.CLIENT)
|
|
0 commit comments