Posts: 43
Threads: 7
Joined: Dec 2011
Thanks: 0
Given 4 thank(s) in 4 post(s)
Why have core functionality in a plugin? The server doesn't benefit other than being able to run in a very crippled mode without said plugins.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
I was thinking the same thing, but then I realized - sometimes there are situations where you don't want the default behavior. For example, an admin might want to be able to place blocks anywhere, even when there are other players occupying the spot. So it kinda makes sense for the functionality to be modifiable. And the Core is distributed and set up by default, so it should be pretty okay.
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
I also think some things are easier to implement in a plugin than in the native code.
Like repairing items. Item repairing is not a recipe, because the recipes do not support such a thing. How would the crafting hooks work when there's no recipe but it does have functionality behind it? It's much easier, and makes much more sense to put it in a plugin.
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
06-15-2012, 08:53 AM
(This post was last modified: 06-15-2012, 08:57 AM by Taugeshtu.)
Still, xoft had to work out how to handle that weird bug with no clearing crafting grid on crafting plugin recipe.
Because the most flexible solution would be to allow plugins somehow clear crafting grid manually, but making hook-hook interactions within a plugin could be painful (imagine that we added OnGetCraftedItem hook - we now got to check if we're dealing with same player that had placed items in crafting grid when OnCraftingNoRecipe was called. We should store player and crafting details, and check them all).
The other way would be flushing whole crafting grid when item is crafted through such "plugin" recipe. But then we'll loose additional "multiple items in slop per recipe" functionality (which is nice thing to have, actually!). And we'll run into troubles with situation when player tries to use stacked items in crafting (meaning he want to craft only one item).
Just a thought: could we somehow requie plugin to provide crafting grid output AFTER crafting happened? That would be flexible and (in my mind) easy to implement enough. If plugin returns true - use it's output in recipe and in crafting grid after crafting.
Although maybe I'm just missing something, and there is already some way to handle that... Xoft?
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
06-16-2012, 06:12 AM
(This post was last modified: 06-16-2012, 06:15 AM by xoft.)
The plugins return a full recipe - they need to set not only the resulting item, but they also need to indicate what (and how many) ingredients will be consumed, in the Ingredients part of cCraftingRecipe. I'll look at your plugin and try to find what's wrong, I suspect, though, that you forgot to indicate ingredients, so that when MCServer actually uses the recipe, nothing is consumed off the crafting grid.
I don't understand the rest of your text, really. The crafting windows use the recipe provided by either builtin recipes or plugins, then re-calculate a new recipe for the leftover ingredients. All cases should be covered by that.
Yup, you didn't indicate the ingredients.