Search in sources :

Example 1 with ContainerKeyring

use of net.mcft.copy.betterstorage.container.ContainerKeyring in project BetterStorage by copygirl.

the class ItemKeyring method onItemRightClick.

@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
    if (world.isRemote || !player.isSneaking())
        return stack;
    String title = StackUtils.get(stack, "", "display", "Name");
    int protectedSlot = player.inventory.currentItem;
    Container container = new ContainerKeyring(player, title, protectedSlot);
    PlayerUtils.openGui(player, Constants.containerKeyring, protectedSlot, 1, title, container);
    return stack;
}
Also used : Container(net.minecraft.inventory.Container) ContainerKeyring(net.mcft.copy.betterstorage.container.ContainerKeyring)

Aggregations

ContainerKeyring (net.mcft.copy.betterstorage.container.ContainerKeyring)1 Container (net.minecraft.inventory.Container)1