= 创作分享 =
你问我答
使用CrT对Hearth Well模组魔改失败
UuWuZhi

使用CrT对Hearth Well模组魔改失败

UuWuZhi 于 2022-10-16 14:39 ( 2年前 ) [复制链接] [只看楼主] [打印]
1061 7
50RF
[基本信息]
版本:1.12.2
Forge:14.23.5.2859
Optfine:G5
模组列表如下



[问题简介]
整合包需要对Hearth Well模组[以下简称hwell]进行魔改 [百科内hwell模组链接] https://www.mcmod.cn/class/1968.html
进入hwell的WIKI,其中对CrT的支持原文如下

mods.hwell.addCustomCoreRecipe(String coreRegistryName, String shardRegName, IItemStack[] outputs, IItemStack[] inputs)
     Add a recipe for a specific core. Will override existing recipes, if a recipe for that shard already exists.


即添加一个转化核心的转化配方。使用/ct dumpz也会列出这个格式

实际脚本:

(忽略那个norun,是不想弹错误报告写的)
图中两种格式的都不起效果,会报错

[以下是从另一个测试环境下的整合包截取的,除了hwell和crt等相关模组没有其他模组]
游戏内报错如下

Crt的log文件如下



(看样子是格式有问题但是我就是找不出来)
求一个解答,或者找一个同版本的整合包对这个也有魔改的实例给我介绍一下

最佳答案

查看完整内容

addCustomCoreRecipe 在括号里的数据类型顺序是 string string IItemStack[] IItemStack[] 你的前两个string写成IItemStack了。
发表于 2022-10-16 14:39:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

回复 | 举报

该帖共收到 7 条回复!
狂想ThePotato
addCustomCoreRecipe 在括号里的数据类型顺序是 string string IItemStack[] IItemStack[]
你的前两个string写成IItemStack了。
مكتوب
发表于 2022-10-16 14:39:51 | 只看该作者

回复 | 举报

UuWuZhi
(防止大佬因为图片加载不出来而心态爆炸我这边贴一个文字版的)
实际脚本:
import crafttweaker.item.IItemStack;

val r as IItemStack[] = [<minecraft:diamond_block>];
val i as IItemStack[] = [<minecraft:barrier>];

mods.hwell.addCustomCoreRecipe(<hwell:core_sentient>,<hwell:shard_o>,r,i);

mods.hwell.addCustomCoreRecipe(<hwell:core_sentient>,<hwell:shard_o>,[<minecraft:diamond_block>],[<minecraft:barrier>]);

