Name: ic2.api.IDebuggable
Description:
It would be useful to have an IDebuggable interface available that would allow mods using the IC2 API to output their own message to the player when the debug item is clicked on their block(s).
Implementation on a mod's own tile entities would follow the same approach as any other interface in the ic2.api package.
Recipe:
The interface:
Code
package ic2.api;
/**
* Allows a tile entity to output a debug message when the debugItem is used on it.
*/
public abstract interface IDebuggable {
/**
* Checks if the tile entity is in a state that can be debugged.
*
* @return True if the tile entity can be debugged
*/
public abstract boolean isDebuggable();
/**
* Gets the debug text for the tile entity.
*
* @return The text that the debugItem should show
*/
public abstract String getDebugText();
}
Display More
This could be implemented in ItemDebug's right-click function with this:
(the sendChat function is obviously just for demonstration)