1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 20:20:30 +00:00
CC-Tweaked/doc/events
Jonathan Coates 53811f8169
Allow peripherals to have multiple types (#963)
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.
2021-11-29 17:37:30 +00:00
..
alarm.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
char.md Add some initial documentation for events 2021-01-14 18:37:20 +00:00
computer_command.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
disk_eject.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
disk.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
http_check.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
http_failure.md Migrate all examples to use tweaked.cc 2021-01-23 14:58:08 +00:00
http_success.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
key_up.md Add some initial documentation for events 2021-01-14 18:37:20 +00:00
key.md Add a pre commit hook to lint code 2021-04-28 21:24:27 +01:00
modem_message.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
monitor_resize.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
monitor_touch.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
mouse_click.md Add some initial documentation for events 2021-01-14 18:37:20 +00:00
mouse_drag.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
mouse_scroll.md Add some initial documentation for events 2021-01-14 18:37:20 +00:00
mouse_up.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
paste.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
peripheral_detach.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
peripheral.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
rednet_message.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
redstone.md Allow peripherals to have multiple types (#963) 2021-11-29 17:37:30 +00:00
task_complete.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
term_resize.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
terminate.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
timer.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
turtle_inventory.md Finish the rest of the event documentation (#683) 2021-01-19 09:20:52 +00:00
websocket_closed.md Migrate all examples to use tweaked.cc 2021-01-23 14:58:08 +00:00
websocket_failure.md Migrate all examples to use tweaked.cc 2021-01-23 14:58:08 +00:00
websocket_message.md Added binary flag to websocket_message docs 2021-09-23 15:20:19 -04:00
websocket_success.md Migrate all examples to use tweaked.cc 2021-01-23 14:58:08 +00:00