package common.item.tool;

import common.entity.npc.EntityNPC;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemControl;
import common.item.ItemStack;
import common.model.Transforms;
import common.util.BlockPos;
import common.world.World;

public class ItemEditWand extends Item {
	public ItemEditWand() {
		this.setMaxAmount(1);
        this.setTab(CheatTab.TOOLS);
	}
	
//    public boolean canBreakBlocks() {
//        return false;
//    }
//    
//    public boolean ignoresBlocks() {
//        return true;
//    }

    public boolean hasEffect(ItemStack stack) {
        return true;
    }
    
//    public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
//    {
//        return true;
//    }
    
    public boolean onAction(ItemStack stack, EntityNPC player, World world, ItemControl control, BlockPos block) {
    	if(!world.client && control == ItemControl.TERTIARY && player.connection.isAdmin())
    		player.connection.setSelectMode();
    	if(!world.client && (control == ItemControl.PRIMARY || control == ItemControl.SECONDARY) && player.connection.isAdmin())
    		player.connection.setSelection(control == ItemControl.PRIMARY, block);
    	return true;
    }

    public Transforms getTransform() {
    	return Transforms.TOOL;
    }
}
