客户端画作 
Client Paintings 是一个简单的、完全在客户端运行的模组,它通过资源包添加新的画作,同时保持原版画作完好无损。
它通过查看画作实体的 UUID 并应用伪随机算法来确定渲染哪幅画作来实现这一功能。
此模组使用自定义的资源包格式来添加新画作,
你可以使用我网站上的 Client Paintings Pack Generator
轻松生成这样的资源包。或者,请参阅下面的资源包格式部分以获取技术说明。
功能
- 通过资源包添加多组新的画作
- 保持原版画作完好无损
- 当展示原版画作时,它将与非模组玩家看到的原版画作一致
- 展示自定义画作时,将与拥有该模组的其他玩家看到的自定义画作一致
- 自定义画作在重新登录和服务器重启之间完全持久化
注意事项
- 只有当双方都使用完全相同的画作集时,自定义画作才能在玩家之间保持一致
- 画作集必须通过自定义资源包格式添加,详情请见下文
示例
使用包含的默认资源包:
非模组玩家看到的内容:
资源包格式
资源包格式非常简单。它由位于资源包命名空间根目录下的单个 client_paintings 文件夹组成(例如 assets/<namespace>/client_paintings)。
在此文件夹内,你可以放置任意数量的 json 文件,每个文件代表一幅自定义画作。
每个 json 文件必须具有以下结构:
{
"texture": "<namespace>:client_paintings/painting_texture",
"back": "<namespace>:client_paintings/painting_back_texture",
"size": [2, 1]
}
texture 是画作的纹理,它必须是一个 png 图像,其比例需与 size 字段匹配,
且宽度和高度都必须是 16 的倍数。纹理必须位于
assets/<namespace>/textures/client_paintings 文件夹内。
back 是画作背面的纹理,它必须是一个正方形 png 图像,同样地,其宽度和高度
也必须是 16 的倍数。
size 是以方块为单位的画作尺寸,第一个值是宽度,第二个值是高度。
请注意,由于需要替换原版画作,仅支持 1x1、1x2、2x1、2x2、4x2、4x4 和 4x3 尺寸的画作。
一个示例资源包结构如下所示:
pack.mcmeta
assets
└── namespace
├── textures
│ └── client_paintings
│ ├── painting1.png
│ ├── painting2.png
│ ├── painting3.png
│ └── backs
│ ├── back1.png
│ └── back2.png
└── client_paintings
├── painting1.json
├── painting2.json
└── painting3.json
包含的默认包的源代码可以轻松浏览
这里。
Client Paintings 
Client Paintings is a simple, fully client-side mod to add
new paintings via resource packs while keeping the vanilla paintings intact.
It achieves this by looking at the UUID of the painting entity and
applying a pseudo-random algorithm to it to determine which painting to render.
This mod uses a custom resource pack format to add new paintings,
you can use the Client Paintings Pack Generator on my website
to generate such a pack easily. Alternatively, see the resource pack format section below for technical instructions.
Features
- Add multiple new sets of paintings via resource packs
- Keep the vanilla paintings intact
- When a vanilla painting is shown, it will match the vanilla painting seen by players without the mod
- Custom paintings shown will match the custom paintings seen by other players with the mod
- Custom paintings are fully persistent between relogs and server restarts
Caveats
- Custom paintings will only match up between players if they both use the exact same painting sets
- Painting sets have to be added via a custom resource pack format, see below for details
Example
With the included default resource pack:
What vanilla players see:
Resource pack format
The resource pack format is very simple. It consists of a single client_paintings folder
located in the root of your resource pack namespace (e.g. assets/<namespace>/client_paintings).
Inside this folder, you can place any number of json files, each representing a custom painting.
Each json file must have the following structure:
{
"texture": "<namespace>:client_paintings/painting_texture",
"back": "<namespace>:client_paintings/painting_back_texture",
"size": [2, 1]
}
texture is the texture of the painting, it must be a png image with a ratio matching the size field,
with width and height both being a multiple of 16. The texture has to be located within
the assets/<namespace>/textures/client_paintings folder.
back is the texture of the back of the painting, it must be a square png image with similarly, a width and height
being a multiple of 16.
size is the size of the painting in blocks, the first value is the width, the second value is the height.
Do note only 1x1, 1x2, 2x1, 2x2, 4x2, 4x4, and 4x3 size paintings are supported due to the need to replace
a vanilla painting.
An example resource pack structure would look as follows:
pack.mcmeta
assets
└── namespace
├── textures
│ └── client_paintings
│ ├── painting1.png
│ ├── painting2.png
│ ├── painting3.png
│ └── backs
│ ├── back1.png
│ └── back2.png
└── client_paintings
├── painting1.json
├── painting2.json
└── painting3.json
The source for the default included pack can be easily browsed
here.
评论 0
登录后参与评分
还没有评论,来抢沙发吧