ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrafterOnAStick.java
2016-06-01 00:39:36 +02:00

45 lines
1.5 KiB
Java

/*
* This file ("ItemCrafterOnAStick.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
public class ItemCrafterOnAStick extends ItemBase{
public ItemCrafterOnAStick(String name){
super(name);
this.setMaxStackSize(1);
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){
if(!world.isRemote){
player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
}
@Override
public EnumRarity getRarity(ItemStack stack){
return EnumRarity.EPIC;
}
}