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

Supported Games

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.

Permissions

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

Configuration

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

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 this plugin

    For Server Owners:

    Do not use unlicensed code because an unlicensed plugin is dangerous to your server's feature availability.

    For Developers:

    Do not integrate with unlicensed code as it is possible your integrations will break permanently without recourse.

    Download
    Donate
    30.5K downloads
    566 watchers

    mechanicsresourcesitems