Skip to content

Commit

Permalink
Added Custom Stair And Slab
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangerGamer-A committed Oct 11, 2024
1 parent 5d9f153 commit 9891d48
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod_name=MC Course Mod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/
mod_version=0.7.0
mod_version=0.3.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
// 1.21 2024-10-10T22:20:20.6395424 Block States: mccourse
// 1.21 2024-10-11T08:43:00.0275527 Block States: mccourse
b548ddf1ba2ad5a2d24ac1505a095060da0f300b assets/mccourse/blockstates/black_opal_block.json
8011a7ad7f38c38738b4f0281d8f963e63e147b7 assets/mccourse/blockstates/black_opal_deepslate_ore.json
dee68e880aaabdd62b9c208cbc8bac6c73e83741 assets/mccourse/blockstates/black_opal_end_ore.json
62df3ac75badaab1a8e87e8762d9268e20727d4e assets/mccourse/blockstates/black_opal_nether_ore.json
29639e83133c22cffeb9dd6cc665b3815a74f2ec assets/mccourse/blockstates/black_opal_ore.json
e2b7597798ab27b4d66d71cdcc0056d1331a693b assets/mccourse/blockstates/black_opal_slab.json
0616f39bd6edcd5952f53e79c6881350e9c3016f assets/mccourse/blockstates/black_opal_stairs.json
bc7d21f942c84b754066fc4a8c9f34dc61953149 assets/mccourse/blockstates/magic_block.json
350efab9079195561f26d5623ae2699910f7c5e3 assets/mccourse/blockstates/raw_black_opal_block.json
16594933daac66af92459e3f64b9541403a09a5a assets/mccourse/models/block/black_opal_block.json
cf7860ecc77006a8e2dc402940ccdb014e08b165 assets/mccourse/models/block/black_opal_deepslate_ore.json
882a69ec8483966f3f4215e3ae1d801c60024aa5 assets/mccourse/models/block/black_opal_end_ore.json
2a5598e9b2754f2164c05c6a2495a167f4cd5e0c assets/mccourse/models/block/black_opal_nether_ore.json
a63d67b037e80a0bb1b0a5742487434678f625cc assets/mccourse/models/block/black_opal_ore.json
927032c2faf4db8bf039557e150a73a60708f346 assets/mccourse/models/block/black_opal_slab.json
f608ecb8179349c1675d92504b296a3b2de3b545 assets/mccourse/models/block/black_opal_slab_top.json
05aaa1deeea8a85a8812404241d31a7cd901011c assets/mccourse/models/block/black_opal_stairs.json
6f366005565035041544048bdb3fac4c6748995b assets/mccourse/models/block/black_opal_stairs_inner.json
a80b293d3efc62dbd198bb1abc465499d46c8bc6 assets/mccourse/models/block/black_opal_stairs_outer.json
e3bea00dd7e933deb59eaf492b010a1f8fdd914f assets/mccourse/models/block/magic_block.json
92bc8351a686ddaf46e7372dbff2d7cd7223d510 assets/mccourse/models/block/raw_black_opal_block.json
850bccb986ef052432ab1d7ae2578dae5a2a1327 assets/mccourse/models/item/black_opal_block.json
453c92a815a8d8bae418983e76f5ba62350864d9 assets/mccourse/models/item/black_opal_deepslate_ore.json
aa57c162b02dcc944bdffd94bfbeaa4a2bcfa499 assets/mccourse/models/item/black_opal_end_ore.json
bf216e482fe415b0580c56ccc332943e6dba0ba3 assets/mccourse/models/item/black_opal_nether_ore.json
8373937307aea46b90ae008761eb5ec89ed06b21 assets/mccourse/models/item/black_opal_ore.json
7d2661b7727be85708cff7b1245f210b65a2240a assets/mccourse/models/item/black_opal_slab.json
2d8d7242b35fd03381f9b30ab61db1cf40c87b5c assets/mccourse/models/item/black_opal_stairs.json
81592028bd20273a9ad8afaf67ef7059fbe88e93 assets/mccourse/models/item/magic_block.json
6ce5de5fe9c4c3406e90502b7f35cb97cdfa68d8 assets/mccourse/models/item/raw_black_opal_block.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// 1.21 2024-10-10T22:20:20.6294971 Loot Tables
// 1.21 2024-10-11T08:43:00.0119223 Loot Tables
5bd3bb7304b3d56f341a1fa283ab1fd3b158e989 data/mccourse/loot_table/blocks/black_opal_block.json
ac97f2112eaf41f0fc26f462aa3ab72646904658 data/mccourse/loot_table/blocks/black_opal_deepslate_ore.json
3163c65f79d3c5f1a856908a28d9bc10d014613e data/mccourse/loot_table/blocks/black_opal_end_ore.json
b3414ef07d5113bc15691ce4ecda444e233a80df data/mccourse/loot_table/blocks/black_opal_nether_ore.json
f18fa9e5e44fc71e1aa4499ef5485b765e692429 data/mccourse/loot_table/blocks/black_opal_ore.json
c1bcded8838560db884dd1290769dcad10c23635 data/mccourse/loot_table/blocks/black_opal_slab.json
4031d97fc4e40d2ff5d9663361a9aa1c5039b232 data/mccourse/loot_table/blocks/black_opal_stairs.json
d6027ba6b4319c7e3e32b50aafa73ca9013af0be data/mccourse/loot_table/blocks/magic_block.json
50415aed90ef076bc00ef891626fa6ef366aec46 data/mccourse/loot_table/blocks/raw_black_opal_block.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// 1.21 2024-10-10T22:20:20.6340309 Recipes
// 1.21 2024-10-11T08:43:00.0119223 Recipes
4958be86dc8ededa248e438f8ec77757340342d3 data/mccourse/advancement/recipes/building_blocks/black_opal_slab.json
3a3b666387507279530912650089b8a21a8b6df6 data/mccourse/advancement/recipes/building_blocks/black_opal_stairs.json
81de67c031619c5816eb0e6fd66669cd28766bbe data/mccourse/advancement/recipes/misc/black_opal.json
55d1bb30905b8a54d492ff18134fce623c598ba2 data/mccourse/advancement/recipes/misc/black_opal_2.json
c2db6db95cc6a5fde8a9a3841f6134631d6fb5f3 data/mccourse/advancement/recipes/misc/black_opal_block.json
Expand All @@ -25,3 +27,5 @@ a8de891d8865e71cb6d1e9f78131a9cee5a8f63f data/mccourse/advancement/recipes/misc/
4cfdd133a68e3b0aef13d4ae82f658d29948a85f data/mccourse/recipe/black_opal_from_smelting_black_opal_nether_ore.json
c6886878b2826d0e270effa60e951c41d29b2104 data/mccourse/recipe/black_opal_from_smelting_black_opal_ore.json
5b08a5a1b0db4aa665398cc5b29f8d2da35a17f8 data/mccourse/recipe/black_opal_from_smelting_raw_black_opal.json
b55618e3a2a25d8654d62d057f90a4f457b5ba61 data/mccourse/recipe/black_opal_slab.json
0ad75505948a975a45902eec7fd7d483667373a3 data/mccourse/recipe/black_opal_stairs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"mccourse:black_opal_deepslate_ore",
"mccourse:black_opal_end_ore",
"mccourse:black_opal_nether_ore",
"mccourse:magic_block"
"mccourse:magic_block",
"mccourse:black_opal_slab",
"mccourse:black_opal_stairs"
]
}
7 changes: 7 additions & 0 deletions src/main/java/net/strangergamer/mccourse/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
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.SlabBlock;
import net.minecraft.world.level.block.StairBlock;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredBlock;
Expand Down Expand Up @@ -37,6 +39,11 @@ public class ModBlocks {
BlockBehaviour.Properties.of().strength(3f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> MAGIC_BLOCK = registerBlock("magic_block",
() -> new MagicBlock(BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_STAIRS = registerBlock("black_opal_stairs",
() -> new StairBlock(ModBlocks.BLACK_OPAL_BLOCK.get().defaultBlockState(),
BlockBehaviour.Properties.of().strength(4f).requiresCorrectToolForDrops()));
public static final DeferredBlock<Block> BLACK_OPAL_SLAB = registerBlock("black_opal_slab",
() -> new SlabBlock(BlockBehaviour.Properties.of().strength(4f).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 @@ -26,6 +26,7 @@ protected void generate() {
dropSelf(ModBlocks.BLACK_OPAL_BLOCK.get());
dropSelf(ModBlocks.RAW_BLACK_OPAL_BLOCK.get());
dropSelf(ModBlocks.MAGIC_BLOCK.get());
dropSelf(ModBlocks.BLACK_OPAL_STAIRS.get());
this.add(ModBlocks.BLACK_OPAL_ORE.get(),
block -> createOreDrop(ModBlocks.BLACK_OPAL_ORE.get(), ModItems.RAW_BLACK_OPAL.get()));
this.add(ModBlocks.BLACK_OPAL_DEEPSLATE_ORE.get(),
Expand All @@ -34,6 +35,9 @@ protected void generate() {
block -> createMultipleOreDrops(ModBlocks.BLACK_OPAL_END_ORE.get(), ModItems.RAW_BLACK_OPAL.get(), 4, 7));
this.add(ModBlocks.BLACK_OPAL_NETHER_ORE.get(),
block -> createMultipleOreDrops(ModBlocks.BLACK_OPAL_NETHER_ORE.get(), ModItems.RAW_BLACK_OPAL.get(), 3, 9));
dropSelf(ModBlocks.BLACK_OPAL_STAIRS.get());
this.add(ModBlocks.BLACK_OPAL_SLAB.get(),
block -> createSlabItemTable(ModBlocks.BLACK_OPAL_SLAB.get()));
}
protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) {
HolderLookup.RegistryLookup<Enchantment> registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.strangergamer.mccourse.datagen;

import net.minecraft.world.level.block.SlabBlock;
import net.minecraft.world.level.block.StairBlock;
import net.neoforged.neoforge.client.model.generators.ModelFile;
import net.strangergamer.mccourse.MCCourseMod;
import net.strangergamer.mccourse.block.ModBlocks;
import net.minecraft.data.PackOutput;
Expand All @@ -20,8 +23,17 @@ protected void registerStatesAndModels() {
blockWithItem(ModBlocks.BLACK_OPAL_END_ORE);
blockWithItem(ModBlocks.BLACK_OPAL_NETHER_ORE);
blockWithItem(ModBlocks.MAGIC_BLOCK);

stairsBlock(((StairBlock) ModBlocks.BLACK_OPAL_STAIRS.get()), blockTexture(ModBlocks.BLACK_OPAL_BLOCK.get()));
slabBlock(((SlabBlock) ModBlocks.BLACK_OPAL_SLAB.get()), blockTexture(ModBlocks.BLACK_OPAL_BLOCK.get()), blockTexture(ModBlocks.BLACK_OPAL_BLOCK.get()));
blockItem(ModBlocks.BLACK_OPAL_STAIRS);
blockItem(ModBlocks.BLACK_OPAL_SLAB);
}
private void blockWithItem(DeferredBlock<Block> deferredBlock) {
simpleBlockWithItem(deferredBlock.get(), cubeAll(deferredBlock.get()));
}

private void blockItem(DeferredBlock<Block> deferredBlock) {
simpleBlockItem(deferredBlock.get(), new ModelFile.UncheckedModelFile("mccourse:block/" + deferredBlock.getId().getPath()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ protected void buildRecipes(RecipeOutput pRecipeOutput) {
.unlockedBy("has_magic_block", has(ModBlocks.MAGIC_BLOCK.get())).save(pRecipeOutput, "mccourse:black_opal_2");
oreSmelting(pRecipeOutput, BLACK_OPAL_SMELTABLES, RecipeCategory.MISC, ModItems.BLACK_OPAL.get(), 0.25f, 200, "black_opal");
oreBlasting(pRecipeOutput, BLACK_OPAL_SMELTABLES, RecipeCategory.MISC, ModItems.BLACK_OPAL.get(), 0.25f, 100, "black_opal");
stairBuilder(ModBlocks.BLACK_OPAL_STAIRS.get(), Ingredient.of(ModItems.BLACK_OPAL.get())).group("black_opal")
.unlockedBy("has_black_opal", has(ModItems.BLACK_OPAL.get())).save(pRecipeOutput);
slab(pRecipeOutput, RecipeCategory.BUILDING_BLOCKS, ModBlocks.BLACK_OPAL_SLAB.get(), ModItems.BLACK_OPAL.get());
}
protected static void oreSmelting(RecipeOutput pRecipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
float pExperience, int pCookingTIme, String pGroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class ModCreativeModeTabs {
pOutput.accept(ModBlocks.BLACK_OPAL_END_ORE);
pOutput.accept(ModBlocks.BLACK_OPAL_NETHER_ORE);
pOutput.accept(ModBlocks.MAGIC_BLOCK);
pOutput.accept(ModBlocks.BLACK_OPAL_STAIRS);
pOutput.accept(ModBlocks.BLACK_OPAL_SLAB);



Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/mccourse/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"block.mccourse.black_opal_deepslate_ore": "Deepslate Black Opal Ore",
"block.mccourse.black_opal_end_ore": "End Black Opal Ore",
"block.mccourse.black_opal_nether_ore": "Nether Black Opal Ore",
"block.mccourse.black_opal_stairs": "Black Opal Stairs",
"block.mccourse.black_opal_slab": "Black Opal Slab",
"tooltip.mccourse.chainsaw.tooltip.shift": "Press §eShift§r for more Information",
"tooltip.mccourse.chainsaw.tooltip.1": "This chainsaw is awesome and will cut down trees!",
"tooltip.mccourse.chainsaw.tooltip.2": "§oChainsaw go vroom!§r",
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/mccourse/lang/fr_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
"block.mccourse.black_opal_deepslate_ore": "Minerai d’opale noire Deepslate",
"block.mccourse.black_opal_end_ore": "Minerai d’opale noire du End",
"block.mccourse.black_opal_nether_ore": "Minerai d’opale noire du Nether",
"block.mccourse.black_opal_stairs": "Escalier en opale noire",
"block.mccourse.black_opal_slab": "Dalle Opale Noire",
"tooltip.mccourse.chainsaw.tooltip.shift": "Appuyez sur §eShift§r pour plus d’informations",
"tooltip.mccourse.chainsaw.tooltip.1": "Cette tronçonneuse est géniale et coupera des arbres !",
"tooltip.mccourse.chainsaw.tooltip.2": "§oTronçonneuse go vroum !§r",
"tooltip.mccourse.magic_block.tooltip.1": "Ce bloc est très, très §9MAGIQUE§r",
"tooltip.mccourse.tomato.1": "Tomate; Tomate",
"itemGroup.mccourse.black_opal_items_tab": "Ajouts à MCCourse"
"itemGroup.mccourse.black_opal_items_tab": "Ajouts à MCCourse",
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/mccourse/lang/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"block.mccourse.black_opal_deepslate_ore": "Minério de Opala Negra de Deepslate",
"block.mccourse.black_opal_end_ore": "Minério de Opala Negra de End",
"block.mccourse.black_opal_nether_ore": "Minério Opala Negra de Nether",
"block.mccourse.black_opal_stairs": "Escadas de Opala Negra",
"block.mccourse.black_opal_slab": "Laje de Opala Negra",
"tooltip.mccourse.chainsaw.tooltip.shift": "Pressione §eShift§r para obter mais informações",
"tooltip.mccourse.chainsaw.tooltip.1": "Esta motosserra é incrível e corta árvores!",
"tooltip.mccourse.chainsaw.tooltip.2": "§oMotosserra go vroom!§r",
Expand Down

0 comments on commit 9891d48

Please sign in to comment.