DynRes 使用内置的 Web 服务器,直接从服务器目录提供资源包。 它还会修改服务器配置,将该资源包设置为默认值(覆盖 server.properties 中的 resource-pack 和 resource-pack-sha1)。 你可以在配置文件中设置 Web 服务器的端口、托管的文件以及是否提供哈希值。
要在你的服务器上使用该模组,你需要将资源包放入配置好的位置(默认路径:server/resources.zip), 并将配置文件中的 baseLink 更改为你的公网地址(玩家需要输入的地址)。
此模组仅在服务器上需要。如果将其添加到客户端,它只会记录一些关于服务器连接的信息。
配置
最近有一位用户联系我,询问如何配置该模组以适配他的服务器。 以下是我稍作修改后的回复,添加在这里,希望能帮助到其他遇到类似问题的人。DynRes 的资源包托管功能实际上是由一个通用库提供的,即 libjf-web-v1。 因此,实际的托管配置需要在那里进行。
还需要注意的是,如果你想使用与 Minecraft 相同的端口来托管资源包,libjf-web-v1 会将接收逻辑委托给 libjf-mainhttp-v0。 不幸的是,这意味着配置文件分散在两个文件中,而且由于 libjf-web 是一个更通用的库,它的配置提供了许多对 DynRes 来说不相关的额外功能。 我会尝试在这里解释一种可行的设置方法,但如果你有任何进一步的问题或请求,请随时提出。
首先,DynRes 中的 resourcesFile 应该是被托管的资源包的相对路径。
选项 hashResources 会为客户端提供一个校验和,客户端可以使用它来缓存资源包,从而提高性能。 在旧版本中,这会导致在服务器运行时无法更改资源包。 这个问题现在已经修复了。
假设你想在与游戏相同的端口上托管资源包(这是最容易设置的,所以我推荐这样做。请注意,由于 HTTP 处理器在检测到非 HTTP 连接后会立即移除,因此这不会影响性能), 请在 libjf-web 配置中将 port 和 portOverride 选项设置为 -1。
然后,将 serverIp 选项设置为用户用于连接你的 Minecraft 服务器的地址(不一定是 IP 地址)。 注意,你不需要在此地址后附加端口号,因为模组会自动添加。
如果附加的端口不正确(这种情况不应该发生。请注意,25565 等同于在 Minecraft 中输入无端口),你可以使用 portOverride 进行调整。 在服务器启动时,日志中应该包含一条类似这样的消息:“Initialized DynRes at ”,其中 127.0.0.1 应替换为你的地址。 尝试在浏览器中访问此地址,并在操作时观察游戏日志。 如果文件被成功下载,则说明一切设置正确。
DynRes uses an integrated web server to serve a resource pack directly from the server directory. It also modifies the server to specify that pack as the default (overwrites resource-pack and resource-pack-sha1 in server.properties). You can configure the port for the web server, the file to host and whether to provide a hash in the config.
To use this mod on your server you need to place your resource pack in the configured place (default: server/resources.zip) and change baseLink in the config to your public address (what players will enter)
This mod is only required on your server. If added to a client the only thing it will do is log some information about server connections
Configuration
A user recently contacted me about how they can configure the mod to work with their server. Below is my (slightly modified) response to them, added here in the hope that it may help others as well.The resource pack hosting functionality of DynRes is actually provided by a common library, namely libjf-web-v1. As such, the configuration for the actual hosting needs to be done there.
It should also be noted that, if you want to host the pack using the same port that Minecraft uses, libjf-web-v1 delegates to libjf-mainhttp-v0 for the receiving logic. The unfortunate consequence of this is that the config is spread out across two files and, since libjf-web is more general purpose, its configuration provides additional features not relevant to DynRes. I will try to explain a setup that works here, but please do ask if you have any further questions or requests.
First, resourcesFile in DynRes should be the relative path of the resource pack that should be served.
The option hashResources provides clients with a checksum they can use to cache packs, so it should improve performance. In older versions, this prevented the pack from being changed while the server is running. That is now fixed.
Assuming you want to host the pack on the same port as the game (this is the easiest to set up so it is what I would recommend. Note that it shouldn't impact performance as the HTTP handler is removed as soon as it detects a non-HTTP connection), set the port and portOverride options in the libjf-web config to -1.
Then, set the serverIp option to the address (not necessarily an IP) users will use to connect to your Minecraft server. Note that you shouldn't need to append the port to this address, as the mod will do so automatically.
If the port that is appended is wrong (this shouldn't ever happen. Note that 25565 is equivalent to entering no port in Minecraft), you can adjust it using portOverride. When the server is starting up, the log should include a message that looks like this: "Initialized DynRes at " where instead of 127.0.0.1 you have your address. Try navigating to this in your browser and watch the game log as you do so. If the file is downloaded, everything should be set up correctly.
下载 DynRes
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 DynRes
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 DynRes
下载 DynRes
下载 DynRes
下载 DynRes
下载 DynRes
下载 DynRes
下载 DynRes
下载 DynRes
Release 26.3.0 的提交内容:
- chore: 更新至 26.3
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