This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"block.tutorialmod.amethyst_ore": "Amethyst Ore", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ModBlocks.register(eventBus); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variants": { | |
"": { "model": "tutorialmod:block/amethyst_ore" } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "minecraft:block", | |
"pools": [ | |
{ | |
"rolls": 1, | |
"entries": [ | |
{ | |
"type": "minecraft:item", | |
"name": "tutorialmod:amethyst" | |
} | |
] | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ModBlocks { | |
public static final DeferredRegister<Block> BLOCKS | |
= DeferredRegister.create(ForgeRegistries.BLOCKS, TutorialMod.MOD_ID); | |
public static final RegistryObject<Block> AMETHYST_ORE = registerBlock("amethyst_ore", | |
() -> new Block(AbstractBlock.Properties.create(Material.ROCK) | |
.harvestLevel(2).setRequiresTool().harvestTool(ToolType.PICKAXE).hardnessAndResistance(5f))); | |
private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block) { | |
RegistryObject<T> toReturn = BLOCKS.register(name, block); | |
registerBlockItem(name, toReturn); | |
return toReturn; | |
} | |
private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) { | |
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), | |
new Item.Properties().group(ModItemGroup.TUTORIAL_GROUP))); | |
} | |
public static void register(IEventBus eventBus) { | |
BLOCKS.register(eventBus); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parent": "block/cube_all", | |
"textures": { | |
"all": "tutorialmod:block/amethyst_ore" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parent": "tutorialmod:block/amethyst_ore" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment