public interface SerialInterfaceProvider
Implementation will typically check for the presence of a specific tile entity and create a wrapper for the tile entity.
| Modifier and Type | Method and Description |
|---|---|
SerialProtocolDocumentationReference |
getDocumentationReference()
A reference to a manual entry describing the protocol used by the
SerialInterface generated by this provider. |
SerialInterface |
interfaceFor(net.minecraft.world.World world,
net.minecraft.util.BlockPos position,
net.minecraft.util.EnumFacing side)
Creates a new serial interface instance for the specified position.
|
boolean |
isValid(net.minecraft.world.World world,
net.minecraft.util.BlockPos position,
net.minecraft.util.EnumFacing side,
SerialInterface serialInterface)
Tests whether the specified serial interface is still valid for the specified position.
|
boolean |
worksWith(net.minecraft.world.World world,
net.minecraft.util.BlockPos position,
net.minecraft.util.EnumFacing side)
Checks whether the provider supports the specified block position.
|
boolean worksWith(net.minecraft.world.World world,
net.minecraft.util.BlockPos position,
net.minecraft.util.EnumFacing side)
world - the world containing the position.position - the position in question.side - the side of the position in question.SerialInterface can be provided for the position.SerialInterface interfaceFor(net.minecraft.world.World world, net.minecraft.util.BlockPos position, net.minecraft.util.EnumFacing side)
world - the world containing the position.position - the position in question.side - the side of the position in question.SerialProtocolDocumentationReference getDocumentationReference()
SerialInterface generated by this provider.
It is generally recommended to have one provider per interface / protocol type. In case you decide you'd like to have one multi-interface provider, you'll need to put all your documentation in that one manual entry, or use it as an index.
While it is legal to return null here, it is strongly discouraged to not have a manual entry for a protocol used by a serial interface, since this will make it nearly impossible for the player to figure out how to use the interface.
The links returned from all registered providers will be listed in the serial protocol overview page in the TIS-3D manual as an automatically populated list.
boolean isValid(net.minecraft.world.World world,
net.minecraft.util.BlockPos position,
net.minecraft.util.EnumFacing side,
SerialInterface serialInterface)
This is used by the serial port module to determine whether a new serial interface instance has to be constructed for the specified position, or whether an existing one can be re-used. This avoids resetting the serial interfaces state in case of an adjacent block change.
Generally this this should return false if the interface is not
once provided by this provider, or more generally, if it is the same kind
of serial interface that would be created via interfaceFor(World, BlockPos, EnumFacing),
otherwise this should return true.
world - the world containing the position.position - the position in question.side - the side of the position in question.serialInterface - the interface to validate.