FastBurst
Splits up ores into equal stacks when you put them into furnaces

Supported Games
GameServerKingsGameServerKings
used by

Furnace Splitter makes the hassle of preparing furnaces a thing of the past. Simply put your ores into the furnace and they will be split up into a configurable amount of stacks.

The specified stack amount is saved for each player and the type of furnace they're using. This means that you can split into 3 stacks in small furnaces and 15 stacks in large furnaces without having to change between them everytime you're using a different furnace.

As seen above as well, you can also turn the plugin on and off so you can still do your own configurations if you need to.

The plugin doesn't only work on furnaces. It also works on campfires and refineries.

WARNING STACK SIZES CANNOT & SHOULD NOT EXCEED 700 MILLION!!! Anything over 700 million, the small furnace, small oil refinery, and BBQ Grill tend not to split them at that point and has to be done manually.

Chat Commands

These commands allow the player to turn on/off the Furnace Splitter options, by default this is set to on.

  • /fs -- Shows the status and help options
  • /fs on -- To enable Furnace Splitter
  • /fs off -- To disable Furnace Splitter

Permissions

  • furnacesplitter.use -- Allows player to use the furnace splitting functionality

Configuration

{
  "UiPosition": {
    "x": 0.6505,
    "y": 0.022
  }
}

Localization

{
  "turnon": "Turn On",
  "turnoff": "Turn Off",
  "title": "Furnace Splitter",
  "eta": "ETA",
  "totalstacks": "Total stacks",
  "trim": "Trim fuel",
  "lootsource_invalid": "Current loot source invalid",
  "unsupported_furnace": "Unsupported furnace.",
  "nopermission": "You don't have permission to use this.",
  "StatusONColor": "<color=green>ON</color>",
  "StatusOFFColor": "<color=red>OFF</color>",
  "StatusMessage": "Furnace Splitter status set to: "
} 

Developer API

MoveSplitItem(Item item, BaseOven targetOven, int totalStacks) // Inserts the given item into the target oven and splits it up into totalStacks. Returns result as a string.
GetOvenInfo(BaseOven targetOven) // Returns JObject { ETA: float, FuelNeeded: float  }

Possible return values from MoveSplitItem are:

  • Ok - The full stack was inserted successfully.
  • FilledSlots - Partial amount of the stack was inserted successfully, remaining amount is left in the input Item.
  • NotEnoughSlots - The amount of available slots are smaller than the input parameter totalStacks.

The returned JObject's values from GetOvenInfo are:

  • ETA: Total seconds to smelt everything in the furnace.
  • FuelNeeded: Required amount of fuel to smelt everything in the furnace.

Example: Inserting the first cookable found in the player's inventory into the furnace they're looking at

[PluginReference]
private Plugin FurnaceSplitter;

[ChatCommand("split")]
private void ChatCommand_Split(BasePlayer player, string command, string[] args)
{
    GameObject lookTarget = GetLookTarget(player);
    var oven = lookTarget?.GetComponent<baseoven>();

    if (oven == null)
    {
        player.ChatMessage("Invalid look target");
        return;
    }

    var firstCookable = player.inventory.containerMain.itemList.FirstOrDefault(x => x.info.GetComponent<itemmodcookable>() != null);

    if (firstCookable != null)
    {
        string result = FurnaceSplitter.Call<string>("MoveSplitItem", firstCookable, oven, totalStacks: 15);
        player.ChatMessage(result);
    }
    else
    {
        player.ChatMessage("No cookable found");
    }
}

private static GameObject GetLookTarget(BasePlayer player)
{
    RaycastHit hit;
    var position = player.eyes.position;
    var direction = player.eyes.HeadForward();
    if (!Physics.Raycast(new Ray(position, direction), out hit, 10f, 1 << (int)Layer.Deployed))
        return null;

    return hit.transform.gameObject;
}

Credits

  • Skipcast, the original author of the plugin
  • birthdates, for helping maintain the plugin
  • FastBurst, for helping maintain the plugin

MIT License


Copyright (c) 2021 FastBurst


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.