-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed Iron Flask recipe to require forge created unfinished flask
Added broken items and recipes to repair
- Loading branch information
Showing
11 changed files
with
143 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletions
18
src/main/java/org/labellum/mc/waterflasks/item/ModItems.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,44 @@ | ||
package org.labellum.mc.waterflasks.item; | ||
|
||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.item.Item; | ||
import net.minecraftforge.registries.IForgeRegistry; | ||
|
||
import static net.dries007.tfc.objects.CreativeTabsTFC.*; | ||
import org.labellum.mc.waterflasks.ConfigFlasks; | ||
|
||
public class ModItems { | ||
|
||
public static ItemBase leatherSide = new ItemBase("leather_side").setCreativeTab(CreativeTabs.MATERIALS); | ||
public static ItemBase bladder = new ItemBase("bladder").setCreativeTab(CreativeTabs.MATERIALS); | ||
public static ItemBase leatherSide = new ItemBase("leather_side").setCreativeTab(CT_MISC); | ||
public static ItemBase bladder = new ItemBase("bladder").setCreativeTab(CT_MISC); | ||
public static ItemLeatherFlask leatherFlask = new ItemLeatherFlask(); | ||
public static ItemBase unfinishedFlask = new ItemBase("unfinished_iron_flask").setCreativeTab(CT_METAL); | ||
public static ItemBase brokenLeatherFlask = new ItemBase("broken_leather_flask").setCreativeTab(CT_MISC); | ||
public static ItemBase brokenIronFlask = new ItemBase("broken_iron_flask").setCreativeTab(CT_METAL); | ||
public static ItemIronFlask ironFlask = new ItemIronFlask(); | ||
|
||
public static void register(IForgeRegistry<Item> registry) { | ||
registry.registerAll( | ||
leatherSide, | ||
bladder, | ||
leatherFlask | ||
leatherFlask, | ||
brokenLeatherFlask | ||
); | ||
if (ConfigFlasks.GENERAL.enableIron) { | ||
registry.register(unfinishedFlask); | ||
registry.register(ironFlask); | ||
registry.register(brokenIronFlask); | ||
} | ||
} | ||
|
||
public static void registerModels() { | ||
leatherFlask.registerItemModel(); | ||
leatherSide.registerItemModel(); | ||
bladder.registerItemModel(); | ||
brokenLeatherFlask.registerItemModel(); | ||
if (ConfigFlasks.GENERAL.enableIron) { | ||
unfinishedFlask.registerItemModel(); | ||
ironFlask.registerItemModel(); | ||
brokenIronFlask.registerItemModel(); | ||
} | ||
} | ||
} |
35 changes: 26 additions & 9 deletions
35
src/main/java/org/labellum/mc/waterflasks/recipe/ModRecipes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
package org.labellum.mc.waterflasks.recipe; | ||
|
||
import net.dries007.tfc.api.recipes.anvil.AnvilRecipe; | ||
import net.dries007.tfc.api.recipes.knapping.KnappingRecipe; | ||
import net.dries007.tfc.api.recipes.knapping.KnappingRecipeSimple; | ||
import net.dries007.tfc.api.recipes.knapping.KnappingType; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.event.RegistryEvent; | ||
|
||
import net.dries007.tfc.api.types.Metal; | ||
import net.dries007.tfc.objects.inventory.ingredient.IIngredient; | ||
import net.dries007.tfc.objects.items.metal.ItemMetal; | ||
import org.labellum.mc.waterflasks.item.ModItems; | ||
|
||
import static net.dries007.tfc.api.types.Metal.ItemType.SHEET; | ||
import static net.dries007.tfc.util.forge.ForgeRule.*; | ||
import static net.dries007.tfc.util.skills.SmithingSkill.Type.GENERAL; | ||
import static org.labellum.mc.waterflasks.Waterflasks.MOD_ID; | ||
|
||
public class ModRecipes { | ||
|
||
public static void registerKnapping(RegistryEvent.Register<KnappingRecipe> event) { | ||
event.getRegistry().registerAll( | ||
new KnappingRecipeSimple(KnappingType.LEATHER, true, new ItemStack(ModItems.leatherSide), | ||
"X X X", "XXXXX", "XXXXX", "XXXXX", " XXX ").setRegistryName("leather_side") | ||
" XX ", " XXX ", "XXXXX", " XXX ", " X ").setRegistryName("leather_side") | ||
); | ||
} | ||
/* | ||
XX | ||
XXX | ||
XXXXX | ||
XXX | ||
X | ||
*/ | ||
|
||
public static void registerAnvil(RegistryEvent.Register<AnvilRecipe> event) { | ||
event.getRegistry().registerAll( | ||
new AnvilRecipe(new ResourceLocation(MOD_ID,"unfinished_iron_flask"), IIngredient.of(new ItemStack(ItemMetal.get(Metal.WROUGHT_IRON,SHEET))), | ||
new ItemStack(ModItems.unfinishedFlask), Metal.WROUGHT_IRON.getTier(), GENERAL, PUNCH_LAST, BEND_SECOND_LAST, BEND_THIRD_LAST) | ||
); | ||
} | ||
} | ||
/* | ||
X X X | ||
XXXXX | ||
XXXXX | ||
XXXXX | ||
XXX | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/waterflasks/models/item/broken_iron_flask.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "waterflasks:items/broken_iron_flask" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/waterflasks/models/item/broken_leather_flask.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "waterflasks:items/broken_leather_flask" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/waterflasks/models/item/unfinished_iron_flask.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "waterflasks:items/unfinished_iron_flask" | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
src/main/resources/assets/waterflasks/recipes/iron_flask.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/resources/assets/waterflasks/recipes/repair_broken_iron.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"type": "tfc:damage_item_shaped", | ||
"pattern": [ | ||
"FB", | ||
"CK" | ||
], | ||
"key": { | ||
"F": { | ||
"item": "waterflasks:broken_iron_flask", | ||
"data": 32767 | ||
}, | ||
"K": { | ||
"type": "forge:ore_dict", | ||
"ore": "knife", | ||
"data": "*" | ||
}, | ||
"C": { | ||
"item": "tfc:crop/product/burlap_cloth" | ||
}, | ||
"B": { | ||
"item": "waterflasks:bladder" | ||
} | ||
}, | ||
"result": { | ||
"item": "waterflasks:iron_flask", | ||
"data": 0 | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/resources/assets/waterflasks/recipes/repair_broken_leather.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"pattern": [ | ||
"FB" | ||
], | ||
"key": { | ||
"F": { | ||
"item": "waterflasks:broken_leather_flask", | ||
"data": 32767 | ||
}, | ||
"B": { | ||
"item": "waterflasks:bladder" | ||
} | ||
}, | ||
"result": { | ||
"item": "waterflasks:leather_flask", | ||
"data": 0 | ||
} | ||
} |