Crt的Log文件
[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit]]
[PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [preinit]
[PREINITIALIZATION][CLIENT][INFO] [preinit | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: HearthWell.zs} as we are currently loading with a different loader
[PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 2ms
[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [contenttweaker]]
[PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [contenttweaker]
[PREINITIALIZATION][CLIENT][INFO] [contenttweaker | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: HearthWell.zs} as we are currently loading with a different loader
[PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 0ms
[PREINITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [contenttweaker], [hwell_core_recipes]]
[PREINITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [hwell_core_recipes]
[PREINITIALIZATION][CLIENT][INFO] [hwell_core_recipes | SIDE_CLIENT]: Skipping file {[0:crafttweaker]: HearthWell.zs} as we are currently loading with a different loader
[PREINITIALIZATION][CLIENT][INFO] Completed script loading in: 0ms
[INITIALIZATION][CLIENT][INFO] CraftTweaker: Building registry
[INITIALIZATION][CLIENT][INFO] CraftTweaker: Successfully built item registry
[INITIALIZATION][CLIENT][INFO] Current loaders after merging: [[preinit], [contenttweaker], [hwell_core_recipes], [recipeevent | crafttweaker]]
[INITIALIZATION][CLIENT][INFO] Loading scripts for loader with names [crafttweaker | recipeevent]
[INITIALIZATION][CLIENT][INFO] [crafttweaker | SIDE_CLIENT]: Loading Script: {[0:crafttweaker]: HearthWell.zs}
[INITIALIZATION][CLIENT][ERROR] HearthWell.zs:7 > a method available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, ZenTypeNative: crafttweaker.item.IItemStack, ZenTypeNative: crafttweaker.item.IItemStack[], ZenTypeNative: crafttweaker.item.IItemStack[])
This is usually an error in your script, not in the mod
addCustomCoreRecipe(string, string, ZenTypeNative: null.null[], ZenTypeNative: null.null[])
[INITIALIZATION][CLIENT][ERROR] HearthWell.zs:9 > a method available but none matches the parameters (ZenTypeNative: crafttweaker.item.IItemStack, ZenTypeNative: crafttweaker.item.IItemStack, ZenTypeNative: null.null[], ZenTypeNative: null.null[])
This is usually an error in your script, not in the mod
addCustomCoreRecipe(string, string, ZenTypeNative: null.null[], ZenTypeNative: null.null[])
[INITIALIZATION][CLIENT][INFO] Completed script loading in: 444ms
[POSTINITIALIZATION][CLIENT][INFO] Removing recipes for various outputs
[AVAILABLE][CLIENT][INFO] Fixed the RecipeBook
发表于 2022-10-16 14:45:30 | 只看该作者

回复 | 举报

UuWuZhi
Kasualix 发表于 2022-10-17 10:43
addCustomCoreRecipe 在括号里的数据类型顺序是 string string IItemStack[] IItemStack[]
你的前两个strin ...

所以去掉<>就行咯还是…啊我去逝逝
发表于 2022-10-18 21:23:15 | 只看该作者

回复 | 举报

UuWuZhi
Kasualix 发表于 2022-10-17 10:43
addCustomCoreRecipe 在括号里的数据类型顺序是 string string IItemStack[] IItemStack[]
你的前两个strin ...

emmmmmmmmmmm
String应该是字符串吧,用""的那个
那怎么知道一个东西的String呢
发表于 2022-10-19 09:48:35 | 只看该作者

回复 | 举报

狂想ThePotato
QQ酱253138 发表于 2022-10-19 09:48
emmmmmmmmmmm
String应该是字符串吧,用""的那个
那怎么知道一个东西的String呢 ...

游戏内F3+H即可查看。
مكتوب
发表于 2022-10-19 10:18:29 | 只看该作者

回复 | 举报

UuWuZhi
Kasualix 发表于 2022-10-19 10:18
游戏内F3+H即可查看。

我试了试,无论是本地化之后的英文名还是注册名,无论带不带大写和带不带下划线_都显示没有这个String
发表于 2022-10-19 16:32:28 | 只看该作者

回复 | 举报

UuWuZhi
本帖最后由 QQ酱253138 于 2022-10-19 17:14 编辑
Kasualix 发表于 2022-10-19 10:18
游戏内F3+H即可查看。

啊,去github看了看,找到实例了,谢了//Cores .
//mods。hwell . addCustomCoreRecipe(String coreRegistryName, String shardRegName, IItemStack[] outputs, IItemStack[] inputs )
/*
mods . hwell. addCustomCoreRecipe("core_ stone" ,"shard_ fe", [<minecraft:iron_ ore>],[<minecraft:sand>]);
mods . hwell. addCustomCoreRecipe("core_ stone" , "shard_ au" , [<minecraft:gold_ ore>], [<minecraft:sand>]);
mods . hwell. addCustomCoreRecipe("core_ stone" ,"shard_ o", [<minecraft:lapis_ ore>],[<minecraft:sand>]);
mods . hwe1l. addCustomCoreRecipe("core_ heat" , "shard_ n", [<minecraft:cobblestone>], [<minecraft:diamond. _block>]);
mods . hwe1l. addCustomCoreRecipe("core_ heat" , "shard_ h", [<minecraft:cobblestone>], [<minecraft:coal_ block>]);
mods . hwe1l. addCustomCoreRecipe("core_ green" , "shard_ fe",[<minecraft:cobblestone>], [<hwel1:fertilizer. block>]);
mods . hwell. addCustomCoreRecipe("core_ sentient" ,"shard_ o" ,[<minecraft:diamond. _ore>],[<minecraft:redstone_ block>]);
mods . hwell. addCustomCoreRecipe("core_ sentient" ,"shard_ n" ,[<minecraft:emerald. _ore>],[<minecraft:diamond_ block>]);

C:\Users\dell\Desktop
发表于 2022-10-19 17:12:19 | 只看该作者

回复 | 举报

百科目前不允许匿名发帖哦~ 请先 [ 登陆 ][ 注册 ] 吧~

本版积分规则

发新帖
  • 回复
  • 点评
  • 评分

[ MC百科(mcmod.cn) 除另有声明,所有开放公共编辑的内容均使用 BY-NC-SA 3.0 协议 ]

Minecraft百科CC协议
快速回复 返回顶部 返回列表