Interface GenericPeripheral
- All Superinterfaces:
GenericSource
GenericSource
which provides methods for a peripheral.
Unlike a GenericSource
, all methods should target the same type, for instance a
block entity subclass. This is not currently enforced.
-
Method Summary
Modifier and TypeMethodDescriptiondefault PeripheralType
getType()
Get the type of the exposed peripheral.Methods inherited from interface dan200.computercraft.api.lua.GenericSource
id
-
Method Details
-
getType
Get the type of the exposed peripheral.Unlike normal
IPeripheral
s,GenericPeripheral
do not have to have a type. By default, the resulting peripheral uses the resource name of the wrapped block entity (for instanceminecraft:chest
).However, in some cases it may be more appropriate to specify a more readable name, or provide additional types. Overriding this method allows you to do so.
When multiple
GenericPeripheral
s provide a primary peripheral type for a single block entity, the lexicographically smallest will be chosen. In order to avoid this conflict, primary types should only be used when your peripheral targets a single block entity AND it's likely that you're the only mod to do so.- Returns:
- The type of this peripheral or
PeripheralType.untyped()
. - See Also:
-