Skip to content

Commit

Permalink
- Add models for reinforced tools
Browse files Browse the repository at this point in the history
- Happy block can get ignited by fire now
- Add recipes for bread tools
- Update README.md
  • Loading branch information
ttttdoy committed Apr 16, 2024
1 parent 3c4f99b commit a8f2dc6
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [X] Axe
- [X] Sword
- [X] Reinforced Variants of tools
- [ ] Crafting/Smithing recipes for tools
- [X] Crafting/Smithing recipes for tools
- [ ] Balance Tool stats against wood/stone, diamond/netherite for reinforced
- Similar to netherite or diamond, faster than diamond but once again weaker in durability and strength
- [X] Bread Block
Expand Down Expand Up @@ -61,7 +61,7 @@
- [ ] "Godlike loaf" a monstrous combination of rare materials and a nether star to give you 10 full minutes of positive potion effects and a whole 10 absorption hearts
- [ ] "Farmhouse structure" a random house with a farm attached to it with a random amount of bread or wheat in loot chests
- [ ] "Reinforced bread armor" basically bread armor except it doesn't dissolve in water and is comparable to diamond armor, high enchantability
- [ ] "Bread tools and weapons" tools and weapons have stats comparable to stone tools, can be upgraded to their Reinforced variant for a much stronger / longer lasting item\
- [X] "Bread tools and weapons" tools and weapons have stats comparable to stone tools, can be upgraded to their Reinforced variant for a much stronger / longer lasting item\
---
## Advanced, Machines and stuff
Todo..
Expand Down
13 changes: 13 additions & 0 deletions src/main/kotlin/breadmod/block/HappyBlock.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.sounds.SoundSource
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Explosion
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Blocks
Expand Down Expand Up @@ -53,4 +54,16 @@ class HappyBlock : TntBlock(Properties.copy(Blocks.TNT)) {
pLevel.addFreshEntity(primedHappyBlock)
}
}

override fun isFlammable(state: BlockState?, level: BlockGetter?, pos: BlockPos?, direction: Direction?): Boolean {
return true
}

override fun getFlammability(state: BlockState?, level: BlockGetter?, pos: BlockPos?, direction: Direction?): Int {
return 15
}

