Serenity 3 updated Instant Smelt with a new update entry:
0.2.2
InstantSmelt
Smelt resources as soon as they are mined
Total Downloads: 3,391 - First Release: Feb 24, 2017 - Last Update: Jun 14, 2018
- 5/5, 5 likes
-
-
Serenity 3 updated Instant Smelt with a new update entry:
0.2.2 B
[DOUBLEPOST=1488051692][/DOUBLEPOST]im now adding the Wood Consumption as well -
For some reason it's only working with sulfur nodes, otherwise it will just give me the unsmelted item. i got the stacks to work though. Any ideas?
-
-
-
How do we handle the wood?
Is there a Toggle we can use for it? -
Wood is not ready
-
Serenity 3 updated Instant Smelt with a new update entry:
0.2.9
-
-
there is a permission now
Sorry for the lack of information
instantsmelt.use -
-
i have
Just Update your Stack Size COntroller -
-
use this
if anything else failsAttached Files:
-
-
use this
if anything else fails -
[DOUBLEPOST=1488065526][/DOUBLEPOST] -
well that's impossible as i'm running it fine with no errors...
[DOUBLEPOST=1488065702][/DOUBLEPOST]and nothing is copied in the code. -
-
Looking at the new changes (I'm not using Oxide to actually test your current code to see the behavior), CanAcceptItem seems like the wrong function hook to be using for this.
If you look at the decompiled server code for Rust, CanAcceptItem is simply a function that returns a CanAcceptResult if the container can accept an item, cannot accept the item right now, or can accept an item. There are no destructive side effects in this function, such as making changes to the inventory or item, because this type of function should never do that in practice.
In other words, CanAcceptItem should be able to be called for a container any number of times, without causing any changes to the item or container itself, which your code now does. Any other plugin code that executes inventory based logic that results in CanAcceptItem being called, would now also be calling your hook, which isn't a real problem in your code since you're not changing the hook call result, but design wise, it's a bad setup based on what you intend to happen.
The nice thing about ItemContainer.Insert, was that it is also called from ItemContainer.Load, so if you just rebooted your server after using a plugin like yours, all your conversions magically take place for everyone, so there's no need for people to manually manage their inventories. From then on out, when people would harvest resources, the Insert hook would convert it for them.
There is one side-effect of the Insert hook though, if your inventory was full, then the raw material gets dropped and not converted, but that's due to another issue. If you wanted to fix that, you'd want to look at ResourceDispenser stuff, which then might have more conflicts with gather plugins and whatnot. In that case though, just picking up the ore with a free inventory slot would result in the correct behavior.
As with any modding though, there's bound to be conflicts with other mods, so when it comes to stack issues that the other guy is seeing, I'm guessing it's most likely that, but I think the Insert hook is a sound place to start from for a mod like this rather than CanAcceptItem.