Skip to content

Commit

Permalink
Added 4 Custom Ore Blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangerGamer-A committed Sep 30, 2024
1 parent eb2ffcd commit 8880f51
Show file tree
Hide file tree
Showing 33 changed files with 86 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/net/strangergamer/mccourse/block/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package net.strangergamer.mccourse.block;

import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.DropExperienceBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredBlock;
Expand All @@ -20,6 +22,18 @@ public class ModBlocks {
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> RAW_BLACK_OPAL_BLOCK = registerBlock("raw_black_opal_block",
() -> new Block(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_ORE = registerBlock("black_opal_ore",
() -> new DropExperienceBlock(UniformInt.of(2, 5),
BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_DEEPSLATE_ORE = registerBlock("black_opal_deepslate_ore",
() -> new DropExperienceBlock(UniformInt.of(3, 6),
BlockBehaviour.Properties.of().strength(6f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_END_ORE = registerBlock("black_opal_end_ore",
() -> new DropExperienceBlock(UniformInt.of(3, 8),
BlockBehaviour.Properties.of().strength(5f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_NETHER_ORE = registerBlock("black_opal_nether_ore",
() -> new DropExperienceBlock(UniformInt.of(1, 7),
BlockBehaviour.Properties.of().strength(3f).requiresCorrectToolForDrops()));

private static <T extends Block> DeferredBlock<T> registerBlock(String name, Supplier<T> block) {
DeferredBlock<T> toReturn = BLOCKS.register(name, block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public class ModCreativeModeTabs {
pOutput.accept(ModItems.RAW_BLACK_OPAL);
pOutput.accept(ModBlocks.BLACK_OPAL_BLOCK);
pOutput.accept(ModBlocks.RAW_BLACK_OPAL_BLOCK);
pOutput.accept(ModBlocks.BLACK_OPAL_ORE);
pOutput.accept(ModBlocks.BLACK_OPAL_DEEPSLATE_ORE);
pOutput.accept(ModBlocks.BLACK_OPAL_END_ORE);
pOutput.accept(ModBlocks.BLACK_OPAL_NETHER_ORE);


}).build());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "mccourse:block/black_opal_deepslate_ore"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "mccourse:block/black_opal_end_ore"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "mccourse:block/black_opal_nether_ore"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "mccourse:block/black_opal_ore"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

"block.mccourse.black_opal_block": "Block of Black Opal",
"block.mccourse.raw_black_opal_block": "Block of Raw Black Opal",
"block.mccourse.black_opal_ore": "Black Opal Ore",
"block.mccourse.black_opal_deepslate_ore": "Black Opal Deepslate Ore",
"block.mccourse.black_opal_end_ore": "Black Opal End Ore",
"block.mccourse.black_opal_nether_ore": "Black Opal Nether Ore",

"itemGroup.mccourse.black_opal_items_tab": "MCCourse Additions"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "mccourse:block/black_opal_deepslate_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "mccourse:block/black_opal_end_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "mccourse:block/black_opal_nether_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "mccourse:block/black_opal_ore"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mccourse:block/black_opal_deepslate_ore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mccourse:block/black_opal_end_ore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mccourse:block/black_opal_nether_ore"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mccourse:block/black_opal_ore"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8880f51

Please sign in to comment.