Skip to content

Commit

Permalink
Fix #496 also remove redundant chest boat recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Jul 27, 2024
1 parent d123e61 commit 183a357
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main/java/ganymedes01/etfuturum/recipes/ModRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import ganymedes01.etfuturum.lib.EnumColor;
import ganymedes01.etfuturum.lib.Reference;
import ganymedes01.etfuturum.recipes.crafting.*;
import minetweaker.mc1710.recipes.MCRecipeManager;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
Expand All @@ -40,6 +41,7 @@
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import net.minecraftforge.oredict.RecipeSorter.Category;
Expand Down Expand Up @@ -1008,19 +1010,17 @@ ore_dyes[dye], new ItemStack(Blocks.sand, 1, 0), new ItemStack(Blocks.sand, 1, 0
ItemStack inputBoat = ItemNewBoat.BOAT_INFO.get(key.substring(0, key.indexOf("_chest"))).getBoatItem();
addShapelessRecipe(boat, "chestWood", inputBoat);
} else {
addShapedRecipe(boat,
(ConfigBlocksItems.replaceOldBoats ? "x x" : "xyx"), "xxx",
'x', isOak ? "plankWood" : entry.getValue().getPlank(),
'y', new ItemStack(Items.wooden_shovel, 1));
if(isOak) { //We're using the plankWood tag for this, so it needs to be in the vanilla sorter
GameRegistry.addRecipe(new ShapedOreRecipe(boat, (ConfigBlocksItems.replaceOldBoats ? "x x" : "xyx"), "xxx", 'x', "plankWood", 'y', new ItemStack(Items.wooden_shovel, 1)));
} else { //Not a tagged recipe, we sort this before vanilla recipes, so it takes precedent over them
addShapedRecipe(boat, (ConfigBlocksItems.replaceOldBoats ? "x x" : "xyx"), "xxx", 'x', entry.getValue().getPlank(), 'y', new ItemStack(Items.wooden_shovel, 1));
}
}
}
if (!ConfigBlocksItems.replaceOldBoats) {
addShapelessRecipe(new ItemStack(Items.boat), "boatWood");
addShapelessRecipe(ModItems.BOATS[0].newItemStack(), Items.wooden_shovel, Items.boat);
}
for (int i = EntityNewBoat.Type.VALUES.length - 1; i >= 0; i--) {
addShapedRecipe(ModItems.CHEST_BOATS[i].newItemStack(), "c", "b", 'b', i == 0 && ConfigBlocksItems.replaceOldBoats ? Items.boat : ModItems.BOATS[i].get(), 'c', Blocks.chest);
}

addShapedRecipe(ModBlocks.SHULKER_BOX.newItemStack(), "x", "c", "x", 'x', ModItems.SHULKER_SHELL.newItemStack(), 'c', new ItemStack(Blocks.chest));
if (ModBlocks.SHULKER_BOX.isEnabled()) {
Expand Down Expand Up @@ -1461,7 +1461,7 @@ private static void removeFirstRecipeFor(Item item) {
}

private static void removeFirstRecipeFor(Item item, int meta) {
Iterator<IRecipe> iterator = (Iterator<IRecipe>) CraftingManager.getInstance().getRecipeList().iterator();
Iterator<IRecipe> iterator = CraftingManager.getInstance().getRecipeList().iterator();
while (iterator.hasNext()) {
IRecipe recipe = iterator.next();
if (recipe != null) {
Expand All @@ -1487,7 +1487,7 @@ private static void removeAllEFRRecipesFor(Item item) {
}

private static void removeAllEFRRecipesFor(Item item, int meta) {
Iterator<IRecipe> iterator = (Iterator<IRecipe>) CraftingManager.getInstance().getRecipeList().iterator();
Iterator<IRecipe> iterator = CraftingManager.getInstance().getRecipeList().iterator();
while (iterator.hasNext()) {
IRecipe recipe = iterator.next();
if ((recipe instanceof ShapedEtFuturumRecipe || recipe instanceof ShapelessEtFuturumRecipe)) {
Expand Down

0 comments on commit 183a357

Please sign in to comment.