List of usage examples for net.minecraftforge.fml.network NetworkHooks openGui
public static void openGui(ServerPlayerEntity player, INamedContainerProvider containerSupplier)
From source file:com.teambrmodding.assistedprogression.common.item.TrashBagItem.java
License:Creative Commons License
/** * Called when this item is right clicked *///from www .j a v a2 s . c om @Override public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) { if (!world.isRemote && hand == Hand.MAIN_HAND && player.getHeldItem(hand).getItem() instanceof TrashBagItem) { NetworkHooks.openGui((ServerPlayerEntity) player, (TrashBagItem) player.getHeldItem(hand).getItem()); return new ActionResult<>(ActionResultType.SUCCESS, player.getHeldItem(hand)); } return super.onItemRightClick(world, player, hand); }