插件简介
这是一个轻量级的服务端插件,允许你拒绝来自客户端的某些合成操作。
如何使用此插件
加载包含此插件的世界时,该插件不会主动修改任何内容。你需要在世界根目录(即与 level.dat 相同的目录)中创建并编辑一个名为 craftden1al.json 的文件(在 Linux 系统上区分大小写)。
craftden1al.json 示例:(“//” 注释仅为便于理解,实际的 JSON 文件不允许包含注释)
{
"deny_mode": false, // 默认为 'true';'true' 表示拒绝模式,'false' 表示允许模式;接受值:'true' | 'false'
"patterns": [
[
{
"type": "rege_s_simple_datapack:all", // 一个字符串,代表条件类型,注册于 rege.rege.minecraftmod.craftden1al.util.ConditionRegistry
"data": [] // 任意元素,取决于类型的要求
}, // 一个对象代表条件匹配,或 'null' 代表无条件匹配;接受值:一个对象 | 'null'
[
"minecraft:string", // 一个字符串(MC 1.7+ 可用)代表物品的资源位置,或一个数字代表物品的原始 ID,或一个对象(见下文)代表更详细的物品,或 'null' 代表空槽位
"minecraft:string", // 同上
"minecraft:string", // 同上
"minecraft:string" // 同上
], // 一个数组代表成型或无成型配方的原料,或 'null' 代表原料不重要
{
"id": "minecraft:wool", // 一个字符串(MC 1.7+ 可用)代表物品的资源位置,或一个数字代表物品的原始 ID
"dv": 0, // 一个数字代表物品的 DV(Damage Value,耐久值/损坏值)
"count": 1 // 一个数字代表结果物品的数量;在定义原料时无效
}, // 一个字符串(MC 1.7+ 可用)代表结果物品的资源位置,或一个数字代表结果物品的原始 ID,或一个对象代表更详细的结果物品,或 'null' 代表结果物品不重要
2, // 一个整数代表成型配方的宽度,或 null 代表成型配方的宽度不重要;如果此项和下一项都缺失,则代表是否匹配成型配方并不重要
2 // 一个整数代表成型配方的高度,或 null 代表成型配方的高度不重要;如果此项缺失且前一项存在,则代表匹配的配方为无成型配方
]
] // 默认为 '[]';一个数组代表所有要匹配的合成配方模式
}
因此,在编辑文件并重启服务器 / 重新进入世界后,客户端玩家将发现他们只能使用 4 个 String 合成 1 个 White Wool,并且当尝试合成其他配方时,尽管结果物品会显示在合成屏幕的右侧,但在尝试取出物品时,它会“弹回”,从而拒绝合成某些配方。
注意事项
请参考 Minecraft Wiki 的历史记录以获取配方列表,成型合成图案的宽度和高度严格基于“源代码”。
例如,Diamond Axe 的宽度和高度分别为 2 和 3,而不是 3 和 3;并且必须为 ["minecraft:diamond", "minecraft:diamond", "minecraft:diamond", "minecraft:stick", null, "minecraft:stick"],而不是其水平镜像形式(即 ["minecraft:diamond", "minecraft:diamond", "minecraft:stick", "minecraft:diamond", "minecraft:stick", null])。
如果你无法查看源代码,最好的方法是将两种形式都写入模式中。
常见问题解答
问:在客户端运行此模组有用吗?
答:在客户端加载此模组对于进入单人世界是有用的。对于进入多人游戏无效。是否生效取决于此模组是否在服务器端加载。
问:似乎 craftden1al.json 中定义的配方没有被加载?
答:请检查 craftden1al.json 的内容是否符合 JSON 语法(特别注意逗号的有无、符号是否为半角,且不允许包含注释)。如果存在语法错误,游戏日志将显示 Incorrect JSON syntax of craftden1al.json, giving up loading: reason。同时确认键名拼写正确(例如 patterns 被误写为 pattern 导致没有配方加载),以及配方列表是否正确。
问:在创造模式下,我可以按数字键将物品从结果槽移出而不会被弹回?
答:这是创造模式的一个特性,这在生存模式/冒险模式中不会发生。
问:由于包含无效的物品 ID 等原因,craftden1al.json 会被覆盖吗?
答:不会。此插件只会读取文件,不会向其中写入内容。
Plugin Synopsis
This is a lightweight plugin run on server-side, which allows you to refuse certain crafting operations from client-side.
How to Use This Plugin
Loading world with this plugin loading, this plugin will not actively modify anything. You need to create and edit a file named craftden1al.json (case sensitive on Linux) in the root directory of the world (i.e. in the same directory as level.dat).
Example of craftden1al.json: (“//” comments for ease of understanding, actual JSON files do not allow comments)
{
"deny_mode": false, // defaults 'true'; 'true' for deny mode and 'false' for allow mode; accepts: 'true' | 'false'
"patterns": [
[
{
"type": "rege_s_simple_datapack:all", // a string represents a condiion type, registered in rege.rege.minecraftmod.craftden1al.util.ConditionRegistry
"data": [] // any element, depends on the type's requirement
}, // an object represents a conditional match, or 'null' represents an unconditional match; accepts: an object | 'null'
[
"minecraft:string", // a string(available on MC 1.7+) represents the resource location of the item, or a number represents the raw ID of the item, or an object(see below) represents a more detailed item, or 'null' represents an empty slot
"minecraft:string", // the same as the previous line
"minecraft:string", // the same as the previous line
"minecraft:string" // the same as the previous line
], // an array represents a shaped or shapeless recipe's ingredients, or 'null' represents that the ingredients are unimportant
{
"id": "minecraft:wool", // a string(available on MC 1.7+) represents the resource location of the item, or a number represents the raw ID of the item
"dv": 0, // a number represents the DV(Damage Value) of the item
"count": 1 // a number represents the count of the result item; won't be useful in ingredients' definitions
}, // a string(available on MC 1.7+) represents the resource location of the result item, or a number represents the raw ID of the result item, or an object represents a more detailed result item, or 'null' represents that the result item is unimportant
2, // an integer represents the width of the shaped recipe, or null represents that the width of the shaped recipe is unimportant; if both this and next element is absent, it represents that whether the recipe to match is shaped or not is unimportant
2 // an integer represents the height of the shaped recipe, or null represents that the height of the shaped recipe is unimportant; if this element is absent and the previous element is present, it represents that the recipe to match is shapeless
]
] // defaults '[]'; an array represents all recipe patterns to match
}
So, after editing the file and restarting the server / re-entering the world, the client player will find they are only able to craft 1 White Wool with 4 Strings, and when trying to craft other recipes, even though the result item is displayed on the right side of the crafting screen, when trying to take out the item, it will “bounce back”, thus refusing to craft certain recipes.
Notice
Please refer to the Minecraft Wiki's history for recipe lists, and the width and height of the shaped crafting patterns are strictly “source-code-based”.
For example, the width and height of Diamond Axe's are 2 and 3, not 3 and 3; and must be ["minecraft:diamond", "minecraft:diamond", "minecraft:diamond", "minecraft:stick", null, "minecraft:stick"], not its horizontal-mirrored form (i.e. ["minecraft:diamond", "minecraft:diamond", "minecraft:stick", "minecraft:diamond", "minecraft:stick", null]).
If you are not able to view the source code, the best way is to write both to the pattern.
FAQ
Q: Is it useful to run this mod on the client-side?
A: Client-side loading of this mod is useful for entering singleplayer worlds. It takes no effect for entering multiplayer games. Whether it takes effect depends on whether this mod is loaded on the server side.
Q:Seems that the pattern defined in craftden1al.json did not being loaded?
A:Please check whether the content of craftden1al.json conforms to the syntax of JSON (pay special attention to the presence or absence of commas, whether the symbols are halfwidth, and no comments allowed). If there is a syntax error, the game log will show Incorrect JSON syntax of craftden1al.json, giving up loading: reason. As well as confirming that the key names are spelled correctly (e.g. patterns is written as pattern causing no patterns to load), and that the recipe list is incorrect.
Q: In Creative Mode, I can press a number key to move an item from the result item slot out without bouncing it back?
A: This is a feature of Creative Mode, this won't happen in Survival/Adventure Mode.
Q: Will craftden1al.json be overwritten because it contains invalid item IDs, etc.?
A: No. This plugin will only read the file, not write to it.
下载 CraftDen1al
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CraftDen1al
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CraftDen1al
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CraftDen1al
下载 CraftDen1al
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CraftDen1al
下载 CraftDen1al
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
CraftDen1al(Fabric 版)的第 5 次发布。之前的版本可在此查看 here。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
插件
使床在所有维度中爆炸的模组
插件
为 Armor Poser 模组添加兼容性
插件
SkyBlock、OneBlock、Boxed、SkyGrid、AcidIsland、CaveBlock、Poseidon、StrangerRealms——以及更多!这些只是由 BentoBox 支持的基于岛屿的游戏模式之一。来自原版 ASkyBlock 的作者。
插件
一个高度兼容、功能完善且稳定的 TPA 模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