mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-13 03:43:08 +00:00
Add the concept of "available peripherals" to IComputerAccess
This provides a mechanism for peripherals to see what else a computer is connected to - and then interact with those peripherals. We also add the ability to query what block or tile a peripheral targets. This allows one to interact with the original block of adjacent peripherals instead.
This commit is contained in:
@@ -114,6 +114,18 @@ public interface IPeripheral
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object that this peripheral provides methods for. This will generally be the tile entity
|
||||
* or block, but may be an inventory, entity, etc...
|
||||
*
|
||||
* @return The object this peripheral targets
|
||||
*/
|
||||
@Nonnull
|
||||
default Object getTarget()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether this peripheral is equivalent to another one.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user