2015-01-09 01:51:52 -05:00
|
|
|
package com.cricketcraft.chisel.api;
|
|
|
|
|
|
2015-01-09 03:03:37 -05:00
|
|
|
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.inventory.IInventory;
|
|
|
|
|
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 ItemStack} representing the target item
|
2015-01-19 10:01:08 -05:00
|
|
|
* @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
|
|
|
|
2015-01-14 21:33:43 -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 inv
|
|
|
|
|
* The inventory this chisel is currently in
|
|
|
|
|
* @param slot
|
|
|
|
|
* The slot index of the chisel in the inventory
|
|
|
|
|
* @param chisel
|
|
|
|
|
* The {@link ItemStack} representing the chisel
|
|
|
|
|
* @param target
|
|
|
|
|
* The {@link ItemStack} representing the target item
|
|
|
|
|
* @return True if the current target can be chiseled into anything. False otherwise.
|
|
|
|
|
*/
|
|
|
|
|
boolean canChisel(World world, IInventory inv, int slot, ItemStack chisel, ItemStack target);
|
|
|
|
|
|
2015-01-09 03:03:37 -05:00
|
|
|
/**
|
|
|
|
|
* Allows you to control if your item can chisel this block in the world.
|
|
|
|
|
*
|
|
|
|
|
* @param world
|
|
|
|
|
* World object
|
|
|
|
|
* @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 chiseled
|
|
|
|
|
* @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, int x, int y, int z, Block block, int metadata);
|
2015-01-19 11:23:11 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
}
|