Skip to main content

Machine

Data-driven machines for BTC Sky islands: recipes, energy grid, tiers, upgrade modules and holograms.

Privatev0.1.1Economy & crafting
RequiresTypeWriter0.9.0-beta-177 (BTC build)Quest extensionRPG Bundle (RPG Core)BTC SkyBTCMobsGUI extension (GuiAndDialogs)CraftEngineoptionalMiniPlaceholdersoptional

Built for the BornToCraft network. This extension is documented for reference and is not distributed.

Overview​

Machine turns machine design into configuration. One Machine Definition entry describes a type of machine: how many input, output, fuel and upgrade slots it has, what it processes, what it costs in fuel and energy, how it looks, what its hologram says and how many copies a player or an island may place. The extension reads the definition and runs every placed copy. A furnace, a grinder, a cobblestone generator or a mob grinder is an entry, not code.

Machines belong to BTC Sky islands. A machine can only be placed on the player's own island, is bounded by per-player and per-island limits, and its tier is unlocked by the island's research tree. Energy and liquids are shared across a dimension of the island: generators and cells build a pool, and every linked machine of that dimension draws from it.

This is a private extension of the BTC build of TypeWriter (BTC Core, Paper or Folia), documented for reference. The runtime is Folia-safe: slots are cached in memory and saved asynchronously.

Features​

  • One entry per machine — slots, recipes, fuel, energy, visuals, hologram, limits and automation live in a single Machine Definition.
  • 27 processing types — recipe machines (smelting, grinding, sawing, mixing, brewing…), storage, logistics, area machines, energy machines, spawners, grinders and more.
  • Multi-input and random recipes — extra inputs and outputs, chance-based outputs, liquid inputs and outputs, catalogue items and vanilla potions.
  • Shared energy grid and liquid tanks — cells, generators and tanks pool per island dimension; a machine can be unlinked from the grid.
  • Tiers and upgrade modules — permanent tiers unlocked by BTC Sky research, plus removable modules (speed, yield, fortune, range, filter, capacity, liquid fuel) that stack with them.
  • Island protection and limits — own-island placement, build flag, per-player, per-island and per-dimension caps.
  • Redstone and hoppers — redstone mode, ejection, comparator output and completion pulses, hopper transfers.
  • Holograms — a status text with progress bar above each machine, fully MiniMessage-formatted.
  • Dashboard menu — a menu that lists every machine of the dimension with its state, energy and link status.
  • Persistence — placed machines, inventories, energy and progress are saved in a Machine Data Artifact.

Installation​

  1. Install TypeWriter with the BTC build (BTC Core on Paper or Folia).
  2. Install the extensions Machine depends on: Quest, RPGBundle (RPG Core), BTC Sky, BTCMobs and GuiAndDialogs (the shared GUI layer).
  3. Optional: install CraftEngine if a definition uses the FURNITURE or CUSTOM_BLOCK visual, and MiniPlaceholders to use the placeholders.
  4. Put the Machine JAR in plugins/Typewriter/extensions/ and restart the server.
  5. Redstone comparator output and completion pulses only work when BTC Core provides redstone emission.

Getting started​

Create a furnace that smelts iron ore into ingots:

  1. In the TypeWriter web panel, open a static page and add a Machine Data Artifact. It stores every placed machine. Do not change its artifactId afterwards, or the saved machines are lost.
  2. On the same page, add a Machine Definition. Give it a name, keep processingType on SMELTING.
  3. Set storageRef to the artifact from step 1.
  4. In recipes, add one recipe: inputMaterial IRON_ORE, outputMaterial IRON_INGOT, outputAmount 1, cookTime 200 (ticks, so 10 seconds). Leave fuelCost at 1 or more if the machine must burn fuel.
  5. In fuelTypes, add COAL with a burnTime and a fuelValue.
  6. Set spawnItem to the item players place to create the machine. A definition needs a spawnItem or a vanillaBlock, otherwise it is rejected at publication.
  7. Optionally set perIslandLimit to cap the number of copies per island.
  8. Publish. Place the item on your own island: the machine appears with its hologram, and a right-click opens its menu.
Converting a vanilla block

vanillaBlock (for example BREWING_STAND) makes the definition take over that vanilla block: placing it creates the machine instead. Vanilla conversions are not capped by the placement limit warning, because a cap would also cap the vanilla block.

How it works​

A machine is a definition (the entry) plus instances (the copies placed in the world). The definition never changes at runtime; each instance keeps its own inventory, energy charge and progress.

The definition model​

Every field of Machine Definition belongs to one of these groups:

