Skip to content

Commit b48757b

Browse files
committed
add ArsNouveau recipe doc, remove some old recipe doc
1 parent 728a57a commit b48757b

File tree

7 files changed

+79
-309
lines changed

7 files changed

+79
-309
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package zzzank.probejs.docs.recipes;
2+
3+
import dev.latvian.kubejs.recipe.mod.ArsNouveauEnchantingApparatusRecipeJS;
4+
import dev.latvian.kubejs.recipe.mod.ArsNouveauEnchantmentRecipeJS;
5+
import dev.latvian.kubejs.recipe.mod.ArsNouveauGlyphPressRecipeJS;
6+
import me.shedaniel.architectury.platform.Platform;
7+
import net.minecraft.resources.ResourceLocation;
8+
import zzzank.probejs.docs.Primitives;
9+
import zzzank.probejs.lang.typescript.ScriptDump;
10+
import zzzank.probejs.lang.typescript.code.type.Types;
11+
import zzzank.probejs.lang.typescript.code.type.js.JSLambdaType;
12+
import zzzank.probejs.plugin.ProbeJSPlugin;
13+
14+
import java.util.Map;
15+
16+
import static zzzank.probejs.docs.recipes.BuiltinRecipeDocs.recipeFn;
17+
import static zzzank.probejs.docs.recipes.KubeJS.INGR;
18+
import static zzzank.probejs.docs.recipes.KubeJS.STACK;
19+
import static zzzank.probejs.docs.recipes.Minecraft.INGR_N;
20+
21+
/**
22+
* @author ZZZank
23+
*/
24+
class ArsNouveau extends ProbeJSPlugin {
25+
26+
@Override
27+
public void addPredefinedRecipeDoc(ScriptDump scriptDump, Map<ResourceLocation, JSLambdaType> predefined) {
28+
if (!Platform.isModLoaded("ars_nouveau")) {
29+
return;
30+
}
31+
predefined.put(
32+
rl("enchanting_apparatus"),
33+
recipeFn()
34+
.param("output", STACK)
35+
.param("reagent", INGR)
36+
.param("inputs", INGR_N)
37+
.returnType(Types.type(ArsNouveauEnchantingApparatusRecipeJS.class))
38+
.build()
39+
);
40+
predefined.put(
41+
rl("enchantment"),
42+
recipeFn()
43+
.param("enchantment", Types.primitive("Special.Enchantment"))
44+
.param("level", Primitives.INTEGER)
45+
.param("inputs", INGR_N)
46+
.param("mana", Primitives.INTEGER)
47+
.returnType(Types.type(ArsNouveauEnchantmentRecipeJS.class))
48+
.build()
49+
);
50+
predefined.put(
51+
rl("glyph_recipe"),
52+
recipeFn()
53+
.param("output", STACK)
54+
.param("input", STACK)
55+
.param("tier", Types.STRING)
56+
.returnType(Types.type(ArsNouveauGlyphPressRecipeJS.class))
57+
.build()
58+
);
59+
}
60+
61+
static ResourceLocation rl(String path) {
62+
return new ResourceLocation("ars_nouveau", path);
63+
}
64+
}

src/main/java/zzzank/probejs/docs/recipes/BuiltinRecipeDocs.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package zzzank.probejs.docs.recipes;
22

