InlineHeads
要求
- Java 21+
- Paper 或 Folia 1.21.4+
警告: 此插件需要客户端安装资源包。如果未安装该资源包,客户端将无法连接到服务器。使用默认配置时,资源包会自动下载,但高级用户也可以在此处找到它 这里。
描述
InlineHeads 仅启用在聊天或任何支持文本组件的地方(如计分板、动作栏和标题)中使用玩家头颅。
以下是它在聊天中的显示示例:

看到我名字旁边的那个头颅了吗?那是我的水豚皮肤的头颅,全分辨率,仅占一行聊天内容。
快速开始(服务器管理员)
如果不使用 MiniPlaceholders,此插件将不会提供任何功能。安装 MiniPlaceholders 和 InlineHeads,只需将 jar 文件放入服务器的 plugins 文件夹并重启服务器即可。
要在文本中使用玩家的头颅,请使用以下占位符格式:<player_head:[玩家名称]>,
其中 [玩家名称] 是您想要显示头颅的玩家的名字。例如,要像上图那样显示我的头颅,您需要使用 <player_head:BlameBert>。
插件会自动为您下载并安装资源包。
该资源包与其他服务器强制使用的资源包兼容,因此您可以将 InlineHeads 与需要资源包的其他插件一起使用。
快速开始(开发者)
Maven 用户:
仓库:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
依赖项:
<dependency>
<groupId>com.github.BertTowne</groupId>
<artifactId>InlineHeads</artifactId>
<version>v1.1.1</version>
</dependency>
Gradle 用户:
仓库:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
依赖项:
dependencies {
implementation 'com.github.BertTowne:InlineHeads:v1.1.1'
}
InlineHeads 使用 Google 的 Guice 依赖注入系统,因此要获取 InlineHeadsService 的实例,您可以在定义类变量的位置放置以下代码:
@Inject private InlineHeadsService inlineHeadsService;
然后您可以使用该服务来获取包含玩家头颅的 Component:
Component head = inlineHeadsService.getHead(playerName);
警告: 此方法会访问 Minotar API,因此建议谨慎使用,并且必须异步执行以避免阻塞主线程。
从 Minotar API 检索到的图像会在最后一次被访问后的 10 分钟内被缓存,因此如果您需要多次获取相同的头颅,它不会向 API 发出多次请求。
它是如何工作的?
InlineHeads 使用了一些自定义字体来实现这种效果:
虽然插件会按正确的顺序放置像素,但它会根据 Minotar API 按照玩家皮肤的配色方案对它们进行着色。
InlineHeads
Requirements
- Java 21+
- Paper or Folia 1.21.4+
WARNING: This plugin REQUIRES a resource pack to be installed on the client. If the resource pack is not installed, the client will not be able to connect to the server. With the default configuration the resource pack will be automatically downloaded, but it can also be found here for more advanced users.
Description
InlineHeads simply enables the use of player heads in chat or anywhere else that supports text components, such as scoreboards, action bars, and titles.
Here is an example of how it looks in chat:

See that head next to my name? That's my capybara skin's head, in full resolution, in a single line of chat.
Getting Started (Server Admins)
This plugin will not provide any functionality without the use of MiniPlaceholders. Install MiniPlaceholders and InlineHeads by placing the jar files in your server's plugins folder and restarting the server.
To use a player's head in text, use the following placeholder format: <player_head:[player name]>,
where [player name] is the name of the player whose head you want to display. For example, to display my head like in the image above, you would use <player_head:BlameBert>.
The plugin will automatically download the resource pack and install it for you.
The resource pack is compatible for use with other server-enforced resource packs, so you can use InlineHeads alongside other plugins that require a resource pack.
Getting Started (Developers)
Maven Users:
Repository:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Dependency:
<dependency>
<groupId>com.github.BertTowne</groupId>
<artifactId>InlineHeads</artifactId>
<version>v1.1.1</version>
</dependency>
Gradle Users:
Repository:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Dependency:
dependencies {
implementation 'com.github.BertTowne:InlineHeads:v1.1.1'
}
InlineHeads uses Google's Guice dependency injection system so to get an instance of the InlineHeadsService, you can place the following code where you define your class variables:
@Inject private InlineHeadsService inlineHeadsService;
Then you can use the service to get a Component that contains a player's head:
Component head = inlineHeadsService.getHead(playerName);
WARNING: This method accesses the Minotar API, so it is recommended to use it sparingly and MUST BE DONE ASYNCHRONOUSLY to avoid blocking the main thread.
The images retrieved from the Minotar API are cached for 10 minutes after their last time being accessed, so if you need to get the same head multiple times, it will not make multiple requests to the API.
How does it work?
InlineHeads uses a couple of custom fonts to achieve this effect:
- Pixelized, a font created by me specifically for this plugin that provides the individual pixels required to render the heads.
- NegativeSpaceFont, a font created by AmberWat that provides the spacing required to organize the pixels into player heads.
While the plugin places the pixels in the correct order, it colors them based on the player's skin according to the Minotar API.
评论 0
登录后参与评分
还没有评论,来抢沙发吧