GroupFieldsWhat it controls
TypeprocessingType, behaviorsWhat the machine does. behaviors is optional and derived from the type when empty.
SlotsinputSlots, outputSlots, hasFuelSlot, upgradeSlots, essenceSlots, filterSlots, shearsSlots, maxPerSlotThe inventory layout. A machine layout is limited to 54 slots.
Recipes and fuelrecipes, fuelTypesWhat goes in and what comes out, how long it takes and what it costs.
Energy and liquidsenergyCapacity, energyGenerationPerTick, liquidTankCapacity, liquidFuelNamePool contribution and liquid handling.
Progressiontiers, allowedUpgrades, upgradeSpecsPermanent tiers and removable modules.
LookspawnItem, visualType, furnitureId, customBlockId, alignWithPlayerYaw, hologram*Item, model and hologram.
PlacementmachineLimit, perIslandLimit, islandLimitUpgradeKey, dimensionScope, vanillaBlockWho can place it, where and how many.
AutomationhopperInterval, hopperTransferAmount, redstoneMode, ejectWhenPowered, redstoneComparatorOutput, redstonePulseOnComplete, redstonePulseTicksHoppers and redstone.
PersistencestorageRef, guiStorageRefWhere instances and STORAGE contents are saved.

Processing types​

FamilyTypes
Recipe machines, driven by recipesSMELTING, LIQUID_SMELTING, MULTI_SMELTING, GRINDING, SAWING, MIXING, COMPACTING, ENRICHING, RECYCLING, BREWING, AUTO_CRAFTING, INDUSTRIAL, GENERIC
ProductionGENERATOR (no input: produces the recipe outputs over time, optional energy cost)
Storage and logisticsSTORAGE, SORTING (each filter slot claims a side), CONVEYOR (directional belt)
Area machinesVACUUM (vacuumRange), SHEARING (shearRange, shearInterval, shearsSlots)
EnergyENERGY_CELL, ENERGY_GENERATOR, CHARGING (chargeables, chargeRatePerSecond)
EntitiesASSEMBLER (assemblerMode SPAWN or COLLECT, assemblerEntityType, assemblerMobId, assemblerIngredients, assemblerEnergyCost, assemblerInterval, assemblerRange, spawnerUpgrades), MOB_GRINDING (grinder* fields), EXPERIENCE_TANK (experienceCapacity)
SpecialCONTROL_PANEL (runs panelOpenCommand / panelAltCommand, cannot be picked up), TRANSMUTATION (moves the highest enchantment of an item onto a book for experience bottles)

SMELTING and AUTO_CRAFTING fall back to vanilla recipes when no recipe is declared. All other recipe machines with zero recipes accept items and stay idle forever; the extension logs a warning at publication.

Energy and liquids​

Energy is stored in ENERGY_CELL machines. The island dimension's pool is the sum of its linked cells. ENERGY_GENERATOR machines feed it, and consumers draw from it. A machine joins the grid of its dimension as soon as it is placed; the Machine Link button (or the dashboard) takes it off and back on. A cell in the Overworld never feeds a machine in the Nether.

Liquid tanks work the same way: a linked machine reaches every tank of its dimension, an unlinked one sees only its own. A recipe consumes or produces liquids with liquidInputName/liquidInputAmount and liquidOutputName/liquidOutputAmount.

Tiers and upgrade modules​

  • A tier (tiers) is permanent. Each tier names the BTC Sky research node (researchNode) that unlocks it and sets speed, yield and energy multipliers, a fortune chance and extra slots. List tiers in ascending order: the highest unlocked one applies to every copy of the machine on the island. A tier with a blank researchNode is rejected.
  • An upgrade module (upgradeSpecs) is an item put in an upgrade slot. itemId is the BTC item id (recommended), material is a fallback. Its type (SPEED, YIELD, ENERGY_EFFICIENCY, FORTUNE, RANGE, FILTER, CAPACITY, LIQUID_FUEL) only counts if it is listed in allowedUpgrades.
  • Tier and modules multiply together.

Machine Menu is a GUI built from layouts of the shared GUI extension (layoutPool, mainLayoutId, inventoryRows). Items of the layout whose buttonType is a Machine button are filled with live data:

Button typeEffect
MACHINE_OPEN, MACHINE_SMELT, MACHINE_COLLECT, MACHINE_STATUS, MACHINE_FUELStandard machine actions and status display.
MACHINE_LINKLinks the machine to its dimension grid, or unlinks it.
MACHINE_PICKUPRemoves the open machine and gives it back as an item.
NAV_BACK, NAV_CLOSEGo back or close.
MACHINE_GRID_INFOSummary of the dimension: machine counts, energy stored, capacity, produced, consumed and balance.
MACHINE_ENTRYOne machine of the dimension per tagged slot. Left-click toggles its hologram, right-click toggles its grid link.
MACHINE_LIST_ARROWScroll arrow of the machine list, with the page counter.

