Files
Chisel/src/main/java/com/cricketcraft/chisel/api/IChiselItem.java
T

85 lines
2.9 KiB
Java
Raw Normal View History

2015-01-09 01:51:52 -05:00
package com.cricketcraft.chisel.api;
import net.minecraft.block.Block;
2015-01-14 21:11:33 -05:00
import net.minecraft.entity.player.EntityPlayer;
2015-01-09 01:51:52 -05:00
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
2015-01-18 13:05:25 -05:00
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
2015-01-09 01:51:52 -05:00
/**
* Implement this on items which can be used to chisel blocks.
*/
2015-01-18 13:05:25 -05:00
public interface IChiselItem {
2015-01-09 01:51:52 -05:00
2015-01-14 21:11:33 -05:00
/**
* Checks whether the chisel can have its GUI opened
*
* @param world
* {@link World} object
* @param player
* The player holding the chisel. It can always be assumed that the player's current item will be this.
* @param chisel
* The {@link ItemStack} representing your chisel
* @return True if the GUI should open. False otherwise.
*/
boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel);
2015-01-09 01:51:52 -05:00
/**
2015-01-14 19:55:05 -05:00
* Called when an item is chiseled using this chisel
2015-01-09 01:51:52 -05:00
*
2015-01-14 19:55:05 -05:00
* @param world
* {@link World} object
* @param chisel
* The {@link ItemStack} representing the chisel
* @param target
* The {@link ICarvingVariation} representing the target item
* @return True if the chisel should be damaged. False otherwise.
2015-01-09 01:51:52 -05:00
*/
2015-01-20 18:13:59 -05:00
boolean onChisel(World world, ItemStack chisel, ICarvingVariation target);
2015-01-09 01:51:52 -05:00
/**
* Called to check if this {@link ItemStack} can be chiseled in this chisel. If not, there will be no possible variants displayed in the GUI.
* <p>
* It is not necessary to take into account whether this item <i>has</i> any variants, this method will only be called after that check.
*
* @param world
* {@link World} object
* @param chisel
* The {@link ItemStack} representing the chisel
* @param target
* The {@link ICarvingVariation} representing the target item
* @return True if the current target can be chiseled into anything. False otherwise.
*/
boolean canChisel(World world, ItemStack chisel, ICarvingVariation target);
/**
* Allows you to control if your item can chisel this block in the world.
*
* @param world
* World object
* @param player
* {@link EntityPlayer The player} holding the chisel.
* @param x
* X coord of the block being chiseled
* @param y
* Y coord of the block being chiseled
* @param z
* Z coord of the block being chmatiseled
* @param block
* The {@link Block} being chiseled
* @param metadata
* The blocks' metadata
* @return True if the chiseling should take place. False otherwise.
*/
boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata);
/**
* Allows you to control if your item has chiseling modes.
*
* @param chisel
* The {@link ItemStack} representing the chisel.
* @return True if the chisel supports modes. False otherwise.
*/
boolean hasModes(ItemStack chisel);
2015-01-09 01:51:52 -05:00
}