Added Sapphire ores

This commit is contained in:
Chris Toph 2025-02-16 21:41:28 -05:00
parent 9bcdf30eb4
commit 228981be16
34 changed files with 435 additions and 5 deletions

View file

@ -83,7 +83,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>

View file

@ -4,10 +4,12 @@ import java.util.function.Supplier;
import cc.toph.tutorialmod.TutorialMod;
import cc.toph.tutorialmod.item.ModItems;
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.Blocks;
import net.minecraft.world.level.block.DropExperienceBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraftforge.eventbus.api.IEventBus;
@ -22,12 +24,52 @@ public class ModBlocks {
TutorialMod.MODID);
// Blocks //
public static final RegistryObject<Block> SAPPHIRE_BLOCK = registerBlock("sapphire_block",
() -> new Block(BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK).sound(SoundType.AMETHYST)));
// @formatter:off
public static final RegistryObject<Block> SAPPHIRE_BLOCK =
registerBlock("sapphire_block",
() -> new Block(
BlockBehaviour.Properties.copy(Blocks.IRON_BLOCK)
.sound(SoundType.AMETHYST)));
public static final RegistryObject<Block> RAW_SAPPHIRE_BLOCK = registerBlock("raw_sapphire_block",
() -> new Block(BlockBehaviour.Properties.copy(Blocks.RAW_IRON_BLOCK).sound(SoundType.AMETHYST)));
public static final RegistryObject<Block> RAW_SAPPHIRE_BLOCK =
registerBlock("raw_sapphire_block",
() -> new Block(
BlockBehaviour.Properties.copy(Blocks.RAW_IRON_BLOCK)
.sound(SoundType.AMETHYST)));
public static final RegistryObject<Block> SAPPHIRE_ORE =
registerBlock("sapphire_ore",
() -> new DropExperienceBlock(
BlockBehaviour.Properties.copy(Blocks.STONE)
.strength(2f)
.sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops(), UniformInt.of(3, 6)));
public static final RegistryObject<Block> DEEPSLATE_SAPPHIRE_ORE =
registerBlock("deepslate_sapphire_ore",
() -> new DropExperienceBlock(
BlockBehaviour.Properties.copy(Blocks.DEEPSLATE_DIAMOND_ORE)
.strength(3f)
.sound(SoundType.DEEPSLATE)
.requiresCorrectToolForDrops(), UniformInt.of(4, 6)));
public static final RegistryObject<Block> NETHER_SAPPHIRE_ORE =
registerBlock("nether_sapphire_ore",
() -> new DropExperienceBlock(
BlockBehaviour.Properties.copy(Blocks.NETHER_GOLD_ORE)
.strength(1f)
.sound(SoundType.NETHER_ORE)
.requiresCorrectToolForDrops(), UniformInt.of(2, 5)));
public static final RegistryObject<Block> END_STONE_SAPPHIRE_ORE =
registerBlock("end_stone_sapphire_ore",
() -> new DropExperienceBlock(
BlockBehaviour.Properties.copy(Blocks.END_STONE)
.strength(2f)
.sound(SoundType.NETHER_ORE)
.requiresCorrectToolForDrops(), UniformInt.of(10, 30)));
// @formatter:on
// Methods //
public static void register(IEventBus eventBus) {
BLOCKS.register(eventBus);

View file

@ -25,5 +25,9 @@ public class ModCreativeTabs {
pOut.accept(ModItems.RAW_SAPPHIRE.get());
pOut.accept(ModBlocks.SAPPHIRE_BLOCK.get());
pOut.accept(ModBlocks.RAW_SAPPHIRE_BLOCK.get());
pOut.accept(ModBlocks.SAPPHIRE_ORE.get());
pOut.accept(ModBlocks.DEEPSLATE_SAPPHIRE_ORE.get());
pOut.accept(ModBlocks.END_STONE_SAPPHIRE_ORE.get());
pOut.accept(ModBlocks.NETHER_SAPPHIRE_ORE.get());
}).build());
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/deepslate_sapphire_ore"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/end_stone_sapphire_ore"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/nether_sapphire_ore"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tutorialmod:block/sapphire_ore"
}
}
}

View file

@ -4,6 +4,10 @@
"block.tutorialmod.sapphire_block": "Block of Sapphire",
"block.tutorialmod.raw_sapphire_block": "Block of Raw Sapphire",
"block.tutorialmod.sapphire_ore": "Sapphire Ore",
"block.tutorialmod.deepslate_sapphire_ore": "Deepslate Sapphire Ore",
"block.tutorialmod.nether_sapphire_ore": "Netherack Sapphire Ore",
"block.tutorialmod.end_stone_sapphire_ore": "End Stone Sapphire Ore",
"creativetab.tutorial_tab": "Sapphire Tab"
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "tutorialmod:block/deepslate_sapphire_ore"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "tutorialmod:block/end_stone_sapphire_ore"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "tutorialmod:block/nether_sapphire_ore"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "tutorialmod:block/sapphire_ore"
}
}

View file

@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/deepslate_sapphire_ore"
}

View file

@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/end_stone_sapphire_ore"
}

View file

@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/nether_sapphire_ore"
}

View file

@ -0,0 +1,3 @@
{
"parent": "tutorialmod:block/sapphire_ore"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,10 @@
{
"values": [
"tutorialmod:sapphire_block",
"tutorialmod:raw_sapphire_block",
"tutorialmod:sapphire_ore",
"tutorialmod:deepslate_sapphire_ore",
"tutorialmod:end_stone_sapphire_ore",
"tutorialmod:nether_sapphire_ore"
]
}

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,10 @@
{
"values": [
"tutorialmod:sapphire_block",
"tutorialmod:raw_sapphire_block",
"tutorialmod:sapphire_ore",
"tutorialmod:deepslate_sapphire_ore",
"tutorialmod:end_stone_sapphire_ore",
"tutorialmod:nether_sapphire_ore"
]
}

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,3 @@
{
"values": []
}

View file

@ -0,0 +1,59 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "tutorialmod:deepslate_sapphire_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 40.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "tutorialmod:raw_sapphire"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/deepslate_sapphire_ore"
}

View file

@ -0,0 +1,59 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "tutorialmod:end_stone_sapphire_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 40.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "tutorialmod:raw_sapphire"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/end_stone_sapphire_ore"
}

View file

@ -0,0 +1,59 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "tutorialmod:nether_sapphire_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 40.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "tutorialmod:raw_sapphire"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/nether_sapphire_ore"
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:raw_sapphire_block"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/sapphire_block"
}

View file

@ -0,0 +1,21 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "tutorialmod:sapphire_block"
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/sapphire_block"
}

View file

@ -0,0 +1,59 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "tutorialmod:sapphire_ore"
},
{
"type": "minecraft:item",
"functions": [
{
"add": false,
"count": {
"type": "minecraft:uniform",
"max": 40.0,
"min": 2.0
},
"function": "minecraft:set_count"
},
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops",
"function": "minecraft:apply_bonus"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "tutorialmod:raw_sapphire"
}
]
}
],
"rolls": 1.0
}
],
"random_sequence": "tutorialmod:blocks/sapphire_ore"
}