TR Zoon
CategoriesMain Menu
  • $-USD
  • Tk-BDT
  • Rs-INR
  • N-NGN
  • $-CAD
  • P-PHP
  • TL-TRY
  • $-ARS
  • English
  • Arabic

Furnace Splitter2.5.3

Free
Furnace Splitter
Main
2
2 Views
3
3 Downloads
44.56 KB
File Size
December 29
Upload
December 24
Submitted

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

This plugin uses the permission system. To assign a permission, use oxide.grant user or group name or steam id permission. To remove a permission, use oxide.revoke user or group name or steam id permission.

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

Configuration

The settings and options can be configured in the FurnaceSplitter file under the config directory. The use of an editor and validator is recommended to avoid formatting issues and syntax errors.

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

Localization

The default messages are in the FurnaceSplitter file under the lang/en directory. To add support for another language, create a new language folder (e.g. de for German) if not already created, copy the default language file to the new folder and then customize the messages.

{
  "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=greenON/color",
  "StatusOFFColor": "color=redOFF/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?.GetComponentbaseoven();

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

    var firstCookable = player.inventory.containerMain.itemList.FirstOrDefault(x = x.info.GetComponentitemmodcookable() != null);

    if (firstCookable != null)
    {
        string result = FurnaceSplitter.Callstring("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;
}
Download

Compatibility

Oxide
Oxide Compatible
Carbon
Carbon Compatible

Created By

Mrba

Mrba