override fun getFireSpreadSpeed(state: BlockState?, level: BlockGetter?, pos: BlockPos?, direction: Direction?): Int {
return 30
}
}
5 changes: 5 additions & 0 deletions src/main/kotlin/breadmod/datagen/ModItemModelProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class ModItemModelProvider(output: PackOutput, modid: String, existingFileHelper
singleItem(ModItems.BREAD_AXE)
singleItem(ModItems.BREAD_HOE)
singleItem(ModItems.BREAD_SLICE)
singleItem(ModItems.RF_BREAD_SHOVEL)
singleItem(ModItems.RF_BREAD_AXE)
singleItem(ModItems.RF_BREAD_HOE)
singleItem(ModItems.RF_BREAD_SWORD)
singleItem(ModItems.RF_BREAD_PICKAXE)
singleItem(ModItems.TEST_DISC)
singleItem(ModItems.DOUGH)
singleItem(ModItems.FLOUR)
Expand Down
92 changes: 92 additions & 0 deletions src/main/kotlin/breadmod/datagen/ModRecipeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,98 @@ class ModRecipeProvider(pOutput: PackOutput) : RecipeProvider(pOutput) {
)
.unlocks("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.save(pWriter, "reinforced_bread_block_smithing")
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(ModItems.BREAD_SWORD.get()),
Ingredient.of(Items.NETHERITE_INGOT),
RecipeCategory.COMBAT,
ModItems.RF_BREAD_SWORD.get()
)
.unlocks("has_item", has(ModItems.BREAD_SWORD.get()))
.save(pWriter, "reinforced_bread_sword_smithing")
ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, ModItems.BREAD_SWORD.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
.define('S', Items.STICK)
.pattern(" B ")
.pattern(" B ")
.pattern(" S ")
.save(pWriter)
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(ModItems.BREAD_SHOVEL.get()),
Ingredient.of(Items.NETHERITE_INGOT),
RecipeCategory.TOOLS,
ModItems.RF_BREAD_SHOVEL.get()
)
.unlocks("has_item", has(ModItems.BREAD_SHOVEL.get()))
.save(pWriter, "reinforced_bread_shovel_smithing")
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BREAD_SHOVEL.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
.define('S', Items.STICK)
.pattern(" B ")
.pattern(" S ")
.pattern(" S ")
.save(pWriter)
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(ModItems.BREAD_AXE.get()),
Ingredient.of(Items.NETHERITE_INGOT),
RecipeCategory.TOOLS,
ModItems.RF_BREAD_AXE.get()
)
.unlocks("has_item", has(ModItems.BREAD_AXE.get()))
.save(pWriter, "reinforced_bread_axe_smithing")
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BREAD_AXE.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
.define('S', Items.STICK)
.pattern("BB ")
.pattern("BS ")
.pattern(" S ")
.save(pWriter)
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(ModItems.BREAD_PICKAXE.get()),
Ingredient.of(Items.NETHERITE_INGOT),
RecipeCategory.TOOLS,
ModItems.RF_BREAD_PICKAXE.get()
)
.unlocks("has_item", has(ModItems.BREAD_PICKAXE.get()))
.save(pWriter, "reinforced_bread_pickaxe_smithing")
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BREAD_PICKAXE.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
.define('S', Items.STICK)
.pattern("BBB")
.pattern(" S ")
.pattern(" S ")
.save(pWriter)
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(ModItems.BREAD_HOE.get()),
Ingredient.of(Items.NETHERITE_INGOT),
RecipeCategory.TOOLS,
ModItems.RF_BREAD_HOE.get()
)
.unlocks("has_item", has(ModItems.BREAD_PICKAXE.get()))
.save(pWriter, "reinforced_bread_hoe_smithing")
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BREAD_HOE.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
.define('S', Items.STICK)
.pattern("BB ")
.pattern(" S ")
.pattern(" S ")
.save(pWriter)
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, ModBlocks.FLOUR_LAYER_BLOCK.get(), 6)
.unlockedBy("has_item", has(ModBlocks.FLOUR_BLOCK.get()))
.define('F', ModBlocks.FLOUR_BLOCK.get())
.pattern(" ")
.pattern("FFF")
.pattern(" ")
.save(pWriter)

SpecialRecipeBuilder.special(ModRecipeSerializers.ARMOR_POTION_CRAFTING.get())
.save(pWriter, "bread_potion_crafting")
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/breadmod/registry/block/ModBlocks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import net.minecraft.world.item.crafting.RecipeType
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.FallingBlock
import net.minecraft.world.level.block.SnowLayerBlock
import net.minecraft.world.level.block.SoundType
import net.minecraft.world.level.block.state.BlockBehaviour
Expand Down Expand Up @@ -100,7 +101,8 @@ object ModBlocks {

val FLOUR_BLOCK = registerBlockItem(
"flour_block",
{ object : FlammableBlock(Properties.of().ignitedByLava().mapColor(MapColor.COLOR_YELLOW).sound(SoundType.SNOW)) {
{ object : FallingBlock(Properties.of().ignitedByLava().mapColor(MapColor.COLOR_YELLOW).sound(SoundType.SNOW)) {
override fun isFlammable(state: BlockState, level: BlockGetter, pos: BlockPos, direction: Direction): Boolean = true
override fun getFlammability(state: BlockState, level: BlockGetter, pos: BlockPos, direction: Direction): Int = 100
override fun getFireSpreadSpeed(state: BlockState, level: BlockGetter, pos: BlockPos, direction: Direction): Int = 150
} },
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/breadmod/registry/item/ModItems.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ object ModItems {
Item(Item.Properties().food(FoodProperties.Builder().nutrition(1).fast().build())) }
val FLOUR: RegistryObject<Item> = deferredRegister.register("flour") {Item(Item.Properties())}
val DOUGH: RegistryObject<Item> = deferredRegister.register("dough") {Item(Item.Properties())}
// val KNIFE: RegistryObject<Item> = deferredRegister.register("knife") {Item(Item.Properties())}
// Probably not for this one

// Armor
val BREAD_HELMET: RegistryObject<BreadArmorItem> = deferredRegister.register("bread_helmet") {
Expand Down

0 comments on commit a8f2dc6

Please sign in to comment.