[Suggesting] Crafttweaker integration for 1.16
Algester opened this issue ยท 8 comments
The serializer for the astral altar is different for example
the recipe says its type: astralsorcery:altar, but the recipetype is astralsorcery:simple_altar, but if you looked at the github recipes they arent one and the same thus fudging the logic for craft tweaker
Right now I'm just studying how to make the stuff work with craft tweaker (its simpler that way) now makes me wonder if I can "rip" the recipetype format with craft tweaker and see how I can possibly change or add recipes
Yes, it would be the same way you modify vanilla recipes...because everything in AS ties into that system now for datapack support. Additional support to accomplish the same task isn't really a good use of dev cycles and won't be done unless something changes under the hood for AS.
I'll just toy around I think I can make it work with crafttweaker its just complaining how "recipe:astralsorcery:altar is not a thing and is rejecting recipe:astralsorcery:simple_altar as well
What isn't already possible? Everything in 1.16 ties into the vanilla system for datapack accessibility, so unlike 1.12 everything should be accessible to craft tweaker already.
The recipe type id is astralsorcery:simple_altar
and the recipe serializer id is astralsorcery:altar
so you actually have the correct script.
CraftTweaker puts a restriction that requires the recipe type id and the and recipe serializer id to be the same.
This is quite strange because in vanilla recipes, crafting table recipes use the recipe type minecraft:crafting
and has many recipe serializers, two of which are minecraft:crafting_shaped
and minecraft:crafting_shapeless
.
I think this is probably okay to report this to CraftTweaker instead and maybe link back here.
I have made a PR to fix this here CraftTweaker/CraftTweaker#1166.
Doesn't seem to need any changes on Astral Sorcery's end.
For reference purposes, a formatted version of your script
<recipetype:astralsorcery:simple_altar>.addJSONRecipe("stone2marbletest", {
"type": "astralsorcery:altar",
"altar_type": 0,
"duration": 5,
"starlight": 1,
"pattern": [
"_____",
"_____",
"__A__",
"_____",
"_____"
],
"key": {
"A": {
"tag": "forge:stone"
}
},
"output": [{
"item": "astralsorcery:marble_raw",
"count": 1
}],
"effects": [
"astralsorcery:built_in_effect_discovery_central_beam"
]
});
Vanilla Crafting Table recipe that should work but fails
<recipetype:minecraft:crafting>.addJSONRecipe("apple_from_stone", {
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "minecraft:stone_tool_materials"
}
],
"result": {
"item": "minecraft:apple",
"count": 1
}
});
I tested with KubeJS and it successfully adds the recipe:
kubejs/server_scripts/test.js
onEvent('recipes', event => {
event.custom({
"type": "astralsorcery:altar",
"altar_type": 0,
"duration": 5,
"starlight": 1,
"pattern": [
"_____",
"_____",
"__A__",
"_____",
"_____"
],
"key": {
"A": {
"tag": "forge:stone"
}
},
"output": [{
"item": "astralsorcery:marble_raw",
"count": 1
}],
"effects": [
"astralsorcery:built_in_effect_discovery_central_beam"
]
});
});
According to Jared he's already contacted hellfire so..... I'll just wait how it works out
to give a perspective is that I'm adding a JSON recipe (which is ideally a datapack thing)
recipetype:astralsorcery:simple_altar.addJSONRecipe("stone2marbletest", {
"type": "astralsorcery:altar",
"altar_type": 0,
"duration": 5,
"starlight": 1,
"pattern": [
"",
"",
"A",
"",
""
],
"key": {
"A": {
"tag": "minecraft:stone"
},
},
"output": [
{
"item": "astralsorcery:marble_raw",
"count": 1
}
],
"effects": [
"astralsorcery:built_in_effect_discovery_central_beam",
]
});
just to test the logic out and its throwing me cannot override recipe because it expects recipe:astralsorcery:altar to be recipe:astralsorcery:simple_altar, but if I change it to astralsorcery:simple_altar crafttweaker is throwing me recipe is invalid because its not a valid recipetype
Yeah I heard about that and it'll be nice.
Till then, the PR just got merged and is available in CraftTweaker v7.1.0.124.
I tested adding an altar recipe with the following script and it works now ๐:
Script and Screenshots
<recipetype:astralsorcery:simple_altar>.addJSONRecipe("stone2marbletest", {
"type": "astralsorcery:altar",
"altar_type": 0,
"duration": 5,
"starlight": 1,
"pattern": [
"_____",
"_____",
"__A__",
"_____",
"_____"
],
"key": {
"A": {
"tag": "forge:stone"
}
},
"output": [{
"item": "astralsorcery:marble_raw",
"count": 1
}],
"effects": [
"astralsorcery:built_in_effect_discovery_central_beam"
]
});
This issue can probably be either be closed, or left open till Jared's PR for a nicer CT api for Astral.