本项目已暂停,直到另行通知为止,推荐使用 Better Server Packs (Fabric)。
你(可能)仍然可以在 1.20.2+ 版本中使用此版本
Better Server Packs (BSP)
Better Server Packs 是一个旨在取代令人头疼的原版服务器资源包实现的模组。它通过自行计算资源包的 sha1 哈希值并将其保存到文件中以实现缓存功能来达成这一目标。
原版服务器资源包有什么问题?
目前服务器资源包面临的问题是,所有关于它们的配置(包括哈希值)都存储在 server.properties 文件中。虽然从技术上讲哈希值对于服务器来说是可选的,但不使用哈希值会导致在更新资源包时出现各种奇怪的问题,从而导致客户端无法更新资源包。
另一方面,使用哈希值则要求每次更新资源包后重启服务器,而且计算哈希值也很麻烦。(通常工具生成的文件哈希值是不正确的。)
BSP 如何解决这个问题?
BSP 通过实现自己的逻辑来消除对服务器重启的需求,从而实质上取代了原版系统。BSP 还自行计算哈希值,解决了寻找功能正常的哈希生成器的问题,并提高了易用性。
BSP 通过一个新的 /pack 命令为管理员提供了一个简单且响应迅速的命令界面,通过该命令可以修改和使用插件的所有按需功能。
BSP 还支持缓存资源包哈希值以提高启动速度。
命令
BSP 为你的服务器添加了一个新命令 /pack,其命令树如下:
这些子命令具有以下功能。
set
/pack set [<url>]
此命令设置服务器资源包的 URL。只需将包的 URL 作为参数传递即可。不传递任何参数将不会设置任何资源包,从而有效地禁用该插件。
请注意,这遵循与普通服务器资源包相同的限制。链接必须是“直链”,即不能指向网页,而必须直接指向文件本身。
reload
/pack reload [push]
重新计算资源包哈希值。应在更新资源包后调用此命令,以确保新玩家能正确接收该包。重启服务器后无需执行此操作。将 "push" 作为参数传递将为所有活跃玩家更新资源包。
重新加载资源包是异步进行的,因此即使在边缘情况下,也不会影响服务器性能。
权限
BSP 实现了总共四个权限来控制命令的使用。这些权限可以通过 LuckPerms 等权限插件进行修改,没有问题。
实现了以下权限:
betterserverpack:
- 控制所有命令的使用。禁用此权限将禁用通过此插件管理的所有命令的访问权限。
- 默认:仅限操作员
betterserverpack.set:
- 控制对
set 子命令的访问权限。
- 默认:仅限操作员
betterserverpack.reload
This project has been discontinued until further notice in favour of Better Server Packs (Fabric).
You can (probably) still use this version for 1.20.2+
Better Server Packs (BSP)
Better Server Packs is a project that aims to replace the oftentimes annoying
vanilla implementation of Server Resourcepacks. It does this by calculating the
resourcepack's sha1-hash itself, saving it in a file for caching.
What is wrong with Server Resourcepacks?
The issue Server Resourcepacks face currently is that all config about them
(including the hash) is stored in the server.properties file. Although hashes are
technically optional for servers, not using one will cause all sorts of
weirdness when updating the resourcepack resulting in packs not updating on the
client.
Using a hash on the other hand, requires a server restart for every update of
the resourcepack and hashes are also a pain to compute.
(Often tools will generate incorrect hashes for a file.)
How does BSP solve this problem?
BSP removes the need for server restarts by implementing its own logic
essentially replacing the vanilla system. BSP also calculates the hash on its
own solving the issue of finding a functional hash generator and increasing
ease of use.
BSP provides a simple and responsive command interface for operators through
a new /pack command through which all on-demand functionalities of the plugin
can be modified and used.
BSP also allows caching of the resource pack hash to increase boot times.
Commands
BSP adds one new command /pack to your server with the following command tree:
These subcommands serve the following functions.
set
/pack set [<url>]
This command sets the url of the server resourcepack. Simply pass the URL of the
pack as an argument. Passing no argument will set no resourcepack, effectively
disabling the plugin.
Note that this follows the same restrictions as a regular server resourcepack.
The link must be "direct", meaning it cannot lead to a webpage, but must lead to
the file itself.
reload
/pack reload [push]
Recalculates the resourcepack hash. This should be called after updating the
resourcepack to ensure new players can receive the pack correctly. This is not
necessary after restarting the server. Passing "push" as an argument will update the resourcepack for all active
players.
Reloading the resourcepack is done asynchronously, doing will, disregarding edge
cases, not impact server performance.
Permissions
BSP implements four total permissions to regulate usage of the commands. These
can be modified through permission plugins like LuckPerms without issue.
The following permissions are implemented:
betterserverpack:
- Controls usage of all commands. Disabling this permission will disable
access to all commands moderated by this plugin.
- Default: Operator Only
betterserverpack.set:
- Controls access to the
set subcommand.
- Default: Operator Only
betterserverpack.reload
- Controls access to the
reload subcommand.
- Default: Operator Only
评论 0
登录后参与评分
还没有评论,来抢沙发吧