Mekanism-tilera-Edition/common/ic2/api/tile/IWrenchable.java

62 lines
1.6 KiB
Java
Raw Normal View History

2013-05-07 22:12:07 +02:00
package ic2.api.tile;
2013-04-13 16:35:13 +02:00
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
/**
* Allows a tile entity to make use of the wrench's removal and rotation functions.
*/
public interface IWrenchable {
/**
* Determine if the wrench can be used to set the block's facing.
* Called before wrenchCanRemove().
*
* @param entityPlayer player using the wrench, may be null
* @param side block's side the wrench was clicked on
* @return Whether the wrenching was done and the wrench should be damaged
*/
boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side);
/**
* Get the block's facing.
*
* @return Block facing
*/
short getFacing();
/**
* Set the block's facing
*
* @param facing facing to set the block to
*/
void setFacing(short facing);
/**
* Determine if the wrench can be used to remove the block.
* Called if wrenchSetFacing fails.
*
* @param entityPlayer player using the wrench, may be null
* @return Whether the wrenching was done and the wrench should be damaged
*/
boolean wrenchCanRemove(EntityPlayer entityPlayer);
/**
* Determine the probability to drop the block as it is.
* The first entry in getBlockDropped will be replaced by blockid:meta if the drop is successful.
*
* @return Probability from 0 to 1
*/
float getWrenchDropRate();
/**
* Determine the item the block will drop when the wrenching is successful.
*
2013-12-26 21:00:08 +01:00
* The ItemStack will be copied before creating the EntityItem.
*
2013-04-13 16:35:13 +02:00
* @param entityPlayer player using the wrench, may be null
2013-12-26 21:00:08 +01:00
* @return ItemStack to drop, may be null
2013-04-13 16:35:13 +02:00
*/
ItemStack getWrenchDrop(EntityPlayer entityPlayer);
}