▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/CC: Optical
CC: Optical

CC: Optical

All you need for your turrets!

Оцените первым
3.3K
11

CC:Optical

Adds sensor and cannon control peripherals to CC:Tweaked, compatible with Create:Aeronautics.

!All blocks

Sensors

Four variants with dynamic FOV zoom, target filtering, and scanning methods:

Optical Sensor (optical_sensor) — omni-directional by default (360° FOV) with a base range of 96 blocks. Supports narrowing FOV down to 15° for increased zoom range (up to 192 blocks). Requires direct line of sight (real terrain blocks only; sublevel terrain is transparent).

Directional Optical Sensor (directional_optical_sensor) — directional cone field of view (default 125°, adjustable down to 10°), base range 90 blocks at full FOV, zooming up to 512 blocks at minimum FOV.

Long Range Optical Sensor (long_range_optical_sensor) — directional cone field of view (default 125°, adjustable down to 10°), base range 96 blocks at full FOV, zooming up to 900 blocks at minimum FOV.

Radar (entity_radar) — omni-directional, base range 64 blocks, ignores line of sight. Placing adjacent Radar Booster (radar_booster) blocks adds +224 blocks per booster (up to 2 boosters for 512 blocks total). Adding a 2-block antenna (lightning rods or iron bars) on top of the radar or on any of its boosters multiplies the booster effect, boosting the radar range up to ~900 blocks. Position readings have Gaussian noise (increases with distance, varies by sensor altitude relative to sea level).

Detections work across sublevel boundaries. A sensor on an airship can spot another airship and the entities inside it. Each detection carries the sublevel UUID when the target is inside one. Decorative non-entities (paintings, item frames, displays, markers) are automatically ignored.

Detection fidelity decreases with range, but recognition distances scale dynamically with FOV zoom and booster upgrades. Beyond precision limits, targets are classified only by size (object_small/object_mid/object_large). Radar position noise grows linearly with distance and varies with the sensor's altitude relative to sea level.

Range & Recognition Scaling

Sensor / ConfigurationFOV / AddonsMax RangeExact Type (type)Player Name (name)
Optical Sensor360° (Omni)96 m≤ 56 m≤ 40 m
Optical Sensor15° (Zoom)192 m≤ 112 m≤ 80 m
Directional Optical125° (Full FOV)90 m≤ 56 m≤ 40 m
Directional Optical10° (Max Zoom)512 m≤ 318 m≤ 227 m
Long Range Optical125° (Full FOV)96 m≤ 56 m≤ 40 m
Long Range Optical10° (Max Zoom)900 m≤ 525 m≤ 375 m
RadarBase (0 Boosters)64 m≤ 28 m≤ 18 m
Radar1 Booster288 m≤ 126 m≤ 81 m
Radar2 Boosters (Full Boost)512 m≤ 224 m≤ 144 m
Radar1 Booster + Antenna482 m≤ 211 m≤ 135 m
Radar2 Boosters + Antenna900 m≤ 394 m≤ 253 m

Lua API

Sensor methods available in CC:Tweaked:

MethodParametersReturnsDescription
scanrelativeCoords: boolean (optional)tableRun an immediate scan. If true, returned positions are rotated into the sensor's sublevel local frame.
setFovfov: numbernumberSets optical field of view in degrees (clamped to [minFov, maxFov]). Narrower FOV increases effective range. Optical only.
getFovnumberReturns current field of view in degrees.
getMinFovnumberReturns minimum allowed field of view in degrees.
getMaxFovnumberReturns maximum allowed field of view in degrees.
getRangenumberReturns current effective detection range in blocks (scales dynamically with FOV).
setFiltertypeOrList: string|table (optional)string[]Sets active target filter (by exact ID, short name, "sublevel", or size class "object_small"/"object_mid"/"object_large"). Unmatched entities do not count towards target limits. Pass nil to clear.
getFilterstring[]Returns array of currently active target filters.
clearFilterbooleanClears all active filters.
isOpticalbooleanReturns true if this is an optical sensor supporting FOV/zoom/filtering, false for radar.

scan() return table

FieldTypeDescription
countnumberNumber of detections
lastScanTicknumberServer tick when scan ran
relativeCoordsbooleanWhether relative coordinates were used
detectionstable[]Array of detection objects

Detection fields

FieldTypeDescription
idstringEntity UUID (or sublevel UUID for sublevel bounding boxes)
typestringEntity registry name (e.g. "minecraft:zombie"), size class ("object_small"/"object_mid"/"object_large"), or "sublevel"
namestring or nilPlayer scoreboard name (if within name-precision distance)
x, y, znumberOffset from sensor origin (blocks)
distancenumberStraight-line distance
subLevelUUIDstring or nilUUID of the sublevel the entity is inside
subLevelNamestring or nilName of the sublevel

Example

local sensor = peripheral.wrap("left")

-- Narrow FOV to boost range and focus only on sublevels
if sensor.isOptical() then
  sensor.setFov(15)
  sensor.setFilter("sublevel")
end

while true do
  local res = sensor.scan(true)
  print("Targets: " .. res.count)
  for _, t in ipairs(res.detections) do
    print(("%s @ %.1f m (x=%.1f, y=%.1f, z=%.1f)"):format(t.type, t.distance, t.x, t.y, t.z))
  end
  sleep(0.25)
end

CBC Cannon Mount

Wraps cannon mounts from Create Big Cannons as cbc_cannon_mount peripherals (additional type cannon_mount). Aim, fire, and query state from Lua.

MethodParametersReturnsDescription
assemblebooleanAssembles the cannon contraption
disassemblebooleanDisassembles
firebooleanFires the cannon
isRunningbooleanWhether assembled and running
isAssembledbooleanSame as isRunning
isLoadedbooleanWhether cannon can fire
setPitchpitch: numberbooleanSet target pitch (degrees)
setYawyaw: numberbooleanSet target yaw (degrees)
getPitchnumberCurrent pitch
getYawnumberCurrent yaw offset
getXnumber or nilController X position
getYnumber or nilController Y position
getZnumber or nilController Z position
getMaxDepressnumber or nilMaximum depression angle
getMaxElevatenumber or nilMaximum elevation angle
getDirectionstring or nilFacing direction (north/south/east/west)
getCannonWeightnumber or nilCannon stress-weight

Rotation can be restricted by config (cbcFreeRotationEnabled, cbcFreeRotationMaxWeight). Throws LuaException when blocked.

Fully compatible with CannonMountPeripheral from VS: Addition - same "cannon_mount" additional type, same method shapes.

For Server Owners

All features are configurable. Disable the CBC cannon mount peripheral (cbcPeripheralEnabled: false) to avoid conflicts with other mods that add the same peripheral (CC:CBC as example).

If you would like to translate the mod, have found a bug, or want to suggest something new:

Discord: Cyber_Jellyfish

Партнёрский материал

Как поиграть с друзьями с модом CC: Optical?

Мод CC: Optical куда интереснее в компании: поднимите сервер Майнкрафт с уже установленным модом, позовите друзей и играйте по своим правилам. Хостинг Майнкрафт для мода CC: Optical будет готов за пару минут - BungeeHost сделает всё за вас.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Зависимости

Детали

Лицензия:
Опубликован:4 месяца назад
Обновлён:1 месяц назад
Главная