//package net.machinemuse.api
//
//import buildcraft.api.tools.IToolWrench
//import cofh.api.item.IToolHammer
//import cpw.mods.fml.common.FMLCommonHandler
//import mods.railcraft.api.core.items.IToolCrowbar
//import net.machinemuse.api.IModularItem
//import net.machinemuse.powersuits.powermodule.tool.{MFFSFieldTeleporterModule, OmniWrenchModule}
//import net.machinemuse.utils.ElectricItemUtils
//import net.minecraft.entity.item.EntityMinecart
//import net.minecraft.entity.player.EntityPlayer
//import net.minecraft.item.ItemStack
//import net.minecraft.util.ChatComponentText
//
///**
// * Author: MachineMuse (Claire Semple)
// * Created: 5:06 PM, 29/04/13
// */
//trait OmniWrench
//  extends IModularWrench
//  with IModularCrowbar
//  with ModularHammer
//  with ForceFieldManipulator {
//
//}
//
//trait IModularCrowbar extends IToolCrowbar {
//  def canWhack(player: EntityPlayer, crowbar: ItemStack, x: Int, y: Int, z: Int): Boolean = {
//    return ModuleManager.itemHasActiveModule(crowbar, OmniWrenchModule.MODULE_OMNI_WRENCH)
//  }
//
//  def onWhack(player: EntityPlayer, crowbar: ItemStack, x: Int, y: Int, z: Int) {
//    player.swingItem
//  }
//
//  def canLink(player: EntityPlayer, crowbar: ItemStack, cart: EntityMinecart): Boolean = {
//    return ModuleManager.itemHasActiveModule(crowbar, OmniWrenchModule.MODULE_OMNI_WRENCH)
//  }
//
//  def onLink(player: EntityPlayer, crowbar: ItemStack, cart: EntityMinecart) {
//    player.swingItem
//  }
//
//  def canBoost(player: EntityPlayer, crowbar: ItemStack, cart: EntityMinecart): Boolean = {
//    return ModuleManager.itemHasActiveModule(crowbar, OmniWrenchModule.MODULE_OMNI_WRENCH)
//  }
//
//  def onBoost(player: EntityPlayer, crowbar: ItemStack, cart: EntityMinecart) {
//    player.swingItem
//  }
//}
//
//// Buildcraft wrench
//trait IModularWrench
//  extends IToolWrench {
//
//  def canWrench(player: EntityPlayer, x: Int, y: Int, z: Int): Boolean = {
//    if (player.getCurrentEquippedItem != null && player.getCurrentEquippedItem.getItem.isInstanceOf[IModularItem]) {
//      return ModuleManager.itemHasActiveModule(player.getCurrentEquippedItem, OmniWrenchModule.MODULE_OMNI_WRENCH)
//    }
//    return false
//  }
//
//  def wrenchUsed(player: EntityPlayer, x: Int, y: Int, z: Int) {
//  }
//}
//
//// MFR wrench
//trait ModularHammer extends IToolHammer {
//  def isActive(stack: ItemStack): Boolean = ModuleManager.itemHasActiveModule(stack, OmniWrenchModule.MODULE_OMNI_WRENCH)
//}
//
//trait ForceFieldManipulator extends IFieldTeleporter {
//  def canFieldTeleport(player: EntityPlayer, stack: ItemStack, teleportCost: Int): Boolean = {
//    if (ModuleManager.itemHasModule(stack, MFFSFieldTeleporterModule.MODULE_FIELD_TELEPORTER)) {
//      if (ElectricItemUtils.getPlayerEnergy(player) > ModuleManager.computeModularProperty(stack, MFFSFieldTeleporterModule.FIELD_TELEPORTER_ENERGY_CONSUMPTION)) {
//        return true
//      }
//      else if (FMLCommonHandler.instance.getEffectiveSide.isServer)
//        player.addChatComponentMessage(new ChatComponentText("[Field Security] Could not teleport through forcefield. 20,000J is required to teleport."))
//    }
//    return false
//  }
//
//  def onFieldTeleportSuccess(player: EntityPlayer, stack: ItemStack, teleportCost: Int) {
//    ElectricItemUtils.drainPlayerEnergy(player, ModuleManager.computeModularProperty(stack, MFFSFieldTeleporterModule.FIELD_TELEPORTER_ENERGY_CONSUMPTION))
//  }
//
//  def onFieldTeleportFailed(player: EntityPlayer, stack: ItemStack, teleportCost: Int) {
//  }
//}