mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-20 00:34:52 +00:00
53811f8169
Peripherals can now have multiple types: - A single primary type. This is the same as the current idea of a type - some identifier which (mostly) uniquely identifies this kind of peripheral. For instance, "speaker" or "minecraft:chest". - 0 or more "additional" types. These are more like traits, and describe what other behaviour the peripheral has - is it an inventory? Does it supply additional peripherals (like a wired modem)?. This is mostly intended for the generic peripheral system, but it might prove useful elsewhere too - we'll have to see! - peripheral.getType (and modem.getTypeRemote) now returns 1 or more values, rather than exactly one. - Add a new peripheral.hasType (and modem.hasTypeRemote) function which determines if a peripheral has the given type (primary or additional). - Change peripheral.find and all internal peripheral methods to use peripheral.hasType instead. - Update the peripherals program to show all types This effectively allows you to do things like `peripheral.find("inventory")` to find all inventories. This also rewrites the introduction to the peripheral API, hopefully making it a little more useful. |
||
---|---|---|
.. | ||
alarm.md | ||
char.md | ||
computer_command.md | ||
disk_eject.md | ||
disk.md | ||
http_check.md | ||
http_failure.md | ||
http_success.md | ||
key_up.md | ||
key.md | ||
modem_message.md | ||
monitor_resize.md | ||
monitor_touch.md | ||
mouse_click.md | ||
mouse_drag.md | ||
mouse_scroll.md | ||
mouse_up.md | ||
paste.md | ||
peripheral_detach.md | ||
peripheral.md | ||
rednet_message.md | ||
redstone.md | ||
task_complete.md | ||
term_resize.md | ||
terminate.md | ||
timer.md | ||
turtle_inventory.md | ||
websocket_closed.md | ||
websocket_failure.md | ||
websocket_message.md | ||
websocket_success.md |