@adeficior/data-modifier 1.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/cli/codegen/registry.d.ts +3 -0
  2. package/dist/cli/codegen/registry.js +81 -0
  3. package/dist/cli/codegen/registry.js.map +1 -0
  4. package/dist/cli/config.d.ts +10 -0
  5. package/dist/cli/config.js +60 -0
  6. package/dist/cli/config.js.map +1 -0
  7. package/dist/cli/index.d.ts +1 -0
  8. package/dist/cli/index.js +34 -0
  9. package/dist/cli/index.js.map +1 -0
  10. package/dist/common/id.d.ts +15 -0
  11. package/dist/common/id.js +42 -0
  12. package/dist/common/id.js.map +1 -0
  13. package/dist/common/ingredient.d.ts +49 -0
  14. package/dist/common/ingredient.js +108 -0
  15. package/dist/common/ingredient.js.map +1 -0
  16. package/dist/common/predicates.d.ts +7 -0
  17. package/dist/common/predicates.js +32 -0
  18. package/dist/common/predicates.js.map +1 -0
  19. package/dist/common/registry.d.ts +12 -0
  20. package/dist/common/registry.js +36 -0
  21. package/dist/common/registry.js.map +1 -0
  22. package/dist/common/result.d.ts +48 -0
  23. package/dist/common/result.js +37 -0
  24. package/dist/common/result.js.map +1 -0
  25. package/dist/emit/assets/blockstates.d.ts +18 -0
  26. package/dist/emit/assets/blockstates.js +46 -0
  27. package/dist/emit/assets/blockstates.js.map +1 -0
  28. package/dist/emit/assets/lang.d.ts +33 -0
  29. package/dist/emit/assets/lang.js +103 -0
  30. package/dist/emit/assets/lang.js.map +1 -0
  31. package/dist/emit/assets/models.d.ts +24 -0
  32. package/dist/emit/assets/models.js +59 -0
  33. package/dist/emit/assets/models.js.map +1 -0
  34. package/dist/emit/blacklist.d.ts +32 -0
  35. package/dist/emit/blacklist.js +99 -0
  36. package/dist/emit/blacklist.js.map +1 -0
  37. package/dist/emit/content/blockDefinition.d.ts +58 -0
  38. package/dist/emit/content/blockDefinition.js +58 -0
  39. package/dist/emit/content/blockDefinition.js.map +1 -0
  40. package/dist/emit/content/innerBlockDefinition.d.ts +12 -0
  41. package/dist/emit/content/innerBlockDefinition.js +32 -0
  42. package/dist/emit/content/innerBlockDefinition.js.map +1 -0
  43. package/dist/emit/content/itemDefinition.d.ts +58 -0
  44. package/dist/emit/content/itemDefinition.js +54 -0
  45. package/dist/emit/content/itemDefinition.js.map +1 -0
  46. package/dist/emit/custom.d.ts +15 -0
  47. package/dist/emit/custom.js +42 -0
  48. package/dist/emit/custom.js.map +1 -0
  49. package/dist/emit/data/loot.d.ts +48 -0
  50. package/dist/emit/data/loot.js +108 -0
  51. package/dist/emit/data/loot.js.map +1 -0
  52. package/dist/emit/data/recipe.d.ts +46 -0
  53. package/dist/emit/data/recipe.js +106 -0
  54. package/dist/emit/data/recipe.js.map +1 -0
  55. package/dist/emit/data/tags.d.ts +38 -0
  56. package/dist/emit/data/tags.js +115 -0
  57. package/dist/emit/data/tags.js.map +1 -0
  58. package/dist/emit/index.d.ts +11 -0
  59. package/dist/emit/index.js +1 -0
  60. package/dist/emit/index.js.map +1 -0
  61. package/dist/emit/polytoneTabs.d.ts +65 -0
  62. package/dist/emit/polytoneTabs.js +101 -0
  63. package/dist/emit/polytoneTabs.js.map +1 -0
  64. package/dist/emit/rule/index.d.ts +10 -0
  65. package/dist/emit/rule/index.js +10 -0
  66. package/dist/emit/rule/index.js.map +1 -0
  67. package/dist/emit/rule/lootTable.d.ts +14 -0
  68. package/dist/emit/rule/lootTable.js +47 -0
  69. package/dist/emit/rule/lootTable.js.map +1 -0
  70. package/dist/emit/rule/recipe.d.ts +16 -0
  71. package/dist/emit/rule/recipe.js +29 -0
  72. package/dist/emit/rule/recipe.js.map +1 -0
  73. package/dist/emit/ruled.d.ts +18 -0
  74. package/dist/emit/ruled.js +47 -0
  75. package/dist/emit/ruled.js.map +1 -0
  76. package/dist/error.d.ts +12 -0
  77. package/dist/error.js +45 -0
  78. package/dist/error.js.map +1 -0
  79. package/dist/index.d.ts +31 -0
  80. package/dist/index.js +12 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/loader/index.d.ts +16 -0
  83. package/dist/loader/index.js +40 -0
  84. package/dist/loader/index.js.map +1 -0
  85. package/dist/loader/lang.d.ts +7 -0
  86. package/dist/loader/lang.js +12 -0
  87. package/dist/loader/lang.js.map +1 -0
  88. package/dist/loader/loot.d.ts +7 -0
  89. package/dist/loader/loot.js +12 -0
  90. package/dist/loader/loot.js.map +1 -0
  91. package/dist/loader/pack.d.ts +62 -0
  92. package/dist/loader/pack.js +131 -0
  93. package/dist/loader/pack.js.map +1 -0
  94. package/dist/loader/recipe.d.ts +25 -0
  95. package/dist/loader/recipe.js +207 -0
  96. package/dist/loader/recipe.js.map +1 -0
  97. package/dist/loader/registry/dump.d.ts +19 -0
  98. package/dist/loader/registry/dump.js +74 -0
  99. package/dist/loader/registry/dump.js.map +1 -0
  100. package/dist/loader/registry/empty.d.ts +11 -0
  101. package/dist/loader/registry/empty.js +22 -0
  102. package/dist/loader/registry/empty.js.map +1 -0
  103. package/dist/loader/registry/index.d.ts +11 -0
  104. package/dist/loader/registry/index.js +1 -0
  105. package/dist/loader/registry/index.js.map +1 -0
  106. package/dist/loader/tags.d.ts +26 -0
  107. package/dist/loader/tags.js +131 -0
  108. package/dist/loader/tags.js.map +1 -0
  109. package/dist/parser/adAstra.d.ts +11 -0
  110. package/dist/parser/adAstra.js +6 -0
  111. package/dist/parser/adAstra.js.map +1 -0
  112. package/dist/parser/botania.d.ts +20 -0
  113. package/dist/parser/botania.js +11 -0
  114. package/dist/parser/botania.js.map +1 -0
  115. package/dist/parser/create.d.ts +4 -0
  116. package/dist/parser/create.js +3 -0
  117. package/dist/parser/create.js.map +1 -0
  118. package/dist/parser/farmersdelight.d.ts +4 -0
  119. package/dist/parser/farmersdelight.js +3 -0
  120. package/dist/parser/farmersdelight.js.map +1 -0
  121. package/dist/parser/index.d.ts +13 -0
  122. package/dist/parser/index.js +8 -0
  123. package/dist/parser/index.js.map +1 -0
  124. package/dist/parser/lootTable.d.ts +7 -0
  125. package/dist/parser/lootTable.js +70 -0
  126. package/dist/parser/lootTable.js.map +1 -0
  127. package/dist/parser/recipe/adAstra/conversion.d.ts +20 -0
  128. package/dist/parser/recipe/adAstra/conversion.js +33 -0
  129. package/dist/parser/recipe/adAstra/conversion.js.map +1 -0
  130. package/dist/parser/recipe/adAstra/hammering.d.ts +18 -0
  131. package/dist/parser/recipe/adAstra/hammering.js +27 -0
  132. package/dist/parser/recipe/adAstra/hammering.js.map +1 -0
  133. package/dist/parser/recipe/adAstra/index.d.ts +5 -0
  134. package/dist/parser/recipe/adAstra/index.js +1 -0
  135. package/dist/parser/recipe/adAstra/index.js.map +1 -0
  136. package/dist/parser/recipe/adAstra/inputOutput.d.ts +24 -0
  137. package/dist/parser/recipe/adAstra/inputOutput.js +42 -0
  138. package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -0
  139. package/dist/parser/recipe/adAstra/nasaWorkbench.d.ts +20 -0
  140. package/dist/parser/recipe/adAstra/nasaWorkbench.js +30 -0
  141. package/dist/parser/recipe/adAstra/nasaWorkbench.js.map +1 -0
  142. package/dist/parser/recipe/adAstra/spaceStation.d.ts +19 -0
  143. package/dist/parser/recipe/adAstra/spaceStation.js +27 -0
  144. package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -0
  145. package/dist/parser/recipe/botania/apothecary.d.ts +19 -0
  146. package/dist/parser/recipe/botania/apothecary.js +28 -0
  147. package/dist/parser/recipe/botania/apothecary.js.map +1 -0
  148. package/dist/parser/recipe/botania/brew.d.ts +18 -0
  149. package/dist/parser/recipe/botania/brew.js +24 -0
  150. package/dist/parser/recipe/botania/brew.js.map +1 -0
  151. package/dist/parser/recipe/botania/elvenTrade.d.ts +19 -0
  152. package/dist/parser/recipe/botania/elvenTrade.js +27 -0
  153. package/dist/parser/recipe/botania/elvenTrade.js.map +1 -0
  154. package/dist/parser/recipe/botania/gogWrapper.d.ts +22 -0
  155. package/dist/parser/recipe/botania/gogWrapper.js +34 -0
  156. package/dist/parser/recipe/botania/gogWrapper.js.map +1 -0
  157. package/dist/parser/recipe/botania/manaInfusion.d.ts +21 -0
  158. package/dist/parser/recipe/botania/manaInfusion.js +33 -0
  159. package/dist/parser/recipe/botania/manaInfusion.js.map +1 -0
  160. package/dist/parser/recipe/botania/nbtWrapper.d.ts +20 -0
  161. package/dist/parser/recipe/botania/nbtWrapper.js +30 -0
  162. package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -0
  163. package/dist/parser/recipe/botania/orechid.d.ts +35 -0
  164. package/dist/parser/recipe/botania/orechid.js +74 -0
  165. package/dist/parser/recipe/botania/orechid.js.map +1 -0
  166. package/dist/parser/recipe/botania/pureDaisy.d.ts +19 -0
  167. package/dist/parser/recipe/botania/pureDaisy.js +30 -0
  168. package/dist/parser/recipe/botania/pureDaisy.js.map +1 -0
  169. package/dist/parser/recipe/botania/runicAltar.d.ts +19 -0
  170. package/dist/parser/recipe/botania/runicAltar.js +27 -0
  171. package/dist/parser/recipe/botania/runicAltar.js.map +1 -0
  172. package/dist/parser/recipe/botania/terraPlate.d.ts +19 -0
  173. package/dist/parser/recipe/botania/terraPlate.js +27 -0
  174. package/dist/parser/recipe/botania/terraPlate.js.map +1 -0
  175. package/dist/parser/recipe/create/assembly.d.ts +25 -0
  176. package/dist/parser/recipe/create/assembly.js +45 -0
  177. package/dist/parser/recipe/create/assembly.js.map +1 -0
  178. package/dist/parser/recipe/create/processing.d.ts +21 -0
  179. package/dist/parser/recipe/create/processing.js +27 -0
  180. package/dist/parser/recipe/create/processing.js.map +1 -0
  181. package/dist/parser/recipe/farmersdelight/cooking.d.ts +22 -0
  182. package/dist/parser/recipe/farmersdelight/cooking.js +29 -0
  183. package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -0
  184. package/dist/parser/recipe/farmersdelight/cutting.d.ts +23 -0
  185. package/dist/parser/recipe/farmersdelight/cutting.js +38 -0
  186. package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -0
  187. package/dist/parser/recipe/forge/conditional.d.ts +25 -0
  188. package/dist/parser/recipe/forge/conditional.js +45 -0
  189. package/dist/parser/recipe/forge/conditional.js.map +1 -0
  190. package/dist/parser/recipe/ignored.d.ts +10 -0
  191. package/dist/parser/recipe/ignored.js +16 -0
  192. package/dist/parser/recipe/ignored.js.map +1 -0
  193. package/dist/parser/recipe/index.d.ts +19 -0
  194. package/dist/parser/recipe/index.js +22 -0
  195. package/dist/parser/recipe/index.js.map +1 -0
  196. package/dist/parser/recipe/quark/exclusion.d.ts +20 -0
  197. package/dist/parser/recipe/quark/exclusion.js +32 -0
  198. package/dist/parser/recipe/quark/exclusion.js.map +1 -0
  199. package/dist/parser/recipe/roots/component.d.ts +18 -0
  200. package/dist/parser/recipe/roots/component.js +24 -0
  201. package/dist/parser/recipe/roots/component.js.map +1 -0
  202. package/dist/parser/recipe/roots/ritual.d.ts +22 -0
  203. package/dist/parser/recipe/roots/ritual.js +32 -0
  204. package/dist/parser/recipe/roots/ritual.js.map +1 -0
  205. package/dist/parser/recipe/sullys/polishing.d.ts +19 -0
  206. package/dist/parser/recipe/sullys/polishing.js +27 -0
  207. package/dist/parser/recipe/sullys/polishing.js.map +1 -0
  208. package/dist/parser/recipe/thermal/catalyst.d.ts +22 -0
  209. package/dist/parser/recipe/thermal/catalyst.js +24 -0
  210. package/dist/parser/recipe/thermal/catalyst.js.map +1 -0
  211. package/dist/parser/recipe/thermal/fuel.d.ts +18 -0
  212. package/dist/parser/recipe/thermal/fuel.js +24 -0
  213. package/dist/parser/recipe/thermal/fuel.js.map +1 -0
  214. package/dist/parser/recipe/thermal/index.d.ts +22 -0
  215. package/dist/parser/recipe/thermal/index.js +36 -0
  216. package/dist/parser/recipe/thermal/index.js.map +1 -0
  217. package/dist/parser/recipe/thermal/ingredient.d.ts +21 -0
  218. package/dist/parser/recipe/thermal/ingredient.js +43 -0
  219. package/dist/parser/recipe/thermal/ingredient.js.map +1 -0
  220. package/dist/parser/recipe/thermal/treeExtraction.d.ts +24 -0
  221. package/dist/parser/recipe/thermal/treeExtraction.js +47 -0
  222. package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -0
  223. package/dist/parser/recipe/vanilla/shaped.d.ts +19 -0
  224. package/dist/parser/recipe/vanilla/shaped.js +28 -0
  225. package/dist/parser/recipe/vanilla/shaped.js.map +1 -0
  226. package/dist/parser/recipe/vanilla/shapeless.d.ts +18 -0
  227. package/dist/parser/recipe/vanilla/shapeless.js +27 -0
  228. package/dist/parser/recipe/vanilla/shapeless.js.map +1 -0
  229. package/dist/parser/recipe/vanilla/smelting.d.ts +19 -0
  230. package/dist/parser/recipe/vanilla/smelting.js +27 -0
  231. package/dist/parser/recipe/vanilla/smelting.js.map +1 -0
  232. package/dist/parser/recipe/vanilla/smithing.d.ts +19 -0
  233. package/dist/parser/recipe/vanilla/smithing.js +28 -0
  234. package/dist/parser/recipe/vanilla/smithing.js.map +1 -0
  235. package/dist/parser/recipe/vanilla/stonecutting.d.ts +20 -0
  236. package/dist/parser/recipe/vanilla/stonecutting.js +36 -0
  237. package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -0
  238. package/dist/parser/roots.d.ts +4 -0
  239. package/dist/parser/roots.js +3 -0
  240. package/dist/parser/roots.js.map +1 -0
  241. package/dist/parser/thermal.d.ts +10 -0
  242. package/dist/parser/thermal.js +6 -0
  243. package/dist/parser/thermal.js.map +1 -0
  244. package/dist/schema/assets/blockstate.d.ts +10 -0
  245. package/dist/schema/assets/blockstate.js +1 -0
  246. package/dist/schema/assets/blockstate.js.map +1 -0
  247. package/dist/schema/assets/lang.d.ts +3 -0
  248. package/dist/schema/assets/lang.js +3 -0
  249. package/dist/schema/assets/lang.js.map +1 -0
  250. package/dist/schema/assets/model.d.ts +27 -0
  251. package/dist/schema/assets/model.js +1 -0
  252. package/dist/schema/assets/model.js.map +1 -0
  253. package/dist/schema/content/blockDefinition.d.ts +11 -0
  254. package/dist/schema/content/blockDefinition.js +1 -0
  255. package/dist/schema/content/blockDefinition.js.map +1 -0
  256. package/dist/schema/content/itemDefinition.d.ts +14 -0
  257. package/dist/schema/content/itemDefinition.js +1 -0
  258. package/dist/schema/content/itemDefinition.js.map +1 -0
  259. package/dist/schema/data/loot.d.ts +1151 -0
  260. package/dist/schema/data/loot.js +76 -0
  261. package/dist/schema/data/loot.js.map +1 -0
  262. package/dist/schema/data/recipe.d.ts +13 -0
  263. package/dist/schema/data/recipe.js +1 -0
  264. package/dist/schema/data/recipe.js.map +1 -0
  265. package/dist/schema/data/tag.d.ts +11 -0
  266. package/dist/schema/data/tag.js +6 -0
  267. package/dist/schema/data/tag.js.map +1 -0
  268. package/dist/stubTypes.d.ts +7 -0
  269. package/dist/stubTypes.js +1 -0
  270. package/dist/stubTypes.js.map +1 -0
  271. package/dist/textHelper.d.ts +3 -0
  272. package/dist/textHelper.js +20 -0
  273. package/dist/textHelper.js.map +1 -0
  274. package/package.json +96 -0
