PGM
PGM copied to clipboard
Custom Crafting doesnt work if the recipe is already used by a vanilla recipe
e.g.
<shaped override="false">
<result material="water bucket"/>
<shape>
<row>I.I</row>
<row>.I.</row>
</shape>
<ingredient symbol="I">iron ingot</ingredient>
</shaped>
Have you tried setting override to true? This disables the vanilla recipe.
From the docs:
Disable all vanilla recipes for the same item. This is just a convenient alternative to the
element.
Yes, doesn't work either, i think override just disables the vanilla crafting recipe of the result item.
The recent changes to the CraftingModule have caused this 6d43acaa44e6601dd357c5f52d9d2335bdc6bafc.
Previously disabled recipes were removed, then new recipes added after. This new implementation adds new recipes first but checks for disabled ones when crafting. This means that a recipe can be both added and disabled. The result of this is that you are unable to change the recipe for a vanilla item whilst disabling the vanilla one.
Within the example in the OP I'm not sure why that exact XML would ever be needed as it changes neither the recipe or output.
I'm not sure if the matches check on the crafted items would allow you to craft slightly updated items such as those with names, lore, enchantments, etc. But this should be fixed regardless.
@Pugzy
Within the example in the OP I'm not sure why that exact XML would ever be needed as it changes neither the recipe or output.
The output in the OP is a water bucket rather than an empty bucket.
The changes prior to https://github.com/Electroid/PGM/issues/68 resulted in a NPE similar to the below on the next method.
java.lang.NullPointerException
at org.bukkit.craftbukkit.v1_8_R3.inventory.RecipeIterator.next(RecipeIterator.java:50) ~[sportpaper.jar:git-SportPaper-"374af6d"]
at org.bukkit.craftbukkit.v1_8_R3.inventory.RecipeIterator.next(RecipeIterator.java:1) ~[sportpaper.jar:git-SportPaper-"374af6d"]
at tc.oc.pgm.crafting.CraftingMatchModule.enable(CraftingMatchModule.java:27) ~[?:?]
I can't wrap my head around what causes this at either a PGM or CraftBukkit level. If this could be resolved the implementation could be reverted resolving this issue.
So I have tired this again recently and this would produce the wanted outcome.
<crafting>
<shaped override="false">
<result material="water bucket" amount="1"/>
<shape>
<row>...</row>
<row>G.G</row>
<row>.G.</row>
</shape>
<ingredient symbol="G">iron ingot</ingredient>
</shaped>
<shaped override="false">
<result material="water bucket" amount="1"/>
<shape>
<row>G.G</row>
<row>.G.</row>
<row>...</row>
</shape>
<ingredient symbol="G">iron ingot</ingredient>
</shaped>
</crafting>
@RuedigerLP you do not need to add a recipe for every possible place in the crafting table that the recipe can be placed on, you define a shape and the shape can be placed anywhere:
<shape>
<row>I.I</row>
<row>.I.</row>
</shape>
<ingredient symbol="I">iron ingot</ingredient>
should work directly, and allow for crafting the bucker in any position (bottom or lower) of the crafting table