|
20 | 20 | import org.bukkit.inventory.Recipe; |
21 | 21 | import org.bukkit.inventory.ShapedRecipe; |
22 | 22 | import org.bukkit.inventory.ShapelessRecipe; |
| 23 | +import org.bukkit.inventory.RecipeChoice.MaterialChoice; |
23 | 24 | import org.bukkit.inventory.meta.BookMeta; |
24 | 25 | import org.bukkit.inventory.meta.Damageable; |
25 | 26 | import org.bukkit.inventory.meta.EnchantmentStorageMeta; |
@@ -55,13 +56,41 @@ public static void setupSmeltableItemLists() { |
55 | 56 | Recipe recipe = it.next(); |
56 | 57 |
|
57 | 58 | if (recipe instanceof FurnaceRecipe) { |
58 | | - smeltableItems.put(((FurnaceRecipe)recipe).getInput().getType(), ((FurnaceRecipe)recipe).getResult()); |
| 59 | + |
| 60 | + if (((FurnaceRecipe)recipe).getInputChoice() instanceof MaterialChoice) { |
| 61 | + for (Material choice : |
| 62 | + ((MaterialChoice)((FurnaceRecipe)recipe).getInputChoice()).getChoices()) { |
| 63 | + smeltableItems.put(choice, ((FurnaceRecipe)recipe).getResult()); |
| 64 | + } |
| 65 | + } |
| 66 | + else { |
| 67 | + smeltableItems.put(((FurnaceRecipe)recipe).getInput().getType(), |
| 68 | + ((FurnaceRecipe)recipe).getResult()); |
| 69 | + } |
59 | 70 | } |
60 | 71 | else if (recipe instanceof BlastingRecipe) { |
61 | | - blastSmeltableItems.put(((BlastingRecipe)recipe).getInput().getType(), ((BlastingRecipe)recipe).getResult()); |
| 72 | + if (((BlastingRecipe)recipe).getInputChoice() instanceof MaterialChoice) { |
| 73 | + for (Material choice : |
| 74 | + ((MaterialChoice)((BlastingRecipe)recipe).getInputChoice()).getChoices()) { |
| 75 | + blastSmeltableItems.put(choice, ((BlastingRecipe)recipe).getResult()); |
| 76 | + } |
| 77 | + } |
| 78 | + else { |
| 79 | + blastSmeltableItems.put(((BlastingRecipe)recipe).getInput().getType(), |
| 80 | + ((BlastingRecipe)recipe).getResult()); |
| 81 | + } |
62 | 82 | } |
63 | 83 | else if (recipe instanceof CookingRecipe) { |
64 | | - cookableItems.put(((CookingRecipe)recipe).getInput().getType(), ((CookingRecipe)recipe).getResult()); |
| 84 | + if (((CookingRecipe)recipe).getInputChoice() instanceof MaterialChoice) { |
| 85 | + for (Material choice : |
| 86 | + ((MaterialChoice)((CookingRecipe)recipe).getInputChoice()).getChoices()) { |
| 87 | + cookableItems.put(choice, ((CookingRecipe)recipe).getResult()); |
| 88 | + } |
| 89 | + } |
| 90 | + else { |
| 91 | + cookableItems.put(((CookingRecipe)recipe).getInput().getType(), |
| 92 | + ((CookingRecipe)recipe).getResult()); |
| 93 | + } |
65 | 94 | } |
66 | 95 | } |
67 | 96 | } |
|
0 commit comments