Package dan200.computercraft.api.detail
Interface DetailRegistry<T>
- Type Parameters:
T- The type of object that this registry provides details for.
@NonExtendable
public interface DetailRegistry<T>
A registry which provides computer-visible detail about in-game objects such as blocks, items or fluids.
These are used by computer methods such as turtle.getItemDetail() or turtle.inspect().
Specific instances of this registry are available from VanillaDetailRegistries and loader-specific versions
also in this package.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProvider(DetailProvider<? super T> provider) Registers a detail provider.getBasicDetails(T object) Compute basic details about an object.getDetails(T object) Compute all details about an object, usinggetBasicDetails(Object)and any registered providers.
-
Method Details
-
addProvider
Registers a detail provider.- Parameters:
provider- The detail provider to register.- See Also:
-
getBasicDetails
Compute basic details about an object. This is cheaper than computing all details operation, and so is suitable for when you need to compute the details for a large number of values.This method MAY be thread safe: consult the instance's documentation for details.
- Parameters:
object- The object to get details for.- Returns:
- The basic details.
-
getDetails
Compute all details about an object, usinggetBasicDetails(Object)and any registered providers.This method is NOT thread safe. It should only be called from the computer thread.
- Parameters:
object- The object to get details for.- Returns:
- The computed details.
-