ResourcePackNoUpload 插件
一个 Minecraft 服务器工具,允许服务器管理员无需外部托管即可高效地管理和分发资源包。
快速开始
RNU 会在配置模板不存在时生成它们,但如果不进行额外更改则无法正常工作。 有两点很重要:定义资源包提供程序的端口,以及用于加载资源包的加载器。
定义端口
服务器配置文件:
- RNU 插件:
plugins/ResourcePackNoUpload/server.yml - RNU 模组:
config/resourcepacknoupload/server.yml
# 此服务器端口需要对玩家开放
port: 25008 # 选择一个对玩家开放的服务器端口。
# 提供给玩家的根地址,通常是
# `http://` + 服务器的公网 IP + `:` + 上面定义的端口。
# 示例:
# publicLinkRoot: "http://192.0.2.1:25008"
#
# 在大多数常见情况下,此字段无需设置,但对于基于 Pterodactyl 的
# 服务器,此字段是必需的。
publicLinkRoot:
# 向玩家发送资源包的方式。
sender:
type: # 这里是你的发送者类型。
# 其他发送者字段,每种类型都有各自的字段。
# 请参阅本文档末尾以获取更多信息。
创建资源包加载器
插件配置文件(可通过 /rnu reload 重载):
- RNU 插件:
plugins/ResourcePackNoUpload/config.yml - RNU 模组:
config/resourcepacknoupload/config.yml
# 纹理包加载器,每当 RNU 加载资源包时都会调用。
loader:
type: # 这里是你的加载器类型。
# 其他加载器字段,每种类型都有各自的字段。
可用类型:
ReadFolder 从文件夹简单加载
使用提供的路径中的现有文件夹。 type: ReadFolder
# 相对于服务器根文件夹。
# 在此示例中,资源包文件应位于 `Cool Folder` 内。
# Cool Folder/pack.mcmeta
# Cool Folder/assets/minecraft...
folder: "rnu resource pack/Cool Folder/"
ReadZip 从压缩的资源包简单加载
使用提供的路径中的现有 .zip 文件。 type: ReadZip
# 相对于服务器根文件夹。
# 在此示例中,资源包文件应位于 `Cool Resource Pack.zip` 内。
# Cool Resource Pack.zip/pack.mcmeta
# Cool Resource Pack.zip/assets/minecraft...
zip: "rnu resource pack/Cool Resource Pack.zip"
Download 从网络下载,支持 HTTP 头
从链接下载资源包。 起初这似乎与 RNU 的目的相悖,但该加载器还支持下载请求的 HTTP 头,允许你下载带有私钥的资源包,这是 Minecraft 客户端不支持直接下载的。 type: Download
# 可选字段,这将缓存下载结果,确保只要能在 tempFolder 中找到此缓存文件,就不会再次执行下载。
cacheName: drive_private_pack # 任意名称,将用于保存文件。
# 下载的链接。
url: https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media
# 可选字段,这是一个包含键和值的头部列表。在这里我们调用 Google API,并传递所需的令牌以下载文件。
headers:
- key: "Authorization"
value: "Bearer drive_api3213xih32i9DASKxE83hd9203f1930c0ll-d1v3-t0k3n2389"
WithMovedFiles 修改来自其他加载器的文件
将加载器提供的资源包文件从一个目录移动到另一个目录。 type: WithMovedFiles
# 要移动的文件夹内容。支持未知路径,因为它们使用 `?`。
# 在此示例中,下载(见下方更多加载器信息)对于加载器链接的结果将是类似这样的:
# `Robsutar-super-cool-pack78HN3278gj32d/assets/minecraft...`
# 我们将使用这个第一个文件夹作为源,忽略其名称。
folder: "?/"
# 文件夹目标位置,这里我们使用资源包根目录。
destination: ""
# 这可以是任何加载器。在此加载器示例中,我们使用的是 GitHub 上的发布版本,
# 使用细粒度个人访问令牌,具有读取权限。根据发布版本的不同,资源包的内容可能位于另一个下载文件中,
# 我们使用 WithMovedFiles 来调整这一点。
loader:
type: Download
url: https://api.github.com/repos/Robsutar/super-cool-pack/zipball
headers:
- key: "Authorization"
value: "Bearer github_pat_uS78ih32i9DASKxE83hd9203f1930c0ll-g1t-t0k3n2389"
- key: "Accept"
value: "application/vnd.github.v3+json"
WithDeletedFiles 修改来自其他加载器的文件
如果文件匹配提供的路径,则忽略加载器的文件。 type: WithDeletedFiles
# 要忽略的路径,支持 glob 文件匹配。在此示例中,我们删除所有以 `.md` 结尾的文件。
toDelete: "**.md"
# 要忽略目录中的所有文件:
# toDelete: "assets/all_inside_me_will_be_deleted/**/*"
# 要忽略单个文件:
# toDelete: "assets/minecraft/i_will_be_deleted.txt"
# 这可以是任何加载器。在此加载器示例中,我们使用的是简单的 ReadFolder 加载器。
loader:
type: ReadFolder
folder: "rnu resource pack/Cool Folder/"
Merged 从加载器列表加载并合并资源包
组合多个加载器,优先处理列表中的前几个。 type: Merged
# 可选字段,这是一个用于合并 json 文件列表条目的路径列表,特别适用于自动合并自定义模型数据。
mergedJsonLists:
- files: "assets/minecraft/models/item/**.json"
# 用于对 json 条目进行排序的数值字段,在自定义模型数据的情况下,
# 条目必须按顺序排列。
orderBy: "predicate.custom_model_data"
# 这是一个列表,对于每个条目,你需要指定所需加载器的值。
# 请参阅上面的示例了解如何配置每种类型。
# 对于覆盖情况,位于列表顶部的加载器具有更高的优先级,也就是说,
# 它们的文件将替换其他文件。
loaders:
- type: ReadFolder
folder: "rnu resource pack/Cool Folder/"
- type: ReadZip
zip: "plugins/ModelEngine/resource pack.zip"
自动重载
可以让 RNU(仅限插件)在事件调用时自动重载。
如何配置它
自动重载配置文件:`plugins/ResourcePackNoUpload/autoReloading.yml`invokers:
# 事件类,这非常具体于每种情况。
# 这里我们将使用 ModelEngine 事件。
- eventClass: "com.ticxo.modelengine.api.events.ModelRegistrationEvent"
# 事件被调用后的延迟刻数。
delay: 10 # 默认为 1。
# 此事件再次调用重载之前的冷却时间。
# 这里添加冷却时间是因为在 `/meg reload` 的情况下,
# `ModelRegistrationEvent` 事件会被调用多次,
# 这个冷却时间将使重载只执行一次。
repeatCooldown: 10 # 默认为 0。
不同的发送者
默认情况下,使用的是 Delayed 发送者,它适用于大多数情况。
在 PaperMC 服务器上使用注入器
注意:实验性功能服务器配置文件:plugins/ResourcePackNoUpload/server.yml
sender:
# 此发送者将在运行时覆盖服务器的资源包属性,
# 将包发送处理交给 PaperMC。
type: PaperPropertyInjector
不自动发送 URL,并使用固定链接
服务器配置文件:`plugins/ResourcePackNoUpload/server.yml`sender:
# 此发送者不会自动向玩家发送资源包 URL,
# 并且将有一个固定的链接。
# 如果你想通过原版行为发送资源包,
# 例如将 server.properties 中的 resource-pack 设置为该链接,这会很有用。
type: NoSenderFixedLink
# 使用 "pack" 路由,链接将是类似这样的格式:"http://192.0.2.1:25008/pack.zip"
# 但使用配置中定义的 ip 和端口 `publicLinkRoot`
route: "pack"
其他配置
config.yml 中还有其他设置,例如消息和 RNU 的行为,请参考自动生成的 config.yml。
ResourcePackNoUpload Plugin
A Minecraft server tool that allows server administrators to manage and distribute resource packs efficiently without requiring external hosting.
Getting Started
The RNU will generate the configuration templates if they do not exist, but will not work without additional changes. Two things are important: defining the port for the resource pack provider, and the loader to load the resource pack.
Defining port
The server config:
- For RNU plugin:
plugins/ResourcePackNoUpload/server.yml - For RNU mod:
config/resourcepacknoupload/server.yml
# This server port needs to be open to the players
port: 25008 # Chose an open server port for the players.
# Provide the root address that will be sent to players, usually
# `http://` + server's public IP + `:` + port defined above.
# Example:
# publicLinkRoot: "http://192.0.2.1:25008"
#
# For the most common cases, this field does not need to be set, but for Pterodactyl-based
# servers this field is mandatory.
publicLinkRoot:
# The approach of sending the resource pack for the players.
sender:
type: # Here is your sender type.
# Additional sender fields, each type has their own fields.
# See the end of this document for more information.
Creating resource pack loader
The plugin config (reloadable with /rnu reload):
- For RNU plugin:
plugins/ResourcePackNoUpload/config.yml - For RNU mod:
config/resourcepacknoupload/config.yml
# The texture pack loader, called every time that the resource pack is loaded by the RNU.
loader:
type: # Here is your loader type.
# Additional loader fields, each type has their own fields.
Available types:
ReadFolder simple loading from folder
Uses an existing folder of any provided path. type: ReadFolder
# Relative to the server root folder.
# Is inside `Cool Folder` (for this example) the resource pack files should be.
# Cool Folder/pack.mcmeta
# Cool Folder/assets/minecraft...
folder: "rnu resource pack/Cool Folder/"
ReadZip simple loading from zipped resource pack
Uses an existing .zip of any provided path. type: ReadZip
# Relative to the server root folder.
# Is inside `Cool Resource Pack.zip` (for this example) the resource pack files should be.
# Cool Resource Pack.zip/pack.mcmeta
# Cool Resource Pack.zip/assets/minecraft...
zip: "rnu resource pack/Cool Resource Pack.zip"
Download downloads from web, with http headers
Downloads the resource pack from a link. At first, it would be somewhat against the RNU purpose, but this loader also supports http headers for the download request, allowing you to download the resource, pack with private keys, which is not supported directly by the minecraft client. type: Download
# Optional field, this will cache the download, making sure the download is not
# done again as long as this cache file can be found in the tempFolder.
cacheName: drive_private_pack # Arbitrary name, will be used to save the file.
# The link for the download.
url: https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media
# Optional field, this is a list of headers, with their keys and values, Here we
# are calling the Google API, and passing a required token to download the file.
headers:
- key: "Authorization"
value: "Bearer drive_api3213xih32i9DASKxE83hd9203f1930c0ll-d1v3-t0k3n2389"
WithMovedFiles modify the files from another loader
Move loader provided resource pack files from a directory, to another. type: WithMovedFiles
# The folder contents to be moved. Supports unknown paths, for they use `?`.
# For this example, the download (see more loader information below) result for
# the loader link would be something like:
# `Robsutar-super-cool-pack78HN3278gj32d/assets/minecraft...`
# We will use this first folder as origin, ignoring their name.
folder: "?/"
# The folder destination, here we are using the resource pack root.
destination: ""
# This can be any loader, For this loader example we are using a release in GitHub,
# with Fine-grained personal access token, with reading permissions. Depending on
# the release, the content of the resource pack can be inside another download file,
# we use WithMovedFiles to adjust this.
loader:
type: Download
url: https://api.github.com/repos/Robsutar/super-cool-pack/zipball
headers:
- key: "Authorization"
value: "Bearer github_pat_uS78ih32i9DASKxE83hd9203f1930c0ll-g1t-t0k3n2389"
- key: "Accept"
value: "application/vnd.github.v3+json"
WithDeletedFiles modify the files from another loader
Ignore the files of the loader if they match with a provided path. type: WithDeletedFiles
# The path to ignored, supports glob file matching. In this example, we delete all
# files that ends with `.md`.
toDelete: "**.md"
# To ignore all the files of a directory:
# toDelete: "assets/all_inside_me_will_be_deleted/**/*"
# To ignore a file a file:
# toDelete: "assets/minecraft/i_will_be_deleted.txt"
# This can be any loader, For this loader example we are using simple ReadFolder loader.
loader:
type: ReadFolder
folder: "rnu resource pack/Cool Folder/"
Merged loads and merges resource packs from a list of loaders
Combines multiple loaders, prioritizing the first ones in the list. type: Merged
# Optional field, this is a list of paths to merge json files list entries, particularly
# useful to merge custom model data automatically.
mergedJsonLists:
- files: "assets/minecraft/models/item/**.json"
# The numeric field used to order the json entries, in the case of custom model data,
# entries must necessarily be ordered.
orderBy: "predicate.custom_model_data"
# This is a list, for each entry you need to specify the values of the desired loader.
# See their how to configure each type in the examples above.
# For overriding cases, loaders on the top of the list have major priority, this is,
# their files will replace the other files.
loaders:
- type: ReadFolder
folder: "rnu resource pack/Cool Folder/"
- type: ReadZip
zip: "plugins/ModelEngine/resource pack.zip"
Auto reloading
It is possible to make the RNU (only the plugin) reload automatically on event call.
How to configure it
The auto reloading config: `plugins/ResourcePackNoUpload/autoReloading.yml`invokers:
# The event class, this is very specific to each case.
# Here we will use a ModelEngine event.
- eventClass: "com.ticxo.modelengine.api.events.ModelRegistrationEvent"
# The delay in ticks after the event being called.
delay: 10 # Default is 1.
# The cooldown before this event can call the reload again.
# Here we add a cooldown because in the case of ModelEngine, the
# `ModelRegistrationEvent` event is called a few times in `/meg reload`, this
# cooldown will make the reload be executed only once.
repeatCooldown: 10 # Default is 0.
Different sender
By default, the Delayed sender is used, and it works for most cases.
Using the injector on the PaperMC server
NOTE: Experimental featureThe server config: plugins/ResourcePackNoUpload/server.yml
sender:
# This sender will override in runtime the server resource pack properties,
# leaving the pack sending handling for the PaperMC.
type: PaperPropertyInjector
No automatic url sending, and fixed link server
The server config: `plugins/ResourcePackNoUpload/server.yml`sender:
# This sender will not send the resource pack url to the players automatically,
# and will have a fixed link.
# Useful if you want to send the resource pack through the vanilla behavior,
# setting the resource-pack server.properties to this link for example.
type: NoSenderFixedLink
# With the "pack" route, the link would be something like: "http://192.0.2.1:25008/pack.zip"
# But with the ip and port defined in the config `publicLinkRoot`
route: "pack"
Additional Configurations
There are other settings inside config.yml, such as messages and RNU behavior, refer to the automatically generated config.yml.
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ResourcePackNoUpload
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
版本 1.16.2
- 自动推送 README(2)#87
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