3+
import lombok.val;
34
import net.minecraft.resources.ResourceLocation;
45
import zzzank.probejs.lang.typescript.ScriptDump;
6+
import zzzank.probejs.lang.typescript.code.type.TSClassType;
57
import zzzank.probejs.lang.typescript.code.type.Types;
68
import zzzank.probejs.lang.typescript.code.type.js.JSLambdaType;
79
import zzzank.probejs.plugin.ProbeJSPlugin;
@@ -17,8 +19,9 @@
1719
*/
1820
public class BuiltinRecipeDocs extends ProbeJSPlugin {
1921

20-
public final List<Supplier<ProbeJSPlugin>> ALL = new ArrayList<>(Arrays.asList(
22+
public static final List<Supplier<ProbeJSPlugin>> ALL = new ArrayList<>(Arrays.asList(
2123
Minecraft::new,
24+
ArsNouveau::new,
2225
Thermal::new,
2326
KubeJS::new
2427
));
@@ -27,6 +30,15 @@ public static JSLambdaType.Builder recipeFn() {
2730
return Types.lambda().method();
2831
}
2932

33+
public static TSClassType classType(String className) {
34+
try {
35+
val c = Class.forName(className);
36+
return Types.type(c);
37+
} catch (ClassNotFoundException e) {
38+
throw new RuntimeException(e);
39+
}
40+
}
41+
3042
@Override
3143
public void addPredefinedRecipeDoc(ScriptDump scriptDump, Map<ResourceLocation, JSLambdaType> predefined) {
3244
for (Supplier<ProbeJSPlugin> supplier : ALL) {

src/main/java/zzzank/probejs/docs/recipes/Thermal.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.minecraftforge.fml.ModList;
66
import zzzank.probejs.lang.typescript.ScriptDump;
77
import zzzank.probejs.lang.typescript.code.type.BaseType;
8-
import zzzank.probejs.lang.typescript.code.type.TSClassType;
98
import zzzank.probejs.lang.typescript.code.type.Types;
109
import zzzank.probejs.lang.typescript.code.type.js.JSLambdaType;
1110
import zzzank.probejs.plugin.ProbeJSPlugin;
@@ -14,6 +13,7 @@
1413

1514
import static zzzank.probejs.docs.recipes.BuiltinRecipeDocs.recipeFn;
1615
import static zzzank.probejs.docs.recipes.KubeJS.*;
16+
import static zzzank.probejs.docs.recipes.BuiltinRecipeDocs.classType;
1717

1818
/**
1919
* @author ZZZank
@@ -37,15 +37,6 @@ public static JSLambdaType fuelStyleRecipe() {
3737
.build();
3838
}
3939

40-
public static TSClassType classType(String className) {
41-
try {
42-
val c = Class.forName(className);
43-
return Types.type(c);
44-
} catch (ClassNotFoundException e) {
45-
throw new RuntimeException(e);
46-
}
47-
}
48-
4940
private static ResourceLocation rl(String path) {
5041
return new ResourceLocation("thermal", path);
5142
}

src/main/resources/docs/ars_nouveau.d.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/main/resources/docs/general.d.ts

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,4 @@
11

2-
/**
3-
* @target dev.latvian.kubejs.recipe.ingredientaction.IngredientActionFilter
4-
* @assign number
5-
* @assign dev.latvian.kubejs.item.ingredient.IngredientJS
6-
* @assign {index: number, item: dev.latvian.kubejs.item.ingredient.IngredientJS}
7-
*/
8-
class IngredientActionFilter {
9-
}
10-
11-
/**
12-
* @target net.minecraft.core.Vec3i
13-
* @assign [number, number, number]
14-
*/
15-
class Vec3i {
16-
}
17-
18-
/**
19-
* @target net.minecraft.item.ItemStack
20-
* @assign Internal.ItemStackJS_
21-
*/
22-
class ItemStack {
23-
}
24-
25-
/**
26-
* @target com.google.gson.JsonObject
27-
* @assign {}
28-
*/
29-
class JsonObject {
30-
}
31-
32-
/**
33-
* @target dev.latvian.kubejs.item.ItemStackJS
34-
* @assign net.minecraft.item.Item
35-
* @assign `${number}x ${string}`
36-
* @assign object
37-
*/
38-
class ItemStackJS {
39-
}
402

413
/**
424
* @target dev.latvian.kubejs.item.ingredient.IngredientJS
@@ -85,13 +47,6 @@ class EntityJS {
8547
getServer(): net.minecraft.server.MinecraftServer
8648
}
8749

88-
/**
89-
* @target net.minecraft.util.ResourceLocation
90-
* @assign string
91-
*/
92-
class ResourceLocation {
93-
}
94-
9550
/**
9651
* @target net.minecraft.nbt.CompoundTag
9752
* @assign string
@@ -100,20 +55,6 @@ class ResourceLocation {
10055
class CompoundTag {
10156
}
10257

103-
/**
104-
* @target java.util.Map
105-
* @assign {[key in K]: V}
106-
*/
107-
class Map {
108-
}
109-
110-
/**
111-
* @target dev.latvian.kubejs.text.Text
112-
* @assign string
113-
*/
114-
class Text {
115-
}
116-
11758
/**
11859
* @target java.lang.Class
11960
* Represents the base Java Class
@@ -158,38 +99,4 @@ class CompoundNBT {
15899
*/
159100
class AttachedData {
160101
[x: string]: any;
161-
}
162-
163-
/**
164-
* @target dev.latvian.kubejs.fluid.FluidStackJS
165-
* @assign net.minecraft.fluid.Fluid
166-
*/
167-
class FluidStackJS {
168-
}
169-
170-
/**
171-
* @target dev.latvian.mods.rhino.mod.util.color.Color
172-
* @assign string
173-
*/
174-
class Color {
175-
}
176-
177-
/**
178-
* @target dev.latvian.kubejs.recipe.filter.RecipeFilter
179-
* @assign dev.latvian.kubejs.recipe.filter.RecipeFilter[]
180-
* @assign {exact?: boolean, not?: Internal.RecipeFilter_, or?: Internal.RecipeFilter_[], id?: string | RegExp, type?: string, group?: string, mod?: string, input?: Internal.IngredientJS_, output?: Internal.IngredientJS_}
181-
*/
182-
class RecipeFilter {
183-
}
184-
185-
/**
186-
* @target dev.latvian.kubejs.block.BlockStatePredicate
187-
* @assign dev.latvian.kubejs.block.BlockStatePredicate[]
188-
* @assign {or?: dev.latvian.kubejs.block.BlockStatePredicate[], not?: dev.latvian.kubejs.block.BlockStatePredicate[]}
189-
* @assign net.minecraft.block.Block
190-
* @assign net.minecraft.block.BlockState
191-
* @assign `#${Tag.block}`
192-
* @assign RegExp
193-
*/
194-
class BlockStatePredicate {
195-
}
102+
}

0 commit comments

Comments
 (0)