CC: Optical 图标

CC: Optical

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.0.3
本资源为搬运资源,原资源地址: https://modrinth.com/mod/ccoptical
资源信息

Minecraft 版本: 1.21.1

平台: neoforge

标签: game-mechanics technology utility

资源介绍

CC:Optical

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

All blocks

Sensors

Three variants, one method — scan():

Optical Sensor (optical_sensor) — detects entities up to 96 blocks. Requires direct line of sight (real terrain blocks only; sublevel terrain is transparent).

Directional Optical Sensor (directional_optical_sensor) — same but with a cone-shaped field of view (configurable, default 110°), range 80 blocks.

Radar (entity_radar) — omni-directional, range 64 blocks, ignores line of sight. 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.

Detection fidelity decreases with range. Optical sensors report exact entity types up to 56 blocks and player names up to 40 blocks. Radar does the same within 28 and 18 blocks — beyond that, 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.

Lua API

All three expose the same single method:

Method Parameters Returns Description
scan relativeCoords: boolean (optional) table Run an immediate scan. If true, returned positions are rotated into the sensor's sublevel local frame.

scan() return table

Field Type Description
count number Number of detections
lastScanTick number Server tick when scan ran
detections table[] Array of detection objects

Detection fields

Field Type Description
id string Entity UUID (or sublevel UUID for sublevel bounding boxes)
type string Entity registry name (e.g. "minecraft:zombie"), size class ("object_small"/"object_mid"/"object_large"), or "sublevel"
name string or nil Player scoreboard name (if within name-precision distance)
x, y, z number Offset from sensor origin (blocks)
distance number Straight-line distance
subLevelUUID string or nil UUID of the sublevel the entity is inside
subLevelName string or nil Name of the sublevel

Example

local sensor = peripheral.wrap("left")

while true do
  local res = sensor.scan()
  print("Targets: " .. res.count)
  for _, t in ipairs(res.detections) do
    print(("%s @ %.1f m"):format(t.type, t.distance))
  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.

Method Parameters Returns Description
assemble boolean Assembles the cannon contraption
disassemble boolean Disassembles
fire boolean Fires the cannon
isRunning boolean Whether assembled and running
isAssembled boolean Same as isRunning
isLoaded boolean Whether cannon can fire
setPitch pitch: number boolean Set target pitch (degrees)
setYaw yaw: number boolean Set target yaw (degrees)
getPitch number Current pitch
getYaw number Current yaw offset
getX number or nil Controller X position
getY number or nil Controller Y position
getZ number or nil Controller Z position
getMaxDepress number or nil Maximum depression angle
getMaxElevate number or nil Maximum elevation angle
getDirection string or nil Facing direction (north/south/east/west)
getCannonWeight number or nil Cannon 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

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Night Vision 2

价格:0 墨喵币
下载量:0

查看详情
abc: no pumpkin

价格:0 墨喵币
下载量:0

查看详情
VGaming Money

价格:0 墨喵币
下载量:0

查看详情
Barely Simple Staff

价格:0 墨喵币
下载量:0

查看详情