|
3 | 3 | import com.jaquadro.minecraft.storagedrawers.StorageDrawers; |
4 | 4 | import com.jaquadro.minecraft.storagedrawers.api.storage.EnumBasicDrawer; |
5 | 5 | import com.jaquadro.minecraft.storagedrawers.config.ConfigManager; |
6 | | -import com.jaquadro.minecraft.storagedrawers.util.RecipeHelper; |
7 | 6 | import com.jaquadro.minecraft.storagedrawersextra.StorageDrawersExtra; |
8 | 7 | import com.jaquadro.minecraft.storagedrawersextra.block.EnumMod; |
9 | 8 | import com.jaquadro.minecraft.storagedrawersextra.block.EnumVariant; |
10 | 9 | import com.jaquadro.minecraft.storagedrawersextra.config.ConfigManagerExt; |
11 | 10 | import net.minecraft.block.Block; |
12 | 11 | import net.minecraft.item.ItemStack; |
13 | 12 | import net.minecraft.nbt.NBTTagCompound; |
| 13 | +import net.minecraft.util.ResourceLocation; |
14 | 14 | import net.minecraftforge.fml.common.registry.GameRegistry; |
15 | 15 | import net.minecraftforge.oredict.ShapedOreRecipe; |
16 | 16 |
|
17 | 17 | import javax.annotation.Nonnull; |
18 | 18 |
|
19 | 19 | public class ModRecipes |
20 | 20 | { |
| 21 | + private static final ResourceLocation EMPTY_GROUP = new ResourceLocation("", ""); |
| 22 | + |
21 | 23 | @Nonnull |
22 | 24 | public static ItemStack makeBasicDrawerItemStack (EnumBasicDrawer info, String material, int count) { |
23 | 25 | @Nonnull ItemStack stack = new ItemStack(ModBlocks.extraDrawers, count, info.getMetadata()); |
@@ -57,34 +59,35 @@ public void init () { |
57 | 59 |
|
58 | 60 | String material = variant.getResource().toString(); |
59 | 61 |
|
60 | | - String ch = "chestWood"; |
61 | | - String st = "stickWood"; |
62 | | - ItemStack pl = plankStack; |
63 | | - ItemStack sl = slabStack; |
64 | | - |
65 | 62 | if (config.isBlockEnabled(EnumBasicDrawer.FULL1.getUnlocalizedName()) && !plankStack.isEmpty()) { |
66 | 63 | @Nonnull ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL1, material, config.getBlockRecipeOutput(EnumBasicDrawer.FULL1.getUnlocalizedName())); |
67 | | - RecipeHelper.addShapedRecipe(result, 3, 3, pl, pl, pl, null, ch, null, pl, pl, pl); |
| 64 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "xxx", " y ", "xxx", 'x', plankStack, 'y', "chestWood") |
| 65 | + .setRegistryName(result.getItem().getRegistryName() + "_" + EnumBasicDrawer.FULL1.getUnlocalizedName() + "_" + variant.toString())); |
68 | 66 | } |
69 | 67 | if (config.isBlockEnabled(EnumBasicDrawer.FULL2.getUnlocalizedName()) && !plankStack.isEmpty()) { |
70 | 68 | @Nonnull ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL2, material, config.getBlockRecipeOutput(EnumBasicDrawer.FULL2.getUnlocalizedName())); |
71 | | - RecipeHelper.addShapedRecipe(result, 3, 3, pl, ch, pl, pl, pl, pl, pl, ch, pl); |
| 69 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "xyx", "xxx", "xyx", 'x', plankStack, 'y', "chestWood") |
| 70 | + .setRegistryName(result.getItem().getRegistryName() + "_" + EnumBasicDrawer.FULL2.getUnlocalizedName() + "_" + variant.toString())); |
72 | 71 | } |
73 | 72 | if (config.isBlockEnabled(EnumBasicDrawer.FULL4.getUnlocalizedName()) && !plankStack.isEmpty()) { |
74 | 73 | @Nonnull ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.FULL4, material, config.getBlockRecipeOutput(EnumBasicDrawer.FULL4.getUnlocalizedName())); |
75 | | - RecipeHelper.addShapedRecipe(result, 3, 3, ch, pl, ch, pl, pl, pl, ch, pl, ch); |
| 74 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "yxy", "xxx", "yxy", 'x', plankStack, 'y', "chestWood") |
| 75 | + .setRegistryName(result.getItem().getRegistryName() + "_" + EnumBasicDrawer.FULL4.getUnlocalizedName() + "_" + variant.toString())); |
76 | 76 | } |
77 | 77 | if (config.isBlockEnabled(EnumBasicDrawer.HALF2.getUnlocalizedName()) && !slabStack.isEmpty()) { |
78 | 78 | @Nonnull ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF2, material, config.getBlockRecipeOutput(EnumBasicDrawer.HALF2.getUnlocalizedName())); |
79 | | - RecipeHelper.addShapedRecipe(result, 3, 3, sl, ch, sl, sl, sl, sl, sl, ch, sl); |
| 79 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "xyx", "xxx", "xyx", 'x', slabStack, 'y', "chestWood") |
| 80 | + .setRegistryName(result.getItem().getRegistryName() + "_" + EnumBasicDrawer.HALF2.getUnlocalizedName() + "_" + variant.toString())); |
80 | 81 | } |
81 | 82 | if (config.isBlockEnabled(EnumBasicDrawer.HALF4.getUnlocalizedName()) && !slabStack.isEmpty()) { |
82 | 83 | @Nonnull ItemStack result = makeBasicDrawerItemStack(EnumBasicDrawer.HALF4, material, config.getBlockRecipeOutput(EnumBasicDrawer.HALF4.getUnlocalizedName())); |
83 | | - RecipeHelper.addShapedRecipe(result, 3, 3, ch, sl, ch, sl, sl, sl, ch, sl, ch); |
| 84 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "yxy", "xxx", "yxy", 'x', slabStack, 'y', "chestWood") |
| 85 | + .setRegistryName(result.getItem().getRegistryName() + "_" + EnumBasicDrawer.HALF4.getUnlocalizedName() + "_" + variant.toString())); |
84 | 86 | } |
85 | 87 | if (config.isBlockEnabled("trim") && !plankStack.isEmpty()) { |
86 | 88 | @Nonnull ItemStack result = new ItemStack(ModBlocks.extraTrim[variant.getGroupIndex()], config.getBlockRecipeOutput("trim"), variant.getGroupMeta()); |
87 | | - RecipeHelper.addShapedRecipe(result, 3, 3, st, pl, st, pl, pl, pl, st, pl, st); |
| 89 | + GameRegistry.register(new ShapedOreRecipe(EMPTY_GROUP, result, "xyx", "yyy", "xyx", 'x', "stickWood", 'y', plankStack) |
| 90 | + .setRegistryName(result.getItem().getRegistryName() + "_" + variant.toString())); |
88 | 91 | } |
89 | 92 | } |
90 | 93 | } |
|
0 commit comments