[1.19.2] Unable to make holder for registry
ParzivalWolfram opened this issue ยท 1 comments
Issue description
When adding blocks to tags in a loop, the following error occurs:
[12:35:42.894][INFO]: Adding: [<block>] to tag: <tag>
[12:35:42.894][ERROR]: Unable to run action due to an error
java.lang.RuntimeException: Unable to make holder for registry: Registry[ResourceKey[minecraft:root / minecraft:block] (Experimental)] and object: <block>
There are no results for this error online at all.
As the logs are too large to upload to PasteBin, please see attached.
Steps to reproduce
Script used
The crafttweaker.log file
"You have exceeded the maximum size of 512 kilobytes per Paste."
Minecraft version
1.19
Modloader
Forge
Modloader version
43.2.19
CraftTweaker version
10.1.47
Other relevant information
No response
The latest.log file
"You have exceeded the maximum size of 512 kilobytes per Paste."
I believe the issue is the mixing of block and item tags:
<tag:items:minecraft:dirt>,<tag:blocks:minecraft:dirt>
your code here:
outTag.add(block.asItem());
is adding the block to the tag, as an item, but block tags hold blocks, not items.
What you could do is this:
var inputBlocks = [<block:unearthed:siltstone_grassy_regolith>,<block:unearthed:gabbro_grassy_regolith>,<block:unearthed:beige_limestone_grassy_regolith>,<block:unearthed:stone_grassy_regolith>,<block:unearthed:limestone_grassy_regolith>,<block:unearthed:mudstone_regolith>,<block:unearthed:rhyolite_grassy_regolith>,<block:unearthed:grey_limestone_regolith>,<block:unearthed:phyllite_regolith>,<block:unearthed:conglomerate_grassy_regolith>,<block:unearthed:conglomerate_regolith>,<block:unearthed:sandstone_regolith>,<block:unearthed:stone_regolith>,<block:unearthed:sandstone_grassy_regolith>,<block:unearthed:granodiorite_grassy_regolith>,<block:unearthed:rhyolite_regolith>,<block:unearthed:beige_limestone_regolith>,<block:unearthed:limestone_regolith>,<block:unearthed:granodiorite_regolith>,<block:unearthed:gabbro_regolith>,<block:unearthed:mudstone_grassy_regolith>,<block:unearthed:white_granite_grassy_regolith>,<block:unearthed:phyllite_grassy_regolith>,<block:unearthed:slate_grassy_regolith>,<block:unearthed:slate_regolith>,<block:unearthed:siltstone_regolith>,<block:unearthed:white_granite_regolith>,<block:unearthed:grey_limestone_grassy_regolith>];
var outputTags = [<tag:items:minecraft:dirt>,<tag:blocks:minecraft:dirt>,<tag:blocks:forge:dirt>,<tag:blocks:byg:dirt>,<tag:blocks:unearthed:regolith>,<tag:items:unearthed:regolith>];
for block in inputBlocks {
for outTag in outputTags {
outTag.addId(block.registryName);
}
}
Which should work fine.