InstantCraft - Failed to compile: 'ItemCraftTask' does not contain a definition for 'cancelled' and no accessible extension method 'cancelled' accepting a first argument of type 'ItemCraftTask' could be found (are you missing a using directive or an assembly reference?) | Line: 49, Pos: 22
Surprise update by Facepunch so plugin needs to be fixedFixed
yeah, same here.
Error while compiling InstantCraft: 'ItemCraftTask' does not contain a definition for 'cancelled' and no accessible extension method 'cancelled' accepting a first argument of type 'ItemCraftTask' could be found (are you missing a using directive or an assembly reference?) | Line: 49, Pos: 22
Yup, here too. Please please update this soon!
After updating Rust and Oxide on November 23, InstantCraft fails to compile. Oxide.Rust: 2.0.7918 Error while compiling InstantCraft: 'ItemCraftTask' does not contain a definition for 'cancelled' and no accessible extension method 'cancelled' accepting a first argument of type 'ItemCraftTask' could be found (are you missing a using directive or an assembly reference?) Line: 49, Pos: 22 Could you update the plugin for the current Rust API?
There's also some queue management issues. And there's a interaction regression if you are using other Crafting plugins. I have a fully patched version if anyone wants it. I tested it in-game alongside my patched Crafting Controller build. Rock crafting was blocked as configured, and instant crafting worked. The draft PR includes the patch and a list of plugins I haven’t tested it with yet.
You can view it on Git:
Temp fix for the compile error. Comment out this part of the code. May cause unexpected behavor, but allows items to instant craft.
private object OnItemCraft(ItemCraftTask task, BasePlayer owner)
{
// if (task.cancelled)
//{
// return null;
// }
PufferFish
Temp fix for the compile error. Comment out this part of the code. May cause unexpected behavor, but allows items to instant craft.
private object OnItemCraft(ItemCraftTask task, BasePlayer owner)
{
// if (task.cancelled)
//{
// return null;
// }
Commenting out the guard removes the reference that breaks compilation, but leaves the plugin calling FinishCrafting(task) immediately inside OnItemCraft. The main drawback is that it can deliver an item before Rust has accepted the task into the crafting queue
Our 3.0.1 patch waits until the task actually appears in Rust’s queue, then accelerates it when it reaches the front. Rust handles completion and item delivery.
The main risk is finishing a craft too early. Commenting out if (task.cancelled) makes Instant Craft compile, but it still calls FinishCrafting(task) before Rust has accepted the task into the queue.
- Queue jumping: An instant item can finish ahead of a normal-speed item the player queued first.
- Conflicts with other plugins: Instant Craft can deliver the item before another plugin rejects or refunds the craft. Depending on hook order, a player could receive both the item and a refund. We haven’t reproduced that outcome.
- Wrong bulk output after an error: The existing code temporarily changes the recipe’s output count. If
FinishCraftingthrows, the code skips restoring that count. This risk already exists in 3.0.0 and remains with the workaround.
So a successful instant craft shows the workaround can produce an item. It doesn’t establish that queue order, cancellations, or refunds work correctly.
Our Instant Craft 3.0.1 patch addresses all three risks in the old method.
- Queue order: It waits for Rust to accept the task into the queue and accelerates it only when it reaches the front. An instant craft waits behind an earlier normal-speed craft.
- Cancellation and refunds: If another plugin rejects the craft before it enters the queue, Instant Craft skips it. If a tracked task is cancelled, Instant Craft stops tracking it. It leaves delivery and ingredient accounting to Rust, which removes the specific risk of Instant Craft handing out an item before another hook rejects the request.
- Bulk output: The patch leaves the blueprint’s output count alone, so an exception can’t leave that count inflated through the old code path.
Queue order and cancellation were checked in isolated simulations. Our hammer tests verified Crafting Controller’s item counts with both plugins loaded. Hammers were on Instant Craft’s normal-speed list, so those tests didn’t exercise its accelerated path. Compatibility with the other crafting plugins listed in the README remains unverified.