Dumpster
允许你随意导出
- 游戏注册表,使用命令
/dump registries - 游戏数据,包括标签、配方等,使用命令
/dump data - 更具体的数据,如特定标签、配方、战利品表等,使用命令
/dump data <type> - 以上两者均可,使用纯
/dump命令
配置
包含一个小配置文件,允许你设置是否在导出数据时导出标签和/或配方。同样地,你可以配置在重载或启动时是否导出数据和/或注册表。 它还提供了控制导出文件组织方式的选项。
该文件位于 config 文件夹中,名为 dumpster.properties。
服务端或客户端
这个模组的设计其实相当巧妙!(连我自己都感到惊讶)
因此,当模组在服务端运行时,OP 玩家只能使用 /dumpster 命令,这会将所需的数据导出到 服务器文件中!
同样地,当模组在客户端运行时,玩家无需关心自己是否为 OP,即可使用 /dumpster 命令。
最后但同样重要的是,如果模组同时存在于客户端和服务端,由于 Minecraft 的架构限制,客户端的命令将被重命名为 /dump-client,以确保正常工作。
使用场景
这个模组并非用于常规游戏!它纯粹是作为数据包、模组和整合包创作者的一个便捷工具,让他们能够确认自己对游戏的修改是否产生了预期的影响。
兼容性
默认情况下,此模组无法处理来自模组的自定义配方类型。因此,必须实现一个兼容层,要么由添加该配方类型的模组本身提供,要么由旨在添加它的第三方模组提供。
如何实现兼容性
你可以按照 文档 中的指示,通过 Modrinth Maven API 在你的 Gradle 项目中导入此模组。
然后,你可以在一个类中实现 RecipeJsonParser 接口,并将其注册为 recipe-dump 入口点,如基础的 fabric.mod.json 文件所示。
你还应该使用 TargetRecipeType 注解对其进行标注,以指明你正在为其注册的配方类型。如果你想覆盖另一个解析器,还可以通过提供一个更高的优先级值来实现。
这就是你需要做的全部工作。
总而言之,你的配方导出类应类似于以下内容(使用 Yarn 映射):
import com.google.gson.JsonObject;
import mc.recraftors.dumpster.recipes.RecipeJsonParser;
import mc.recraftors.dumpster.recipes.TargetRecipeType;
import net.minecraft.recipe.Recipe;
@TargetRecipeType("mymod:myrecipetype")
public class MyRecipeTypeJsonParser implements RecipeJsonParser {
private MyRecipe recipe;
@Override
public JsonParser.InResult in(Recipe<?> recipe) {
if (recipe instanceof MyRecipe myRecipe) {
this.recipe = myRecipe;
return RecipeJsonParser.InResult.SUCCESS;
}
return RecipeJsonParser.InResult.FAILURE;
}
@Override
public JsonObject toJson() {
// 在此处实现你的解析方法
}
}
其他方法也是可选提供的,用于更详细的功能,例如将多个由单个文件生成的配方归组,或支持替代的配方类型 ID。
Dumpster
Allows you do dump, at will
- your game's registries, with the command
/dump registries - your game's data, including tags, recipes and more, with the command
/dump data - more specific data, such as either tags, recipes, loot tables, etc, with the command
/dump data <type> - both of the above, with the pure
/dumpcommand
Config
Includes a small configuration file, allowing you to set whether or not to dump the tags and/or the recipes when dumping the data. The same way, you can configure whether to dump data and/or registries upon reload or startup. It also gives you the option to control how should the dump files be organized.
This file can be found as dumpster.properties file, in the config folder.
Server or Client
This mod has actually been thought somewhat smartly! (I surprise even myself)
So, when the mod is on the server, OP players only have the option to use the /dumpster command, which will dump the wanted data in the server's files!
And just as well, when the mod is on the client, the player will be able to use the /dumpster command without any concern of whether they are OP or not.
Last but not least, if the mod is on both the client and the server, due to Minecraft's architecture, the client-side command will be renamed /dump-client, in order to work properly.
Use cases
This mod is not meant to be used for regular gaming! It is solely intended as a handy tool for datapack, mod and modpack creators, for them to be able to know whether their game manipulations had a proper impact on the game.
Compatibility
This mod is not able to process modded recipe types by default. Thus, a compatibility layer must be implemented, either on the side of the mod adding the recipe type, or by some third-party mod that intends to add it.
How to implement compatibility
You may import this mod in your Gradle project using the Modrinth maven API, as per indicated in the documentation.
You may then implement the RecipeJsonParser interface in a class and register it as a recipe-dump entry-point as shown in the base fabric.mod.json file.
You shall also annotate it with the TargetRecipeType annotation, in order to indicate what recipe you are actually registering it for. You may as well indicate a priority value, if you want to overhaul another parser, by providing it a higher value.
And that is all you have to do.
All in all, your recipe dump class shall resemble the following (using Yarn mappings):
import com.google.gson.JsonObject;
import mc.recraftors.dumpster.recipes.RecipeJsonParser;
import mc.recraftors.dumpster.recipes.TargetRecipeType;
import net.minecraft.recipe.Recipe;
@TargetRecipeType("mymod:myrecipetype")
public class MyRecipeTypeJsonParser implements RecipeJsonParser {
private MyRecipe recipe;
@Override
public JsonParser.InResult in(Recipe<?> recipe) {
if (recipe instanceof MyRecipe myRecipe) {
this.recipe = myRecipe;
return RecipeJsonParser.InResult.SUCCESS;
}
return RecipeJsonParser.InResult.FAILURE;
}
@Override
public JsonObject toJson() {
// implement your parsing method here
}
}
Other methods are optionally available, for in-detail functionalities, such as regrouping multiple recipes generated out of a single files, or supporting alternative recipe type IDs
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Dumpster
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
1.19 版本的 Mc 1.1 发布
- 更好的调试和错误处理
- 补丁转储文件目标路径
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
模组
添加全屏世界地图,显示你在世界中已探索的区域。与 Xaero's Minimap 搭配使用效果极佳。
评论 0
登录后参与评分
还没有评论,来抢沙发吧