No Fuel Requirements

Allows you to choose which deployables do not use fuel

Total Downloads: 6,429 - First Release: Jun 26, 2015 - Last Update: Dec 16, 2017

5/5, 13 likes
  1. I'll have to check again. The issue was that quarries did not use fuel when you wanted to use the permission setting to deny it. But I haven't tried it lately, and I probably should regenerate my config also. It might be old.
     
  2. Quick concern. We tried using this on our server. Problem is, people can exploit it. Turns out anyone who uses your pluggin, can do things like put skulls in a forge, and get an infinte amount of bone fragments without consuming it. Same for food. Eat all you want with out consuming it. I believe works with liquids too. Same for Presents. People are able to use this to create infinite numbe of medium and large presents, as well as get infinte resources from presents. can we look into a fix for this.
    [DOUBLEPOST=1495238671][/DOUBLEPOST]Also want to note, that i love this plugin. I rate it 6 stars, out of 5. no, that is not a mistype. even with the bug, im still using it. I just disabled skulls, and deleted presents from my server until we can fix it
     
  3. I wrote a quick fix until killyou can fix this permanently.

    change line 38 under OnItemUse to the following:

    if (!initialized || item == null || amount == 0 || item.fuel == 0) return;

    If it is not fuel then it won't be processed. Therefore no exploits. At least that's my theory.
     
  4. Wulf

    Wulf Community Admin

    Have you tested it?
     
  5. Wulf,

    I tested it with campfires and eating items and crushing bones within the campfire. Not full regressive testing but like I said in my post it's a quick fix.
     
  6. Has the plugin already been changed ? went to change it (on mine it is line 37) but already shows line that is shown in example
     
  7. It appears that issue still exists.
     
  8. I should have read further back in the thread. I regenerated the config and now it works fine.
     
  9. So I'm pretty new to the mods, but I really want this mod on my server. I can't seem to get it working, is there anything i have to do other than install it in the oxide mod folder and set the config file to what I want?
     
  10. I set the config as below, intending on searchlights being the only allowed item without fuel, but furnaces, ect, still appear to go without fuel for all players.

    Code:
    {
      "AffectedTypes": {
        "Campfires": false,
        "CandleHat": false,
        "CeilingLight": false,
        "Furnace": false,
        "Lanterns": false,
        "LargeFurnace": false,
        "MinersHat": false,
        "OilRefinery": false,
        "Quarry": false,
        "Searchlight": true,
        "TunaLight": false
      },
      "Permissions": {
        "Campfires": "nofuelrequirements.campfire",
        "CandleHat": "nofuelrequirements.candlehat",
        "CeilingLight": "nofuelrequirements.ceilinglight",
        "Furnace": "nofuelrequirements.furnace",
        "Lanterns": "nofuelrequirements.lantern",
        "LargeFurnace": "nofuelrequirements.largefurnace",
        "MinersHat": "nofuelrequirements.minershat",
        "OilRefinery": "nofuelrequirements.oilrefinery",
        "Quarry": "nofuelrequirements.quarry",
        "Searchlight": "nofuelrequirements.searchlight",
        "TunaLight": "nofuelrequirements.tunalight"
      },
      "UsePermissions": false
    }
    Additionally, when I tried to set permissions, it stated that it could not find the permissions to grant. Currently all items on the server (that this lists) run without fuel, despite permissions or the above 'false' configurations.

    Thanks for taking the time, love the plugin :)
     
  11. Do I need to change something to make this work only for admins/mods?

    Also, I want to make it so that ONLY ceiling lights take no fuel. May I get an example of how I would configure the config file?
     
    Last edited by a moderator: Jul 12, 2017
  12. can confirm
     
  13. Okay, so in order for this plugin to make sure the players have permission, you must make sure that the affected type is true, as well as edit the following functions as so:

    Code:
    void OnConsumeFuel(BaseOven oven, Item fuel, ItemModBurnable burnable)
    {
        if (!initialized || oven == null || fuel == null) return;
        ConsumeTypes type = StringToType(oven?.ShortPrefabName ?? string.Empty);
        if (type == ConsumeTypes.None) return;    if (IsActiveType(type))
        {
            if (usingPermissions && oven.OwnerID != 0U)
            {
                if (!HasPermission(oven.OwnerID.ToString(), type)) return;
            }
            // Then added code is the next two lines
            else
                return;
            fuel.amount += 1;
        }
    }void OnItemUse(Item item, int amount)
    {
        if (!initialized || item == null || amount == 0 || !ValidFuelTypes.Contains(item.info.shortname)) return;
       
        string shortname = item?.parent?.parent?.info?.shortname ?? item?.GetRootContainer()?.entityOwner?.ShortPrefabName;
        if (string.IsNullOrEmpty(shortname)) return;    ConsumeTypes type = StringToType(shortname);
        if (type == ConsumeTypes.None) return;    if (IsActiveType(type))
        {
            if (usingPermissions)
            {
                string playerId = item?.GetRootContainer()?.playerOwner?.UserIDString;
                string entityId = item?.GetRootContainer()?.entityOwner?.OwnerID.ToString();            if (!string.IsNullOrEmpty(playerId))
                    if (!HasPermission(playerId, type)) return;
                if (!string.IsNullOrEmpty(entityId) && entityId != "0")
                    if (!HasPermission(entityId, type)) return;
            }
            // The added code is the next two lines
            else
                return;
            item.amount += amount;
        }
    }
     
  14. Scratch what I said above. Sorry
     
  15. "biscuit"
    "scratch"
    Made me think of biscuits made from scratch. All fluffy and in those cloud like layers, warm and begging to be buttered.

    ..... Welp, I'm off to go to ruin my dinner now :D

    Thanks for trying at least bud :)
     
  16. Plugin seems to ignore permissions regardless of config.
     
  17. If anyone wants a fixed version I wrote that properly implements permissions while we wait for the author, just message me.
     
  18. The fact you asked me to PM you instead of just pasting the code leaves me to believe you will require payment. If my assumption is correct should I remind you the penalties of selling another vendor's licensed work?

    EDIT
    My original assumption was incorrect as he has sent me a modified version with no mention of payment.
     
  19. you know what they say about assumptions....