Find a way to make RecipeManager compatible.
haveric opened this issue ยท 12 comments
Quote of Beauseant
"This plugin is not compatible with RecipeManager, as if you then want to craft something you can't take it out of the crafting slot, only through shift clicking. Is there a way so you can fix this?"
Quote of Faldonboy
"This plugin works fine with RecipeManager except for a duplication bug(doesn't always happen), the problems between the two plugins were fixed by one of you(unintentionally) months ago. The problem he is having sounds like a conflict with something else.(new essentials builds have a small problem with stackableitems but I haven't seen it cause a problem and the error is very infrequent. Worldguard also has some small bugs involving this plugin but only if you're using the /stack command from it.)"
With the two plugins installed, you are forced to shift-click custom recipes (haven't tried with vanilla recipes) to obtain the product.
Tested with the 1.4.7 unofficial version of RecipeManager and v0.9.1 on CB Build 1.4.7 R1.0; no errors.
Just updated the description with quotes from the comments. It sounds like the same thing you found, you are forced to shift click items. That is interesting.
This may or may not have something to do with the fact that THDigi blocked shift-clicking for recipes w/ multiple outcomes (as a workaround for another issue). I really don't know anything beyond that, though; I haven't heard or seen of a recipe that forced you to shift-click, so I'm assuming THDigi never implemented a "force shift-click" option for recipes created by the plugin.
Oh... I know what the problem is, it's the same old issue with the placeholder items.
Your plugin gets the amount from the recipe's result and my plugin adds fake items as results and the amount is the recipe ID.
This won't be a problem in the next version of my plugin because I ditched that placeholder thing and the recipe result is the actual result.
That is good to hear @THDigi
@haveric
Ok so with the new version someone reported a new problem involving our two plugins... the issue is like this:
http://i.imgur.com/QcHXykz.gif
In that recipe there should've been a 5x log as result, for me it appears very quickly and then disappears, probably because I'm on a the same machine as the server.
The affecting code seems to be here: https://github.com/haveric/StackableItems/blob/master/src/haveric/stackableItems/SIPlayerListener.java#L905
The code reaches those conditions but the problem is on updating inventory... while I've built my own plugin I've noticed that some updates need to be delayed by 2 ticks, so I've added a 2 tick task there instead.
This problem only occurs for custom recipes added by Bukkit API, regardless of who's adding them, I've tested by removing my plugin from the plugins folder and adding this to your plugin's onEnable() just for test:
ShapelessRecipe r = new ShapelessRecipe(new ItemStack(Material.WOOD, 5));
r.addIngredient(Material.GHAST_TEAR);
r.addIngredient(Material.LOG, (short)1);
getServer().addRecipe(r);
The same issue occured (the wood x5 quickly appears and then vanishes because of inventory update) and the 2-tick delay fixed it.
Most likely because the server must communicate the result for custom recipes where the vanilla recipes are predicted by the client.
I can't actually replicate the issue while just running my plugin and adding that custom recipe. It shows up and works just as intended. All of my updates are passing through a delayedTask scheduler which has always worked for me.
I'll try getting your plugin on here and see if it works or not.
@haveric Hmm, the flashing is because of forcing current item to cursor's item, I belive those methods also send slot updates.
Packet handling API would be nice here.
I've changed the updateInventory in that call to be a runTaskLater of 2 ticks. It seems to be working, but ends up flashing the item once or twice in the results slot.
For adding a simple recipe like the one above, the flashing doesn't normally happen (if I were to add it to my plugin for example). Any ideas on what we can do to prevent the flashing?
Actually.. It's looking like I can just filter out the crafting/workbench inventories for the update and that will work. I'll have a dev version up soon so you can test it.
Edit: Or maybe not..crap.