Two more entries complete the set. Open Machine GUI links a definition to a menu title and size, but its action does nothing when triggered in the current code: machines open their menu on right-click. Machine Position Variable returns the position of the viewer's own machine of a given definition in their dimension, so one NPC entry can follow each island's machine.

The labels shown by the dashboard (states, link, hologram) come from Machine Dashboard Wording. The scrolling and the open command come from Machine Dashboard Command.

Commands​

CommandDescription
/typewriter machine giveList every registered machine.
/typewriter machine give <machine>Give yourself the item of a machine, by id or by part of its name (accents and case are ignored).
/typewriter machine liquideShow the liquids held by the machine you are looking at (within 6 blocks).
/typewriter machine liquide <liquid> <millibuckets>Pour a liquid into the targeted machine. A test tool: no player gesture fills a tank.

The /machine tree is registered under the TypeWriter command, so it is typed /typewriter machine … (alias /tw machine …). All of it requires machine.admin. Entries can register more commands, as top-level commands:

CommandDescription
/<commandName> scroll <delta>, resetScroll the dashboard list, or rewind it. Default name machines.
/<commandName> dashboardOpen the menu named in dashboardMenuId.
/<commandName> link <instanceId>, hologram <instanceId>Switch the grid link or the hologram of a machine. Used by the dashboard slots.
/<commandName> of Machine Test CommandFires its triggers, if criteria match. Default name machine-test.
/<commandName>, clear, bench of Machine Test Platform CommandBuild a showcase of machines where you stand, remove it, or provision loadbench_* worlds. Default name machine-test-platform.

Permissions​

PermissionGrants
machine.adminThe /typewriter machine commands.
machine.protection.bypassPlace, break and interact with machines anywhere, ignoring island ownership, build flag and limits.

Placeholders​

MiniPlaceholders tags of the machine expansion, provided through TypeWriter. <instance> is the id of a placed machine, <slot> the logical slot index (default 0).

PlaceholderReturns
<machine_input:instance:slot>true if the input slot holds an item.
<machine_input_name:instance:slot>Material name of the input item.
<machine_input_amount:instance:slot>Amount in the input slot.
<machine_output:instance:slot>true if the output slot holds an item.
<machine_output_name:instance:slot>Material name of the output item.
<machine_output_amount:instance:slot>Amount in the output slot.
<machine_tier:instance>Name of the active tier.
<machine_dimension>Readable name of the dimension the player stands in.
<machine_grid_count>, <machine_grid_active>, <machine_grid_stalled>Machines in the dimension, active, and stalled.
<machine_energy_stored>, <machine_energy_capacity>Energy stored and total capacity of the dimension.
<machine_energy_produced>, <machine_energy_consumed>, <machine_energy_balance>Energy per second produced, consumed and net.

The player placeholders return an empty value without a player (console).

Hologram messages accept %machine%, %tier%, %energy%, %bar%, %percent% and %time_left%.

Entries​

10 entries, generated from the extension source.

Actions2
Commands3
Variables1
Artifacts1
Manifests2
Other entries1

Troubleshooting​

The definition is rejected at publication. Check the server log: no way to obtain this machine means neither spawnItem nor vanillaBlock is set; tier[n].researchNode is blank means a tier has no research node; the machine layout needs N slots, maximum is 54 means too many slots.

A machine accepts items and never works. A recipe machine (for example MIXING, GRINDING, BREWING) with an empty recipes list has no vanilla fallback. Only SMELTING and AUTO_CRAFTING use vanilla recipes.

Placement is refused. The messages come from Machine Protection Config: the machine must be on your own BTC Sky island, you need the build flag, and the player, island and dimension limits and dimensionScope apply. A CONTROL_PANEL needs a stabilisation crystal in the dimension. Staff with machine.protection.bypass skip all checks.

The machine says it is not linked or has no energy. It needs ENERGY_CELL and ENERGY_GENERATOR machines in the same dimension, and it must be linked (use the link button). The pool never crosses dimensions.

An upgrade module changes nothing. Its type must be in allowedUpgrades, and CAPACITY only works on STORAGE, EXPERIENCE_TANK and ENERGY_CELL. LIQUID_FUEL needs a liquidFuelName.

A tier is never applied. The researchNode must match a research node id of BTC Sky, and the island must have unlocked it.

The menu opens empty or does not open. Check mainLayoutId against the ids in layoutPool; the log names the pool ids when it does not match.

Furniture or custom block visuals fail. FURNITURE and CUSTOM_BLOCK need CraftEngine and an existing furnitureId or customBlockId.

  • BTC Sky — islands, ownership, research and dimensions that machines rely on.