Skip to content

Commit

Permalink
reinforced bread armor, rename the creative tab to "Bread Mod", add r…
Browse files Browse the repository at this point in the history
…ecipe provider functions
  • Loading branch information
ttttdoy committed May 6, 2024
1 parent af410c4 commit ea2605a
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
- Figure out model and loot table datagen for this block (SnowLayerBlock), might have to just roll with manually written json files to start off with
- [X] Refinement processes
- [X] Textures
- [ ] Data driven recipe and serializer
- [X] Data driven recipe and serializer
- [ ] Create compat.
- [ ] Mixing recipe for flour to dough (might already work with the item tags)
- [ ] Compat with fluid tank-like containers in the bucket slot
- [ ] Can be heated from the bottom (PneumaticCraft Compat)
- [ ] Can be heated from the bottom (possible PneumaticCraft Compat?)
- [ ] Speed can be accelerated from external heat sources
- Needs to be done still:
- [ ] Redirect recipes with custom json names to the breadmod folder instead of the minecraft folder\
- [ ] Sort recipe types into their own folders (ex. mixing, smithing, block compaction and decompaction)
- [X] Redirect recipes with custom json names to the breadmod folder instead of the minecraft folder
- [X] Sort recipe types into their own folders (ex. mixing, smithing, block compaction and decompaction)
- [ ] Textures for tools, weapons, items, blocks
- would be funny if the bread sword was just a long piece of bread attached to a sword handle
- [ ] Fix mixins not loading on built mod file
Expand Down Expand Up @@ -82,8 +82,8 @@ Todo..
- [ ] Farmers Delight
- [ ] ProjectE
- [ ] Add EMC to items
- [ ] Potential Bread-like EMC holder
- [ ] Make texture for item
- [X] Potential Bread-like EMC holder
- [X] Make texture for item
- [ ] Create
- [ ] Create recipe generators for the other recipe types
- [ ] Mekanism
Expand Down
32 changes: 32 additions & 0 deletions src/main/kotlin/breadmod/datagen/ModRecipeProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess
import mekanism.common.registries.MekanismItems
import net.minecraft.data.PackOutput
import net.minecraft.data.recipes.*
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
Expand All @@ -20,6 +22,29 @@ import net.minecraftforge.fml.ModList
import java.util.function.Consumer

class ModRecipeProvider(pOutput: PackOutput) : RecipeProvider(pOutput) {


// TODO refactor existing smithing recipes to use this function instead
// TODO create simplified 3x3 and 2x2 item to block recipes from the functions in RecipeProvider
// TODO crafting recipes for the bread armor
private fun modNetheriteSmithing(
pFinishedRecipeConsumer: Consumer<FinishedRecipe>,
pRecipeLocation: ResourceLocation,
pIngredient: Item,
pResult: Item,
pCategory: RecipeCategory,
pUnlockItem: Item
) {
SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
Ingredient.of(pIngredient),
Ingredient.of(Items.NETHERITE_INGOT),
pCategory,
pResult
).unlocks("has_item", has(pUnlockItem))
.save(pFinishedRecipeConsumer, pRecipeLocation)
}

override fun buildRecipes(pWriter: Consumer<FinishedRecipe>) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.BUILDING_BLOCKS, ModBlocks.BREAD_BLOCK.get())
.unlockedBy("has_item", has(Items.BREAD))
Expand Down Expand Up @@ -187,6 +212,13 @@ class ModRecipeProvider(pOutput: PackOutput) : RecipeProvider(pOutput) {
.unlocks("has_item", has(ModItems.BREAD_SHOVEL.get()))
.save(pWriter, modLocation("smithing", "reinforced_bread_shovel_smithing"))

modNetheriteSmithing(pWriter,
modLocation("smithing", "reinforced_bread_helmet_smithing"),
ModItems.BREAD_HELMET.get(),
ModItems.RF_BREAD_HELMET.get(),
RecipeCategory.COMBAT,
ModItems.BREAD_HELMET.get())

ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.BREAD_SHOVEL.get(), 1)
.unlockedBy("has_item", has(ModBlocks.BREAD_BLOCK.get()))
.define('B', ModBlocks.BREAD_BLOCK.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class USEnglishLanguageProvider(output: PackOutput, modID: String, locale: Strin
add(ModBlocks.KEYBOARD.get())

modAdd(
"The Bread Mod",
"Bread Mod",
"itemGroup", "main"
)

Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/breadmod/item/armor/ArmorTiers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ enum class ArmorTiers(
BREAD(
durabilityMultiplier = 50, enchantmentValue = 20, knockbackResistance = 0f, toughness = 0f,
defense = listOf(2,3,4,2), repairIngredient = Ingredient.of(Items.BREAD), equipSoundEvent = SoundEvents.GRASS_PLACE,
);
),
RF_BREAD(durabilityMultiplier = 80, enchantmentValue = 35, knockbackResistance = 0.5f, toughness = 1f,
defense = listOf(4,6,8,4), repairIngredient = Ingredient.of(Items.NETHERITE_INGOT), equipSoundEvent = SoundEvents.ARMOR_EQUIP_NETHERITE);

private val durabilityForSlot = listOf(13,15,16,11)

Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/breadmod/registry/item/ModItems.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import breadmod.registry.sound.ModSounds
import breadmod.item.DopedBreadItem
import breadmod.item.TestBreadItem
import breadmod.item.UltimateBreadItem
import breadmod.item.armor.ArmorTiers
import breadmod.item.armor.BreadArmorItem
import breadmod.item.tools.BreadShieldItem
import breadmod.item.tools.ToolTiers
Expand Down Expand Up @@ -75,6 +76,16 @@ object ModItems {
) = pOutput.accept(this.defaultInstance.also { it.setColor(BREAD_COLOR) })
} }

// Reinforced Armor
val RF_BREAD_HELMET: RegistryObject<ArmorItem> = deferredRegister.register("reinforced_bread_helmet") {
ArmorItem(ArmorTiers.RF_BREAD, ArmorItem.Type.HELMET, Item.Properties()) }
val RF_BREAD_CHESTPLATE: RegistryObject<ArmorItem> = deferredRegister.register("reinforced_bread_chestplate") {
ArmorItem(ArmorTiers.RF_BREAD, ArmorItem.Type.CHESTPLATE, Item.Properties()) }
val RF_BREAD_LEGGINGS: RegistryObject<ArmorItem> = deferredRegister.register("reinforced_bread_leggings") {
ArmorItem(ArmorTiers.RF_BREAD, ArmorItem.Type.LEGGINGS, Item.Properties()) }
val RF_BREAD_BOOTS: RegistryObject<ArmorItem> = deferredRegister.register("reinforced_bread_boots") {
ArmorItem(ArmorTiers.RF_BREAD, ArmorItem.Type.BOOTS, Item.Properties()) }

// Tools // Speed modifier slows down the tool based on how much of a negative value you give it (Maybe it's a multiplier?)
val BREAD_PICKAXE: RegistryObject<PickaxeItem> = deferredRegister.register("bread_pickaxe") {
PickaxeItem(ToolTiers.BREAD,1,-2.5f, Item.Properties()) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object ModCreativeTabs {
@Suppress("unused")
val MAIN_TAB: RegistryObject<CreativeModeTab> = deferredRegister.register("main_tab") {
CreativeModeTab.builder()
.withSearchBar(60)
.withSearchBar()
.title(modTranslatable("itemGroup", "main"))
.displayItems { pParameters, pOutput ->
pOutput.acceptAll(ModItems.deferredRegister.entries.filter {
Expand Down
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 ea2605a

Please sign in to comment.