• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

youtube/youtube-chat-for-minecraft: A plugin for Minecraft Forge that provides a ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

youtube/youtube-chat-for-minecraft

开源软件地址(OpenSource Url):

https://github.com/youtube/youtube-chat-for-minecraft

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

YouTube Chat for Minecraft

A plugin for Minecraft Forge that provides an API for YouTube live chat services. This is not an official Google product.

Features

  • Broadcasts live chat messages to multiple clients from a single network connection
  • Provides author details (channelId, displayName, isChatModerator, isChatOwner isChatSponser, profileImageUrl) and SuperChat details
  • In-game configuration

Workspace setup

Clone this repository, and open a terminal to the root directory. Navigate to http://files.minecraftforge.net and pick the latest or recommened MDK version. Update the mdkVersion definition in setup.gradle, then run the installMdk task:

./gradlew -b setup.gradle

Next, setup the decompiled workspace and save the build dependencies:

./gradlew setupDecompWorkspace
./gradlew saveDependencies

Build the jar:

./gradlew build

A single .jar file will be output to build/libs, e.g. ytchat-1.0.0.jar.

Intellij Idea Setup

If you have Intellij Idea installed and plan to use it for development, perform these steps to setup the project directory.

  1. Run the following gradle task:
./gradlew idea
  1. Open the project folder with Intellij, and import the Gradle project when prompted.
  2. Make sure you have the 1.8 JDK configured (File->Project Structure->SDKs).
  3. Select Run->Edit Configurations:
  • There should be two configurations - Minecraft Client and Minecraft Server.
  • Edit the Minecraft Client configuration.
  • Go to the Use classpath of a module field
  • Select the module ending with _main.
  • Ensure a valid JRE is selected.
  1. Run the Minecraft Client configuration. Minecraft should open. You may Debug as well.

Installation

Copy the YouTube Chat jar to one these folders depending on your OS:

  • Linux: ~/.minecraft/mods
  • OSX: ~/Library/Application\ Support/minecraft/mods/
  • Windows: %APPDATA%/Minecraft/mods

Obtaining Credentials

  1. Create a project in the Google API Console

  2. Click Create credentials. Select OAuth client ID from the dropdown, followed by Other for the Application type.

  3. Open the API Library and ensure that your application is registered to use the YouTube Data API.

  4. Download the client ID JSON by clicking the following icon for your project: Download json

  5. Run the YouTube Chat jar from a terminal to obtain authorization credentials, pasting the downloaded json when prompted:

java -jar ytchat-1.0.3.jar login

If you want to clear your credentials or sign in as a different user, run logout:

java -jar ytchat-1.0.3.jar logout

Credentials are saved to ~/.oauth-credentials.

Configuration

Configuration

  1. With YouTube Chat installed, open Minecraft with the forge profile.
  2. At the Minecraft main menu, select Mods.
  3. Select YouTube Chat, and click Config. There are 2 settings:
  • Client Secret: (Required) The client secret json downloaded from the Google API Console
  • videoId: (Optional) A videoId associated with the live broadcast to connect to. If blank, will attempt to connect to the signed in user's live broadcast (a Google sign-in dialog will appear when starting YouTube Chat).

Runtime Usage

YouTube Chat supports the following commands in Minecraft:

/ytchat [start|stop|logout|echoStart|echoStop]
  • start: Starts the YouTube Chat service, connecting to the live chat of the signed in user.
  • stop: Stops the YouTube Chat service.
  • logout: Stops the YouTube Chat service and clears saved credentials.
  • echoStart: Starts echoing chat messages into Minecraft chat, for troubleshooting.
  • echoStop: Stops echoing chat messages into Minecraft chat.
/ytcmock <mock author id/name> <mock input>

Provides mock input for testing without a YouTube live chat connection.

API

To use YouTube Chat, copy the jar into the libs folder of your Forge directory. Regenerate the project with gradle, or manually add a dependency to the jar in the project settings.

Add ytchat to the dependencies field in mcmod.info, e.g.:

"dependencies": ["ytchat"]

Get an instance of the YouTubeChatService interface:

YouTubeChatService service = YouTubeChat.getService();

Discussion and Support

Join the discussion group at https://groups.google.com/forum/#!forum/youtube-chat-for-minecraft




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap