blob: 93bc3ff339727e97c4cd13bd57d04664b068ccb2 [file] [log] [blame] [raw]
package li.cil.oc.api.network;
import net.minecraft.entity.player.EntityPlayer;
/**
* Allows defining a callback for when a block is right-clicked with an
* analyzer.
* <p/>
* This has to be implemented by a {@link net.minecraft.tileentity.TileEntity},
* else it will have no effect.
*/
public interface Analyzable extends Environment {
/**
* Called when a player uses the analyzer tool on the tile entity's block.
* <p/>
* This can be used to display additional block specific information in the
* player's chat when the analyzer is used (or do whatever) and may also be
* used to redirect the query to some other environment by returning some
* other environment than <tt>this</tt>. The latter is used by multi-block
* screens, for example, to always show information of the primary screen.
* <p/>
* Return <tt>null</tt> to suppress any further node information being
* displayed.
*
* @param player the player that used the analyzer.
* @param side the side of the block the player clicked.
* @param hitX the relative X coordinate the player clicked.
* @param hitY the relative Y coordinate the player clicked.
* @param hitZ the relative Z coordinate the player clicked.
* @return the environment to display node information for, usually the
* environment itself (i.e. just return <tt>this</tt>).
*/
Environment onAnalyze(EntityPlayer player, int side, float hitX, float hitY, float hitZ);
}