2013-12-27 23:59:59 +01:00
|
|
|
package appeng.items.tools.quartz;
|
|
|
|
|
|
|
|
import java.util.EnumSet;
|
|
|
|
|
2014-03-07 04:02:15 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-03-07 04:02:15 +01:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
|
|
|
import appeng.api.implementations.guiobjects.IGuiItem;
|
|
|
|
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.features.AEFeature;
|
2014-03-07 04:02:15 +01:00
|
|
|
import appeng.core.sync.GuiBridge;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.items.AEBaseItem;
|
2014-03-07 04:02:15 +01:00
|
|
|
import appeng.items.contents.QuartzKnifeObj;
|
|
|
|
import appeng.util.Platform;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-03-07 04:02:15 +01:00
|
|
|
public class ToolQuartzCuttingKnife extends AEBaseItem implements IGuiItem
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
public ToolQuartzCuttingKnife(AEFeature type) {
|
|
|
|
super( ToolQuartzCuttingKnife.class, type.name() );
|
|
|
|
setfeature( EnumSet.of( type, AEFeature.QuartzKnife ) );
|
|
|
|
setMaxDamage( 50 );
|
|
|
|
setMaxStackSize( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isRepairable()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean hasContainerItem()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-03-07 04:02:15 +01:00
|
|
|
@Override
|
|
|
|
public ItemStack onItemRightClick(ItemStack it, World w, EntityPlayer p)
|
|
|
|
{
|
|
|
|
if ( Platform.isServer() )
|
|
|
|
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
|
|
|
|
p.swingItem();
|
|
|
|
return it;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onItemUse(ItemStack is, EntityPlayer p, World w, int x, int y, int z, int s, float hitx, float hity, float hitz)
|
|
|
|
{
|
|
|
|
if ( Platform.isServer() )
|
|
|
|
Platform.openGUI( p, null, ForgeDirection.UNKNOWN, GuiBridge.GUI_QUARTZ_KNIFE );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
2014-02-09 02:34:52 +01:00
|
|
|
public ItemStack getContainerItem(ItemStack itemStack)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
itemStack.setItemDamage( itemStack.getItemDamage() + 1 );
|
|
|
|
return itemStack;
|
|
|
|
}
|
|
|
|
|
2014-03-07 04:02:15 +01:00
|
|
|
@Override
|
|
|
|
public IGuiItemObject getGuiObject(ItemStack is, World world, int x, int y, int z)
|
|
|
|
{
|
|
|
|
return new QuartzKnifeObj( is );
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|