@@ -0,0 +1,18 @@
1
+ import type { Acceptor } from "@adeficior/pack-resolver";
2
+ import type { IdInput } from "../../common/id.js";
3
+ import type { Blockstate } from "../../schema/assets/blockstate.js";
4
+ import type { ClearableEmitter } from "../index.js";
5
+ export interface BlockstateRules {
6
+ add(id: IdInput, blockstate: Blockstate): void;
7
+ basic(id: IdInput, model?: string): void;
8
+ cog(id: IdInput, model?: string): void;
9
+ }
10
+ export default class BlockstateEmitter implements BlockstateRules, ClearableEmitter {
11
+ private readonly custom;
12
+ private filePath;
13
+ add(id: IdInput, blockstate: Blockstate): void;
14
+ emit(acceptor: Acceptor): Promise<void>;
15
+ clear(): void;
16
+ basic(id: IdInput, model?: `${string}:${string}`): void;
17
+ cog(id: IdInput, model?: `${string}:${string}`): void;
18
+ }
@@ -0,0 +1,46 @@
1
+ import { prefix } from "../../common/id.js";
2
+ import CustomEmitter from "../custom.js";
3
+ export default class BlockstateEmitter {
4
+ custom = new CustomEmitter(this.filePath);
5
+ filePath(id) {
6
+ return `assets/${id.namespace}/blockstates/${id.path}.json`;
7
+ }
8
+ add(id, blockstate) {
9
+ this.custom.add(id, blockstate);
10
+ }
11
+ emit(acceptor) {
12
+ return this.custom.emit(acceptor);
13
+ }
14
+ clear() {
15
+ this.custom.clear();
16
+ }
17
+ basic(id, model = prefix(id, "block/")) {
18
+ this.add(id, {
19
+ variants: {
20
+ "": {
21
+ model,
22
+ },
23
+ },
24
+ });
25
+ }
26
+ cog(id, model = prefix(id, "block/")) {
27
+ this.add(id, {
28
+ variants: {
29
+ "axis=x": {
30
+ model,
31
+ x: 90,
32
+ y: 90,
33
+ },
34
+ "axis=y": {
35
+ model,
36
+ },
37
+ "axis=z": {
38
+ model,
39
+ x: 90,
40
+ y: 180,
41
+ },
42
+ },
43
+ });
44
+ }
45
+ }
46
+ //# sourceMappingURL=blockstates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockstates.js","sourceRoot":"","sources":["../../../src/emit/assets/blockstates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,aAAa,MAAM,cAAc,CAAC;AASzC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAGnB,MAAM,GAAG,IAAI,aAAa,CAAa,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE/D,QAAQ,CAAC,EAAM;QACrB,OAAO,UAAU,EAAE,CAAC,SAAS,gBAAgB,EAAE,CAAC,IAAI,OAAO,CAAC;IAC9D,CAAC;IAED,GAAG,CAAC,EAAW,EAAE,UAAsB;QACrC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,QAAkB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,EAAW,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC;QAC7C,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;YACX,QAAQ,EAAE;gBACR,EAAE,EAAE;oBACF,KAAK;iBACN;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,EAAW,EAAE,KAAK,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC;QAC3C,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;YACX,QAAQ,EAAE;gBACR,QAAQ,EAAE;oBACR,KAAK;oBACL,CAAC,EAAE,EAAE;oBACL,CAAC,EAAE,EAAE;iBACN;gBACD,QAAQ,EAAE;oBACR,KAAK;iBACN;gBACD,QAAQ,EAAE;oBACR,KAAK;oBACL,CAAC,EAAE,EAAE;oBACL,CAAC,EAAE,GAAG;iBACP;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import type { InferIds, RegistryId } from "@adeficior/data-modifier/generated";
2
+ import type { Acceptor } from "@adeficior/pack-resolver";
3
+ import type { IdInput } from "../../common/id.js";
4
+ import type { LangDefinition } from "../../schema/assets/lang.js";
5
+ import type { ClearableEmitter, RegistryProvider } from "../index.js";
6
+ type ReplaceOptions = Readonly<{
7
+ matchCase?: boolean;
8
+ keepCase?: boolean;
9
+ lang?: string | string[];
10
+ mod?: string | string[];
11
+ }>;
12
+ type EntryOptions = {
13
+ lang?: string;
14
+ };
15
+ export interface LangRules {
16
+ replaceValue(match: string, value: string, options?: ReplaceOptions): void;
17
+ replaceValue(match: RegExp, value: string, options?: Omit<ReplaceOptions, "matchCase">): void;
18
+ addCustom(file: IdInput, key: string, value: string): void;
19
+ entryName<T extends RegistryId>(registry: T, id: IdInput<InferIds<T>>, value: string, options?: EntryOptions): void;
20
+ }
21
+ export default class LangEmitter implements LangRules, ClearableEmitter {
22
+ private readonly registry;
23
+ private custom;
24
+ private rules;
25
+ constructor(registry: RegistryProvider<LangDefinition>);
26
+ emit(acceptor: Acceptor): Promise<void>;
27
+ clear(): void;
28
+ private langPath;
29
+ replaceValue(match: string | RegExp, value: string, options?: ReplaceOptions): void;
30
+ addCustom(file: IdInput, key: string, value: string): void;
31
+ entryName<T extends RegistryId>(registry: T, id: IdInput<InferIds<T>>, value: string, { lang }?: EntryOptions): void;
32
+ }
33
+ export {};
@@ -0,0 +1,103 @@
1
+ import { arrayOrSelf } from "@adeficior/pack-resolver";
2
+ import { mapValues, omitBy } from "lodash-es";
3
+ import { createId, encodeId } from "../../common/id.js";
4
+ import Registry from "../../common/registry.js";
5
+ import { toJson } from "../../textHelper.js";
6
+ export default class LangEmitter {
7
+ registry;
8
+ custom = new Registry();
9
+ rules = [];
10
+ constructor(registry) {
11
+ this.registry = registry;
12
+ }
13
+ async emit(acceptor) {
14
+ const missingCustomFiles = new Set(this.custom.keys());
15
+ await this.registry.forEachAsync(async (lang, id) => {
16
+ const allRules = this.rules.filter((rule) => {
17
+ return ((rule.languages.length === 0 || rule.languages.includes(id.path)) &&
18
+ (rule.mods.length === 0 || rule.mods.includes(id.namespace)));
19
+ });
20
+ const replaced = omitBy(mapValues(lang, (value, key) => {
21
+ const rules = allRules.filter((rule) => rule.key?.(key) || rule.value?.(value));
22
+ if (rules.length === 0)
23
+ return undefined;
24
+ return rules.reduce((previous, rule) => rule.replacer(previous), value);
25
+ }), (it) => !it);
26
+ const custom = this.custom.get(id) ?? {};
27
+ const output = {
28
+ ...replaced,
29
+ ...custom,
30
+ };
31
+ if (Object.keys(output).length > 0) {
32
+ missingCustomFiles.delete(encodeId(id));
33
+ const path = this.langPath(id);
34
+ acceptor(path, await toJson(output));
35
+ }
36
+ });
37
+ await Promise.all(Array.from(missingCustomFiles).map(async (id) => {
38
+ const path = this.langPath(createId(id));
39
+ acceptor(path, await toJson(this.custom.get(id)));
40
+ }));
41
+ }
42
+ clear() {
43
+ this.rules = [];
44
+ this.custom.clear();
45
+ }
46
+ langPath(id) {
47
+ return `assets/${id.namespace}/lang/${id.path}.json`;
48
+ }
49
+ replaceValue(match, value, options = {}) {
50
+ const languages = arrayOrSelf(options.lang);
51
+ const mods = arrayOrSelf(options.mod);
52
+ const matcher = options.keepCase === false ? () => value : keepCaseMatcher(value);
53
+ if (typeof match === "string") {
54
+ if (options.matchCase) {
55
+ this.rules.push({
56
+ languages,
57
+ mods,
58
+ value: (it) => it.includes(match),
59
+ replacer: (it) => it.replaceAll(match, matcher),
60
+ });
61
+ }
62
+ else {
63
+ this.replaceValue(new RegExp(match, "i"), value, options);
64
+ }
65
+ }
66
+ else {
67
+ this.rules.push({
68
+ languages,
69
+ mods,
70
+ value: (it) => match.test(it),
71
+ replacer: (it) => it.replace(match, matcher),
72
+ });
73
+ }
74
+ }
75
+ addCustom(file, key, value) {
76
+ const definition = this.custom.getOrPut(file, () => ({}));
77
+ definition[key] = value;
78
+ }
79
+ entryName(registry, id, value, { lang } = {}) {
80
+ const { namespace, path } = createId(id);
81
+ const file = createId({ namespace, path: lang ?? "en_us" });
82
+ const { path: registryPath } = createId(registry);
83
+ this.addCustom(file, `${registryPath}.${namespace}.${path}`, value);
84
+ }
85
+ }
86
+ // Taken from https://stackoverflow.com/questions/17264639/replace-text-but-keep-case
87
+ function keepCaseMatcher(replaceValue) {
88
+ return (input) => {
89
+ let result = "";
90
+ for (let i = 0; i < replaceValue.length; i++) {
91
+ const c = replaceValue.charAt(i);
92
+ const p = input.charCodeAt(i);
93
+ if (p >= 65 && p < 65 + 26) {
94
+ result += c.toUpperCase();
95
+ }
96
+ else {
97
+ result += c.toLowerCase();
98
+ }
99
+ }
100
+ return result;
101
+ };
102
+ }
103
+ //# sourceMappingURL=lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lang.js","sourceRoot":"","sources":["../../../src/emit/assets/lang.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,Q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5B,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Acceptor } from "@adeficior/pack-resolver";
2
+ import type { IdInput, NormalizedId } from "../../common/id.js";
3
+ import type { Model } from "../../schema/assets/model.js";
4
+ import type { ClearableEmitter } from "../index.js";
5
+ export interface ModelRules {
6
+ add(id: IdInput, blockstate: Model): NormalizedId;
7
+ cubeAll(id: IdInput, texture?: string): NormalizedId;
8
+ flat(id: IdInput, texture?: string): NormalizedId;
9
+ cog(id: IdInput, large: boolean, texture?: string): NormalizedId;
10
+ }
11
+ export interface ModelRulesGroup {
12
+ blocks: ModelRules;
13
+ items: ModelRules;
14
+ }
15
+ export default class ModelEmitter implements ModelRules, ClearableEmitter {
16
+ private readonly custom;
17
+ constructor(type: string);
18
+ add(id: IdInput, model: Model): `${string}:${string}`;
19
+ emit(acceptor: Acceptor): Promise<void>;
20
+ clear(): void;
21
+ cubeAll(id: IdInput, texture?: `${string}:${string}`): `${string}:${string}`;
22
+ flat(id: IdInput, texture?: `${string}:${string}`): `${string}:${string}`;
23
+ cog(id: IdInput, large: boolean, texture?: `${string}:${string}`): `${string}:${string}`;
24
+ }
@@ -0,0 +1,59 @@
1
+ import { encodeId, prefix, suffix } from "../../common/id.js";
2
+ import CustomEmitter from "../custom.js";
3
+ export default class ModelEmitter {
4
+ custom;
5
+ constructor(type) {
6
+ this.custom = new CustomEmitter((id) => `assets/${id.namespace}/models/${type}/${id.path}.json`);
7
+ }
8
+ add(id, model) {
9
+ this.custom.add(id, model);
10
+ return encodeId(id);
11
+ }
12
+ emit(acceptor) {
13
+ return this.custom.emit(acceptor);
14
+ }
15
+ clear() {
16
+ this.custom.clear();
17
+ }
18
+ cubeAll(id, texture = prefix(id, "block/")) {
19
+ return this.add(id, {
20
+ parent: "minecraft:block/cube_all",
21
+ textures: {
22
+ all: texture,
23
+ },
24
+ });
25
+ }
26
+ flat(id, texture = prefix(id, "item/")) {
27
+ return this.add(id, {
28
+ parent: "minecraft:item/generated",
29
+ textures: {
30
+ layer0: texture,
31
+ },
32
+ });
33
+ }
34
+ cog(id, large, texture = prefix(id, "block/")) {
35
+ const suffixes = ["", "_shaftless"];
36
+ const [normal] = suffixes.map((it) => {
37
+ if (large) {
38
+ return this.add(suffix(id, it), {
39
+ parent: "create:block/large_cogwheel" + it,
40
+ textures: {
41
+ "4": texture,
42
+ particle: texture,
43
+ },
44
+ });
45
+ }
46
+ else {
47
+ return this.add(suffix(id, it), {
48
+ parent: "create:block/cogwheel" + it,
49
+ textures: {
50
+ "1_2": texture,
51
+ particle: texture,
52
+ },
53
+ });
54
+ }
55
+ });
56
+ return normal;
57
+ }
58
+ }
59
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/emit/assets/models.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,aAAa,MAAM,cAAc,CAAC;AAkBzC,MAAM,CAAC,OAAO,OAAO,YAAY;IACd,MAAM,CAAC;IAExB,YAAY,IAAY;QACtB,IAAI,CAAC,MAAM,GAAG,IAAI,aAAa,CAC7B,CAAC,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,SAAS,WAAW,IAAI,IAAI,EAAE,CAAC,IAAI,OAAO,CAChE,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,EAAW,EAAE,KAAY;QAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,QAAkB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CA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AO;wBACd,QAAQ,EAAE,OAAO;qBAClB;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ import type { InferIds, RegistryId } from "@adeficior/data-modifier/generated";
2
+ import type { Acceptor, Logger } from "@adeficior/pack-resolver";
3
+ import type { IngredientTest } from "../common/ingredient.js";
4
+ import type RegistryLookup from "../loader/registry/index.js";
5
+ import type { TagRegistryHolder } from "../loader/tags.js";
6
+ import type { ClearableEmitter } from "./index.js";
7
+ export type HideMode = "jei" | "polytone";
8
+ export interface BlacklistOptions {
9
+ hideFrom?: HideMode | HideMode[];
10
+ }
11
+ export interface BlacklistRules {
12
+ hide(...inputs: IngredientTest[]): void;
13
+ hideEntry<T extends RegistryId>(type: T, ...entries: RegistryIdInput<T>[]): void;
14
+ }
15
+ type RegistryIdInput<T extends RegistryId> = InferIds<T> | RegExp;
16
+ export default class BlacklistEmitter implements BlacklistRules, ClearableEmitter {
17
+ private readonly logger;
18
+ private readonly tags;
19
+ private readonly lookup;
20
+ private hidden;
21
+ private readonly hideModes;
22
+ constructor(logger: Logger, tags: TagRegistryHolder, lookup: () => RegistryLookup, options: BlacklistOptions);
23
+ hide(...inputs: IngredientTest[]): void;
24
+ hideEntry<T extends RegistryId>(type: T, ...entries: RegistryIdInput<T>[]): void;
25
+ private filterIds;
26
+ private resolveIds;
27
+ emit(acceptor: Acceptor): Promise<void>;
28
+ private emitJei;
29
+ private emitPolytone;
30
+ clear(): void;
31
+ }
32
+ export {};
@@ -0,0 +1,99 @@
1
+ import { arrayOrSelf } from "@adeficior/pack-resolver";
2
+ import { uniq } from "lodash-es";
3
+ import { encodeId } from "../common/id.js";
4
+ import { createIngredient, resolveIngredientTest, } from "../common/ingredient.js";
5
+ import { IllegalShapeError } from "../error.js";
6
+ import { toJson } from "../textHelper.js";
7
+ export default class BlacklistEmitter {
8
+ logger;
9
+ tags;
10
+ lookup;
11
+ hidden = [];
12
+ hideModes;
13
+ constructor(logger, tags, lookup, options) {
14
+ this.logger = logger;
15
+ this.tags = tags;
16
+ this.lookup = lookup;
17
+ this.hideModes = arrayOrSelf(options.hideFrom);
18
+ }
19
+ hide(...inputs) {
20
+ this.hidden.push(...inputs.flatMap((test) => this.resolveIds(test)).map(encodeId));
21
+ }
22
+ hideEntry(type, ...entries) {
23
+ const lookup = this.lookup();
24
+ const ids = entries
25
+ .flatMap((entry) => {
26
+ if (typeof entry === "string") {
27
+ lookup.validateEntry(type, entry);
28
+ return [entry];
29
+ }
30
+ else {
31
+ const keys = lookup.keys(type);
32
+ if (!keys)
33
+ throw new Error(`cannot hide using regex/predicates, registry ${encodeId(type)} not loaded`);
34
+ return [...keys].filter((it) => entry.test(it));
35
+ }
36
+ })
37
+ .map(encodeId);
38
+ this.hidden.push(...ids);
39
+ }
40
+ filterIds(test) {
41
+ const keys = this.lookup().keys("minecraft:item");
42
+ if (!keys)
43
+ throw new Error("you can only use regex/predicates to blacklist items if a registry dump is loaded");
44
+ const predicate = resolveIngredientTest(test, this.tags, this.lookup());
45
+ return [...keys.keys()].filter((it) => predicate(it, this.logger));
46
+ }
47
+ resolveIds(input) {
48
+ if (input instanceof RegExp || typeof input === "function") {
49
+ return this.filterIds(input);
50
+ }
51
+ const ingredient = createIngredient(input, this.lookup());
52
+ if (Array.isArray(ingredient)) {
53
+ return ingredient.flatMap((it) => this.resolveIds(it));
54
+ }
55
+ if ("item" in ingredient)
56
+ return [ingredient.item];
57
+ if ("fluid" in ingredient)
58
+ return [ingredient.fluid];
59
+ if ("block" in ingredient)
60
+ return [ingredient.block];
61
+ throw new IllegalShapeError("illegal blacklist entry", input);
62
+ }
63
+ async emit(acceptor) {
64
+ const hiddenIds = uniq(this.hidden).sort();
65
+ if (hiddenIds.length === 0)
66
+ return;
67
+ const promises = [];
68
+ if (this.hideModes.includes("jei"))
69
+ promises.push(this.emitJei(acceptor, hiddenIds));
70
+ if (this.hideModes.includes("polytone"))
71
+ promises.push(this.emitPolytone(acceptor, hiddenIds));
72
+ await Promise.all(promises);
73
+ }
74
+ async emitJei(acceptor, hiddenIds) {
75
+ const content = hiddenIds.join("\n");
76
+ const path = "jei/blacklist.cfg";
77
+ acceptor(path, content);
78
+ }
79
+ async emitPolytone(acceptor, hiddenIds) {
80
+ const tabs = this.lookup().keys("minecraft:creative_mode_tab");
81
+ if (!tabs)
82
+ throw new Error("Cannot use polytone output without creative mod tab registry");
83
+ const content = await toJson({
84
+ targets: [...tabs.values()],
85
+ removals: [
86
+ {
87
+ type: "items_match",
88
+ items: hiddenIds,
89
+ },
90
+ ],
91
+ });
92
+ const path = "assets/generated/polytone/creative_tab_modifiers/hidden.json";
93
+ acceptor(path, content);
94
+ }
95
+ clear() {
96
+ this.hidden = [];
97
+ }
98
+ }
99
+ //# sourceMappingURL=blacklist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blacklist.js","sourceRoot":"","sources":["../../src/emit/blacklist.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAkB1C,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAOhB;IACA;IACA;IANX,MAAM,GAAmB,EAAE,CAAC;IACnB,SAAS,CAAa;IAEvC,YACmB,MAAc,EACd,IAAuB,EACvB,MAA4B,EAC7C,OAAyB;QAHR,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAmB;QACvB,WAAM,GAAN,MAAM,CAAsB;QAG7C,IAAI,CAAC,S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;IACnB,CAAC;CACF"}
@@ -0,0 +1,58 @@
1
+ import type { BlockId } from "@adeficior/data-modifier/generated";
2
+ import type { Acceptor } from "@adeficior/pack-resolver";
3
+ import type { IdInput } from "../../common/id.js";
4
+ import type { BlockDefinition, BlockProperties } from "../../schema/content/blockDefinition.js";
5
+ import type { BlockstateRules } from "../assets/blockstates.js";
6
+ import type { ModelRules } from "../assets/models.js";
7
+ import type { LootRules } from "../data/loot.js";
8
+ import type { ClearableEmitter } from "../index.js";
9
+ export type BlockDefinitionOptions = Readonly<{
10
+ blockstate?: boolean;
11
+ model?: boolean;
12
+ loot?: boolean;
13
+ }>;
14
+ type PropertiesOrCopy = BlockProperties | {
15
+ copy: BlockId;
16
+ };
17
+ type ExtendedBlockProperties = PropertiesOrCopy & {
18
+ type?: string;
19
+ };
20
+ export interface BlockDefinitionRules {
21
+ add<T extends BlockDefinition>(id: IdInput, definition: T): T;
22
+ basic(id: IdInput, properties: ExtendedBlockProperties, options?: BlockDefinitionOptions): BlockDefinition;
23
+ cog(id: IdInput, properties: ExtendedBlockProperties & {
24
+ large?: boolean;
25
+ }, options?: BlockDefinitionOptions): BlockDefinition;
26
+ }
27
+ export declare abstract class AbstractBlockDefinitionRules implements BlockDefinitionRules {
28
+ private readonly models;
29
+ private readonly blockstates;
30
+ private readonly loot;
31
+ constructor(models: ModelRules, blockstates: BlockstateRules, loot: LootRules);
32
+ abstract add<T extends BlockDefinition>(id: IdInput, definition: T): T;
33
+ basic(id: IdInput, { type, ...properties }: ExtendedBlockProperties, options?: BlockDefinitionOptions): {
34
+ type: string;
35
+ properties: string | Readonly<{
36
+ material?: string;
37
+ strength?: number;
38
+ }>;
39
+ };
40
+ cog(id: IdInput, { type, large, ...properties }: ExtendedBlockProperties & {
41
+ large?: boolean;
42
+ }, options?: BlockDefinitionOptions): {
43
+ type: string;
44
+ large: boolean;
45
+ properties: string | Readonly<{
46
+ material?: string;
47
+ strength?: number;
48
+ }>;
49
+ };
50
+ }
51
+ export default class BlockDefinitionEmitter extends AbstractBlockDefinitionRules implements ClearableEmitter {
52
+ private readonly custom;
53
+ private filePath;
54
+ add<T extends BlockDefinition>(id: IdInput, definition: T): T;
55
+ emit(acceptor: Acceptor): Promise<void>;
56
+ clear(): void;
57
+ }
58
+ export {};
@@ -0,0 +1,58 @@
1
+ import CustomEmitter from "../custom.js";
2
+ function resolveProperties(from) {
3
+ if ("copy" in from)
4
+ return from.copy;
5
+ return from;
6
+ }
7
+ export class AbstractBlockDefinitionRules {
8
+ models;
9
+ blockstates;
10
+ loot;
11
+ constructor(models, blockstates, loot) {
12
+ this.models = models;
13
+ this.blockstates = blockstates;
14
+ this.loot = loot;
15
+ }
16
+ basic(id, { type, ...properties }, options) {
17
+ if (options?.model !== false)
18
+ this.models.cubeAll(id);
19
+ if (options?.blockstate !== false)
20
+ this.blockstates.basic(id);
21
+ if (options?.loot !== false)
22
+ this.loot.block(id);
23
+ return this.add(id, {
24
+ type: type ?? "basic",
25
+ properties: resolveProperties(properties),
26
+ });
27
+ }
28
+ cog(id, { type, large = false, ...properties }, options) {
29
+ if (options?.model !== false)
30
+ this.models.cog(id, large);
31
+ if (options?.blockstate !== false)
32
+ this.blockstates.cog(id);
33
+ if (options?.loot !== false)
34
+ this.loot.block(id);
35
+ return this.add(id, {
36
+ type: type ?? "create:cog",
37
+ large,
38
+ properties: resolveProperties(properties),
39
+ });
40
+ }
41
+ }
42
+ export default class BlockDefinitionEmitter extends AbstractBlockDefinitionRules {
43
+ custom = new CustomEmitter(this.filePath);
44
+ filePath(id) {
45
+ return `content/${id.namespace}/block/${id.path}.json`;
46
+ }
47
+ add(id, definition) {
48
+ this.custom.add(id, definition);
49
+ return definition;
50
+ }
51
+ emit(acceptor) {
52
+ return this.custom.emit(acceptor);
53
+ }
54
+ clear() {
55
+ this.custom.clear();
56
+ }
57
+ }
58
+ //# sourceMappingURL=blockDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockDefinition.js","sourceRoot":"","sources":["../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,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE5D,IAAI,OAAO,EAAE,IAAI,KAAK,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEjD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;YAClB,IAAI,EAAE,IAAI,IAAI,YAAY;YAC1B,KAAK;YACL,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,sBACnB,SAAQ,4BAA4B;IAGnB,MAAM,GAAG,IAAI,aAAa,CAAkB,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEpE,QAAQ,CAAC,EAAM;QACrB,OAAO,WAAW,EAAE,CAAC,SAAS,UAAU,EAAE,CAAC,IAAI,OAAO,CAAC;IACzD,CAAC;IAED,GAAG,CAA4B,EAAW,EAAE,UAAa;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,CAAC,QAAkB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { IdInput } from "../../common/id.js";
2
+ import type { BlockstateRules } from "../assets/blockstates.js";
3
+ import type { ModelRules } from "../assets/models.js";
4
+ import type { LootRules } from "../data/loot.js";
5
+ import type { BlockDefinitionRules } from "./blockDefinition.js";
6
+ type CurriedFunction<TRest extends unknown[], TReturn> = (...args: TRest) => TReturn;
7
+ type InferCurriedFunction<T> = T extends (sliced: any, ...args: infer TRest) => infer TReturn ? CurriedFunction<TRest, TReturn> : never;
8
+ export type BlockDefinitionRulesWithoutId = {
9
+ [K in keyof BlockDefinitionRules]: InferCurriedFunction<BlockDefinitionRules[K]>;
10
+ };
11
+ export default function createInnerBlockDefinitionBuilder(id: IdInput, models: ModelRules, blockstates: BlockstateRules, loot: LootRules): BlockDefinitionRulesWithoutId;
12
+ export {};
@@ -0,0 +1,32 @@
1
+ import { AbstractBlockDefinitionRules } from "./blockDefinition.js";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ class InnerBlockDefinitionRules extends AbstractBlockDefinitionRules {
4
+ add(id, definition) {
5
+ return definition ?? id;
6
+ }
7
+ }
8
+ function curry(func, dummy) {
9
+ return function (...args) {
10
+ return func.call(this, dummy, ...args);
11
+ };
12
+ }
13
+ /**
14
+ * Modifies emitter
15
+ */
16
+ function createCurriedEmitter(id, emitter) {
17
+ const methods = Object.getOwnPropertyNames(AbstractBlockDefinitionRules.prototype).filter((it) => it !== "constructor");
18
+ const out = emitter;
19
+ methods.forEach((key) => {
20
+ const func = emitter[key];
21
+ if (typeof func === "function") {
22
+ out[key] = curry(func, id).bind(emitter);
23
+ }
24
+ });
25
+ return out;
26
+ }
27
+ /* eslint-enable @typescript-eslint/no-explicit-any */
28
+ export default function createInnerBlockDefinitionBuilder(id, models, blockstates, loot) {
29
+ const inner = new InnerBlockDefinitionRules(models, blockstates, loot);
30
+ return createCurriedEmitter(id, inner);
31
+ }
32
+ //# sourceMappingURL=innerBlockDefinition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"innerBlockDefinition.js","sourceRoot":"","sources":["../../../src/emit/content/innerBlockDefinition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,uDAAuD;AAEvD,MAAM,yBAA0B,SAAQ,4BAA4B;IAClE,GAAG,CAA4B,EAAe,EAAE,UAAc;QAC5D,OAAO,UAAU,IAAK,EAAQ,CAAC;IACjC,CAAC;CACF;AAYD,SAAS,KAAK,CAKZ,IAAO,EAAE,KAAc;IACvB,OAAO,UAAyB,GAA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