List of usage examples for net.minecraftforge.fml.network NetworkHooks openGui
public static void openGui(ServerPlayerEntity player, INamedContainerProvider containerSupplier, Consumer<PacketBuffer> extraDataWriter)
From source file:com.teambrmodding.assistedprogression.common.block.BaseBlock.java
License:Creative Commons License
/** * Called when block is clicked, we will be using this to show the gui *///from www. j av a2s . c o m public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof INamedContainerProvider) { INamedContainerProvider grinder = (INamedContainerProvider) tileentity; NetworkHooks.openGui((ServerPlayerEntity) player, grinder, pos); } return true; } }