-
Notifications
You must be signed in to change notification settings - Fork 16
ComputerCraft peripherals API
Create Propulsion registers these peripherals when CC: Tweaked is installed. Peripheral types match Create’s SyncedPeripheral pattern (mainThread Lua calls run on the server).
Entry point: see also ComputerCraft overview.
All thrust readouts and thrust-derived physics use the shared thrustUnitsPerKn physics config value (default 1000) so displayed values match assembled/physics behavior.
While any computer is attached to a thruster peripheral:
- The block uses peripheral throttle (normalized
0.0 … 1.0), driven by Lua (setPower,setThrust, etc.). -
getPower()returns that peripheral throttle (same scale redstone would use:redstone / 15). - World redstone signals next to the block do not drive thrust until the computer disconnects.
When the computer detaches, peripheral throttle is cleared and the thruster returns to normal redstone-controlled behavior.
Fuel thrusters and ion thrusters use different peripheral type strings (thruster vs ion_thruster) so scripts can tell them apart.
Fuel / chemical thrusters only (not ion).
| Method | Returns | Notes |
|---|---|---|
getObstruction() |
number |
Returns unobstructed-block count from the obstruction scan |
setPower(redstonePower) |
— |
redstonePower: 0 … 15; sets peripheral throttle |
setPowerNormalized(power) |
— |
power: 0.0 … 1.0
|
getPower() |
number |
Normalized throttle 0.0 … 1.0
|
getCurrentThrustPN() |
number |
|
getCurrentThrustKN() |
number |
|
getDisplayedThrustPN() |
number |
Tooltip-scale thrust |
getDisplayedThrustKN() |
number |
|
getAirflowMs() |
number |
|
getFuelAmountMb() |
number |
|
getFuelCapacityMb() |
number |
|
tanks() |
table |
|
pushFluid(toName[, limit[, fluidName]]) |
number |
|
pullFluid(fromName[, limit[, fluidName]]) |
number |
FE-powered ion thrusters: same throttle and thrust readouts as Thruster, but no fluid API. Internal buffer is exposed as FE:
| Method | Returns | Notes |
|---|---|---|
setPower / setPowerNormalized
|
— | Same throttle semantics as Throttle control |
getPower() |
number |
|
getObstruction() |
number |
Returns unobstructed-block count from the obstruction scan |
getCurrentThrustPN() / getCurrentThrustKN()
|
number |
|
getDisplayedThrustPN() / getDisplayedThrustKN()
|
number |
|
getAirflowMs() |
number |
|
getEnergyAmountFe() |
number |
Stored FE |
getEnergyCapacityFe() |
number |
Buffer capacity |
Same throttle methods as the normal thruster, plus scroll-equivalent thrust configuration.
| Method | Returns | Notes |
|---|---|---|
setPower / setPowerNormalized
|
— | Same semantics as Thruster |
getPower() |
number |
|
setThrustConfig(percent) |
— | Scroll step 0 … 99 (matches on-block UI steps; capped internally) |
getThrustConfig() |
number |
Current step |
getTargetThrustPN() |
number |
Base thrust target from scroll / config (before throttle & atmosphere) |
getTargetThrustKN() |
number |
|
getCurrentThrustPN() |
number |
|
getCurrentThrustKN() |
number |
|
getDisplayedThrustPN() |
number |
|
getDisplayedThrustKN() |
number |
|
getAirflowMs() |
number |
|
getObstruction() |
number |
Returns unobstructed-block count from the obstruction scan |
Standard fuel vector thruster (not liquid fuel cell, not creative). Direction + throttle only; attach/detach follows Throttle control.
| Method | Notes |
|---|---|
getVectorX() / getVectorY()
|
Current nozzle direction components |
getTargetVectorX() / getTargetVectorY()
|
Target |
setVectorX(x) |
x clamped -1.0 … 1.0
|
setVectorY(y) |
y clamped -1.0 … 1.0
|
setVector(x, y) |
Both clamped |
| Method | Notes |
|---|---|
setThrust(power) |
power: 0 … 15 → peripheral throttle |
setThrustNormalized(power) |
power: 0.0 … 1.0
|
setPower(power) |
Alias of setThrust
|
setPowerNormalized(power) |
Alias of setThrustNormalized
|
getThrust() |
0 … 15 scale |
getPower() |
Normalized 0.0 … 1.0
|
Liquid-fuel vector thruster: same direction and throttle methods as Vector thruster (vector_thruster) above, plus fluid tank passthrough methods. No setThrustOutput / override helpers (those exist only on Creative vector thruster).
| Method | Notes |
|---|---|
getVectorX() / getVectorY()
|
Current nozzle direction components |
getTargetVectorX() / getTargetVectorY()
|
Target |
setVectorX(x) |
x clamped -1.0 … 1.0
|
setVectorY(y) |
y clamped -1.0 … 1.0
|
setVector(x, y) |
Both clamped |
| Method | Notes |
|---|---|
setThrust(power) |
power: 0 … 15 → peripheral throttle |
setThrustNormalized(power) |
power: 0.0 … 1.0
|
setPower(power) |
Alias of setThrust
|
setPowerNormalized(power) |
Alias of setThrustNormalized
|
getThrust() |
0 … 15 scale |
getPower() |
Normalized 0.0 … 1.0
|
| Method | Returns | Notes |
|---|---|---|
tanks() |
table |
|
pushFluid(toName[, limit[, fluidName]]) |
number |
|
pullFluid(fromName[, limit[, fluidName]]) |
number |
Separate peripheral implementation (CreativeVectorThrusterPeripheral): direction + throttle match Vector thruster, plus override APIs below.
| Method | Notes |
|---|---|
getVectorX() / getVectorY()
|
Current nozzle direction components |
getTargetVectorX() / getTargetVectorY()
|
Target |
setVectorX(x) |
x clamped -1.0 … 1.0
|
setVectorY(y) |
y clamped -1.0 … 1.0
|
setVector(x, y) |
Both clamped |
| Method | Notes |
|---|---|
setThrust(power) |
power: 0 … 15 → peripheral throttle |
setThrustNormalized(power) |
power: 0.0 … 1.0
|
setPower(power) |
Alias of setThrust
|
setPowerNormalized(power) |
Alias of setThrustNormalized
|
getThrust() |
0 … 15 scale |
getPower() |
Normalized 0.0 … 1.0
|
| Method | Returns | Notes |
|---|---|---|
setThrustOutput(thrustOutputPn) |
— | Base thrust in pN. Clamped to the same maximum as the on-block scroll: creativeVectorThrusterMaxThrust (kN from config) × thrustUnitsPerKn (physics config, default 1000). Pass < 0 (e.g. -1) to clear override and use scroll thrust again. |
clearThrustOutput() |
— | Same as setThrustOutput(-1) — removes Lua thrust override |
getMaxThrustOutputPn() |
number |
Max allowed setThrustOutput in pN from config |
isCustomThrustOutputActive() |
boolean |
true if a CC thrust override is active |
| Method | Notes |
|---|---|
getRpm() |
|
setSpeed(targetSpeed) |
Clamped to supported scroll levels |
setActive(active) |
| Method | Notes |
|---|---|
getTransmissionMode() |
"direct" or "incremental"
|
setTransmissionMode(mode) |
Throws on invalid mode |
getShiftLevel() |
|
setShiftLevel(level) |
| Method | Notes |
|---|---|
getLeftSignal() |
|
getRightSignal() |
|
setTargetAngle(angle) |
While attached, computer drives tilt target |
| Method |
|---|
getCoralAmountMb() |
getCoralCapacityMb() |
getEnergyAmountFe() |
getEnergyCapacityFe() |