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
  1. Serenity 3 updated Instant Smelt with a new update entry:

    0.2.2

     
  2. Still does not work
     
  3. 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
     
  4. 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?
     
  5. works with sulfur now but none of the others?
     
  6. Thats right
     
  7. How do we handle the wood?

    Is there a Toggle we can use for it?
     
  8. Wood is not ready
     
  9. Serenity 3 updated Instant Smelt with a new update entry:

    0.2.9

     
  10. This doesn't even smelt the ores no more
     
  11. there is a permission now
    Sorry for the lack of information
    instantsmelt.use
     
  12. Could you also help make it so Metal Frags and HQM stack
     
  13. i have
    Just Update your Stack Size COntroller
     
  14. how can i update it if there isn't an update do i just reinstall?
     
  15. use this
    if anything else fails
     

    Attached Files:

  16. use this
    if anything else fails
     
  17. Still does not cook the ores
    [DOUBLEPOST=1488065526][/DOUBLEPOST]
    Oh wait. No it cooks the ores but also copies the normal ores so you get double
     
  18. well that's impossible as i'm running it fine with no errors...
    [DOUBLEPOST=1488065702][/DOUBLEPOST]and nothing is copied in the code.
     
  19. I dont know what to do now though
     
  20. 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.