Skip to content

Commit 7c92469

Browse files
committed
tried to get the block dust rune working
1 parent 84a7668 commit 7c92469

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

common/src/main/java/net/hex_chalkcircles/blocks/BlockDustRune.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class BlockDustRune extends BlockSlate {
66

77
public BlockDustRune(Properties p_53182_) {
88
super(p_53182_);
9-
// TODO Auto-generated constructor stub
9+
1010
}
1111

1212
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package net.hex_chalkcircles.registry;
2+
3+
import static net.hex_chalkcircles.Hex_chalkcircles.id;
4+
5+
import dev.architectury.registry.CreativeTabRegistry;
6+
import dev.architectury.registry.registries.DeferredRegister;
7+
import dev.architectury.registry.registries.RegistrySupplier;
8+
import net.hex_chalkcircles.Hex_chalkcircles;
9+
import net.hex_chalkcircles.blocks.BlockDustRune;
10+
import net.hex_chalkcircles.item.*;
11+
import net.minecraft.core.Registry;
12+
import net.minecraft.world.item.CreativeModeTab;
13+
import net.minecraft.world.item.Item;
14+
import net.minecraft.world.item.ItemStack;
15+
import net.minecraft.world.level.block.Block;
16+
import net.minecraft.world.level.block.entity.BlockEntity;
17+
import net.minecraft.world.level.block.entity.BlockEntityType;
18+
19+
20+
public class Hex_chalkcirclesBlockRegistry {
21+
// Register items through this
22+
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(Hex_chalkcircles.MOD_ID, Registry.BLOCK_REGISTRY);
23+
public static final DeferredRegister<BlockEntityType<?>> BLOCKENTITIES = DeferredRegister.create(Hex_chalkcircles.MOD_ID, Registry.BLOCK_ENTITY_TYPE_REGISTRY);
24+
25+
private static final Item.Properties CHALKCIRCLES_64STACK = new Item.Properties().stacksTo(64);
26+
private static final Item.Properties CHALKCIRCLES_16STACK = new Item.Properties().stacksTo(16);
27+
private static final Item.Properties CHALKCIRCLES_UNSTACKABLE = new Item.Properties().stacksTo(1);
28+
29+
30+
public static void init() {
31+
BLOCKS.register();
32+
BLOCKENTITIES.register();
33+
}
34+
35+
// A new creative tab. Notice how it is one of the few things that are not deferred
36+
37+
// During the loading phase, refrain from accessing suppliers' items (e.g. EXAMPLE_ITEM.get()), they will not be available
38+
public static final RegistrySupplier<BlockDustRune> CHALK_RUNE = BLOCKS.register("chalk_square_block", () -> new BlockDustRune();
39+
}

common/src/main/java/net/hex_chalkcircles/registry/Hex_chalkcirclesItemRegistry.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
import net.hex_chalkcircles.Hex_chalkcircles;
99
import net.hex_chalkcircles.item.*;
1010
import net.minecraft.core.Registry;
11+
import net.minecraft.world.item.BlockItem;
1112
import net.minecraft.world.item.CreativeModeTab;
1213
import net.minecraft.world.item.Item;
1314
import net.minecraft.world.item.ItemStack;
1415

1516
public class Hex_chalkcirclesItemRegistry {
1617
// Register items through this
1718
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(Hex_chalkcircles.MOD_ID, Registry.ITEM_REGISTRY);
19+
private static final Item.Properties CHALKCIRCLES_64STACK = new Item.Properties().stacksTo(64);
1820
private static final Item.Properties CHALKCIRCLES_16STACK = new Item.Properties().stacksTo(16);
1921
private static final Item.Properties CHALKCIRCLES_UNSTACKABLE = new Item.Properties().stacksTo(1);
2022

@@ -28,6 +30,6 @@ public static void init() {
2830

2931
// During the loading phase, refrain from accessing suppliers' items (e.g. EXAMPLE_ITEM.get()), they will not be available
3032
public static final RegistrySupplier<Item> CHALKSTICK_ITEM = ITEMS.register("amethyst_chalk", () -> new ItemChalkStick(CHALKCIRCLES_16STACK));
31-
33+
public static final RegistrySupplier<BlockItem> CHALKSQUARE_ITEM = ITEMS.register("chalk_square_item", () -> new BlockItem(Hex_chalkcirclesBlockRegistry.CHALK_RUNE.get(), CHALKCIRCLES_64STACK));
3234

3335
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"type": "minecraft:crafting_shapeless",
3+
"ingredients": [
4+
{
5+
"item": "minecraft:calcite"
6+
},
7+
{
8+
"item": "hexcasting:amethyst_dust"
9+
},
10+
{
11+
"item": "hexcasting:amethyst_dust"
12+
},
13+
{
14+
"item": "minecraft:calcite"
15+
}
16+
],
17+
"result": {
18+
"item": "hex_chalkcircles:amethyst_chalk",
19+
"count": 16
20+
}
21+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"replace": false,
3+
"values":[
4+
"hex_chalkcircles:amethyst_chalk"
5+
]
6+
}

0 commit comments

Comments
 (0)