@nodecraft/rendermite 1.8.0 → 1.10.0
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.
- package/README.md +9 -1
- package/dist/atlas/registry.d.ts +3 -3
- package/dist/atlas/sources.d.ts +1 -1
- package/dist/{atlas-pack-C56gzqAg.d.ts → atlas-pack-BUadroKy.d.ts} +1 -1
- package/dist/biomes-BGOF6gRM.js +1100 -0
- package/dist/biomes-CnnhDCnk.d.ts +59 -0
- package/dist/{blend-C5UYzink.d.ts → blend-mJAeQB3C.d.ts} +1 -1
- package/dist/block-behaviour-BBslelpW.d.ts +673 -0
- package/dist/block-behaviour-DVjqeSkv.js +180 -0
- package/dist/block-overrides-XtxICunI.js +77 -0
- package/dist/blocks/atlas-pack.d.ts +1 -1
- package/dist/blocks/biomes.d.ts +2 -2
- package/dist/blocks/biomes.js +2 -2
- package/dist/blocks/block-behaviour.d.ts +2 -0
- package/dist/blocks/block-behaviour.js +2 -0
- package/dist/blocks/block-entities.d.ts +3 -3
- package/dist/blocks/block-overrides.d.ts +26 -0
- package/dist/blocks/block-overrides.js +2 -0
- package/dist/blocks/cli.js +1 -1
- package/dist/blocks/datapack.d.ts +2 -0
- package/dist/blocks/datapack.js +2 -0
- package/dist/blocks/ender-storage.d.ts +2 -2
- package/dist/blocks/entities.d.ts +3 -3
- package/dist/blocks/entity-geo.d.ts +1 -1
- package/dist/blocks/entity-models.d.ts +4 -13
- package/dist/blocks/entity-models.js +1 -1
- package/dist/blocks/entity-sizes.d.ts +25 -0
- package/dist/blocks/entity-sizes.js +2 -0
- package/dist/blocks/export.d.ts +1 -1
- package/dist/blocks/export.js +1 -1
- package/dist/blocks/game-rules.d.ts +2 -0
- package/dist/blocks/game-rules.js +2 -0
- package/dist/blocks/geo-blocks.d.ts +2 -2
- package/dist/blocks/item-sprites.d.ts +4 -4
- package/dist/blocks/light-bytecode.d.ts +2 -174
- package/dist/blocks/light-bytecode.js +1 -1
- package/dist/blocks/light-eval.d.ts +1 -1
- package/dist/blocks/light.d.ts +11 -1
- package/dist/blocks/light.js +1 -1
- package/dist/blocks/names.d.ts +2 -0
- package/dist/blocks/names.js +2 -0
- package/dist/blocks/obj-mesh.d.ts +1 -1
- package/dist/blocks/pack-format.d.ts +2 -2
- package/dist/blocks/sprite-sheet.d.ts +3 -3
- package/dist/blocks/states.d.ts +2 -0
- package/dist/blocks/states.js +2 -0
- package/dist/blocks/tints.d.ts +1 -1
- package/dist/{classfile-CiIDF3vc.js → classfile-BJSs3JH0.js} +23 -3
- package/dist/{classfile-CsLXlh5z.d.ts → classfile-Dzn0gW9M.d.ts} +6 -0
- package/dist/{cli-Dw1Q5CPR.js → cli-DwMPoX0I.js} +10 -5
- package/dist/cli.js +7 -7
- package/dist/datapack-CmEg0Vko.d.ts +15 -0
- package/dist/datapack-D6eH46ay.js +71 -0
- package/dist/{descriptor-CmkIkDKL.js → descriptor-Dz2cR-BH.js} +2 -2
- package/dist/{discovery-Cmir3QfC.d.ts → discovery-DWe_kX8W.d.ts} +1 -1
- package/dist/dynamic/generators.d.ts +1 -1
- package/dist/{encode-Br_vPrd8.d.ts → encode-BNEYHHR0.d.ts} +1 -1
- package/dist/entities/classfile.d.ts +1 -1
- package/dist/entities/classfile.js +1 -1
- package/dist/entities/geo-model.d.ts +1 -1
- package/dist/entities/inherit.d.ts +2 -2
- package/dist/entities/inherit.js +1 -1
- package/dist/entities/jar-classes.js +1 -1
- package/dist/entities/link.d.ts +2 -2
- package/dist/entities/link.js +1 -1
- package/dist/entities/mappings.d.ts +1 -1
- package/dist/entities/mappings.js +1 -1
- package/dist/entities/model-bytecode.d.ts +1 -1
- package/dist/entities/model-bytecode.js +1 -1
- package/dist/entities/model-code.d.ts +1 -1
- package/dist/entities/model-code.js +1 -1
- package/dist/{entity-models-BGiy3pey.js → entity-models-vFl_EwfA.js} +24 -5
- package/dist/entity-sizes-DspxgSUA.js +194 -0
- package/dist/{export-t8X_oRws.js → export-ArMmWuCC.js} +62 -5
- package/dist/{export-J13L9Lqu.d.ts → export-CqeTinYL.d.ts} +19 -2
- package/dist/{face-DqEd9G_U.d.ts → face-uWXECGNr.d.ts} +2 -2
- package/dist/game-rules-BDPTopVW.js +104 -0
- package/dist/game-rules-ThvdDG3B.d.ts +16 -0
- package/dist/{generators-BnIzAftW.d.ts → generators-hu_vk10m.d.ts} +1 -1
- package/dist/{geo-C9QYeLVN.d.ts → geo-DsWwuC5o.d.ts} +4 -4
- package/dist/index.d.ts +20 -20
- package/dist/index.js +8 -8
- package/dist/{inherit-BUn0Cve9.js → inherit-DJ45bOB_.js} +2 -2
- package/dist/items/blockstate.d.ts +1 -1
- package/dist/items/discovery.d.ts +1 -1
- package/dist/{jar-B5iRZQeL.d.ts → jar-4Jg7ufWK.d.ts} +1 -1
- package/dist/{jar-CBYPMbw7.js → jar-DvofBm71.js} +2 -2
- package/dist/{jar-classes-CSm7qq1R.js → jar-classes-0wqWbTax.js} +2 -2
- package/dist/{light-CyRhYulM.js → light-CZRA1pOj.js} +48 -6
- package/dist/{light-bytecode-Cpyuxo9b.js → light-bytecode-BqpQWqP7.js} +144 -46
- package/dist/{light-eval-D9x0ufZx.d.ts → light-eval-C0-kt0bp.d.ts} +1 -1
- package/dist/{link-Cuhyrz07.js → link-IDjVJ2Ij.js} +1 -1
- package/dist/{loader-DSir1-P0.d.ts → loader-BYyPIs9f.d.ts} +1 -1
- package/dist/{loader-59_eMa8e.d.ts → loader-C4gsX_wO.d.ts} +1 -1
- package/dist/{manager-exOIcdyx.d.ts → manager-Ct0dEOMg.d.ts} +6 -0
- package/dist/{manager-BNibYkmI.js → manager-D6zXmFrO.js} +6 -0
- package/dist/{mappings-Ep6ko0rg.js → mappings-DEl_7xxQ.js} +18 -1
- package/dist/{mappings-USwcjtcH.d.ts → mappings-DhOPQTgV.d.ts} +5 -0
- package/dist/{model-bytecode-VaLUQfGO.js → model-bytecode-CXYAZ5dX.js} +1 -1
- package/dist/{model-code-Csc3bs3h.d.ts → model-code-BclYt1do.d.ts} +1 -1
- package/dist/{model-code-DbN2uVhp.js → model-code-BmA5ilgt.js} +1 -1
- package/dist/models/loader.d.ts +1 -1
- package/dist/{models-CZjCOjs4.js → models-BsYA-NZg.js} +1 -1
- package/dist/mods/models.d.ts +1 -1
- package/dist/mods/models.js +1 -1
- package/dist/mods/prepare.d.ts +1 -1
- package/dist/mods/prepare.js +1 -1
- package/dist/mods/synthesize.d.ts +2 -2
- package/dist/mods/tints.d.ts +2 -2
- package/dist/mods/tints.js +1 -1
- package/dist/names-D1abAVIB.d.ts +10 -0
- package/dist/names-GLa5TyL7.js +36 -0
- package/dist/{obj-mesh-ydhVfLKs.d.ts → obj-mesh-CzL0lOlJ.d.ts} +2 -2
- package/dist/output/encode.d.ts +1 -1
- package/dist/pack.d.ts +7 -6
- package/dist/{pipeline-DFuQa8ZT.d.ts → pipeline-DuPF3sap.d.ts} +3 -3
- package/dist/{pipeline-CRTQGba7.js → pipeline-Q_185kY6.js} +1 -1
- package/dist/{prepare-OS7wL3jv.d.ts → prepare-BPzsZI_S.d.ts} +1 -1
- package/dist/{prepare-6pH3CNpg.d.ts → prepare-Ce5SpR7Y.d.ts} +1 -1
- package/dist/{prepare-C61BcwFA.js → prepare-DkJkZXuQ.js} +2 -2
- package/dist/{prepare-DxPEu9mo.js → prepare-sj36BP90.js} +4 -4
- package/dist/{rasterizer-C2wgJZ6J.d.ts → rasterizer-DjnurUgD.d.ts} +1 -1
- package/dist/render/blend.d.ts +1 -1
- package/dist/render/compose.d.ts +2 -2
- package/dist/render/entity-fallback.d.ts +6 -6
- package/dist/render/face.d.ts +1 -1
- package/dist/render/fluid-bucket.d.ts +2 -2
- package/dist/render/geo.d.ts +1 -1
- package/dist/render/legacy-tints.d.ts +2 -2
- package/dist/render/obj.d.ts +5 -5
- package/dist/render/pipeline.d.ts +1 -1
- package/dist/render/pipeline.js +1 -1
- package/dist/render/rasterizer.d.ts +1 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/tints.d.ts +1 -1
- package/dist/{renderer-DbUmTFDb.d.ts → renderer-QgROYvPv.d.ts} +5 -5
- package/dist/resources/descriptor.d.ts +1 -1
- package/dist/resources/descriptor.js +1 -1
- package/dist/resources/entity-textures.d.ts +2 -2
- package/dist/resources/jar.d.ts +1 -1
- package/dist/resources/jar.js +1 -1
- package/dist/resources/manager.d.ts +1 -1
- package/dist/resources/manager.js +1 -1
- package/dist/resources/synthetic.d.ts +1 -1
- package/dist/resources/zip-reader.js +1 -1
- package/dist/{run-DYcem_Vv.js → run-5yX5KRiI.js} +4 -4
- package/dist/{run-CLjF0N2d.d.ts → run-CxB1qabg.d.ts} +2 -2
- package/dist/run.d.ts +1 -1
- package/dist/run.js +1 -1
- package/dist/{sources-e5D09Jz_.d.ts → sources-sFtealLJ.d.ts} +1 -1
- package/dist/states-BvoZA-ql.js +40 -0
- package/dist/states-OzneeCTU.d.ts +25 -0
- package/dist/{synthetic-B3R7mW9k.d.ts → synthetic-CWtFtAkR.d.ts} +1 -1
- package/dist/textures/loader.d.ts +1 -1
- package/dist/textures/overlay.d.ts +1 -1
- package/dist/{tints-uLl1CIkC.d.ts → tints-B0a1K11c.d.ts} +2 -2
- package/dist/{tints-CWQz6UkM.js → tints-CZeyKzMv.js} +2 -2
- package/dist/{tints-CQX8a1F0.d.ts → tints-DwFmEkf3.d.ts} +2 -2
- package/dist/versions/legacy-reshape.d.ts +1 -1
- package/dist/versions/prepare.d.ts +1 -1
- package/dist/versions/prepare.js +1 -1
- package/dist/workers/render-worker.d.ts +2 -2
- package/dist/workers/render-worker.js +2 -2
- package/dist/{zip-reader-zx3kdSq4.js → zip-reader-onwEVMea.js} +4 -4
- package/package.json +1 -1
- package/dist/biomes-5ZwYxMYe.js +0 -384
- package/dist/biomes-CJDJQqJb.d.ts +0 -38
- package/dist/pack-format-BqWf-DNc.d.ts +0 -350
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
//#region src/blocks/block-behaviour.ts
|
|
2
|
+
const PUSH_REACTIONS = /* @__PURE__ */ new Set([
|
|
3
|
+
"destroy",
|
|
4
|
+
"block",
|
|
5
|
+
"ignore",
|
|
6
|
+
"push_only"
|
|
7
|
+
]);
|
|
8
|
+
function num(value) {
|
|
9
|
+
return value?.kind === "number" ? value.value : null;
|
|
10
|
+
}
|
|
11
|
+
function field(handle, name) {
|
|
12
|
+
return handle.fields.get(`mapped:${name}`) ?? handle.fields.get(name);
|
|
13
|
+
}
|
|
14
|
+
/** A `MapColor` (`MaterialColor` before 1.20) is constructed as `(id, rgb)`; its id is the first. */
|
|
15
|
+
function mapColorId(value) {
|
|
16
|
+
if (value?.kind !== "object") return null;
|
|
17
|
+
const args = value.handle.ctorArgs ?? [];
|
|
18
|
+
const id = num(args[0]);
|
|
19
|
+
if (args.length === 2 && id !== null && num(args[1]) !== null && id >= 0 && id < 64) return id;
|
|
20
|
+
if (args[0]?.kind !== "string" || args[1]?.kind !== "number") return null;
|
|
21
|
+
for (const arg of args) {
|
|
22
|
+
const nested = arg.kind === "object" && arg.handle !== value.handle ? mapColorId(arg) : null;
|
|
23
|
+
if (nested !== null) return nested;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
/** An enum constant's serialized name: the lower-cased constant name it was constructed with. */
|
|
28
|
+
function enumName(value) {
|
|
29
|
+
const name = value?.kind === "object" ? value.handle.ctorArgs?.[0] : void 0;
|
|
30
|
+
return name?.kind === "string" ? name.value.toLowerCase() : null;
|
|
31
|
+
}
|
|
32
|
+
/** The chain of `Properties` a block's came from, oldest copy first, so later calls win. */
|
|
33
|
+
function lineage(props) {
|
|
34
|
+
const chain = [];
|
|
35
|
+
for (let at = props; at && !chain.includes(at); at = at.copyOf) chain.unshift(at);
|
|
36
|
+
return chain;
|
|
37
|
+
}
|
|
38
|
+
/** The `Material` a pre-1.20 `Properties` was constructed with, when it was. */
|
|
39
|
+
function materialOf(props) {
|
|
40
|
+
for (const handle of lineage(props)) for (const arg of handle.ctorArgs ?? []) if (arg.kind === "object" && field(arg.handle, "replaceable") !== void 0) return arg.handle;
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The colour a block's `Properties` state: a `mapColor` call, the colour a pre-1.20 `Properties` was
|
|
45
|
+
* constructed with, or its `Material`'s, latest first. A constant or a function of state.
|
|
46
|
+
*/
|
|
47
|
+
function statedMapColor(props) {
|
|
48
|
+
const material = materialOf(props);
|
|
49
|
+
let colour = material ? field(material, "color") : void 0;
|
|
50
|
+
for (const handle of lineage(props)) {
|
|
51
|
+
colour = (handle.ctorArgs ?? []).find((arg) => arg.kind === "lambda" || mapColorId(arg) !== null) ?? colour;
|
|
52
|
+
for (const call of handle.calls ?? []) if (call.name === "mapColor") colour = call.args[0];
|
|
53
|
+
}
|
|
54
|
+
return colour;
|
|
55
|
+
}
|
|
56
|
+
/** A float as Java wrote it: `0.3F` is 0.30000001192092896 as a double, and 0.3 is what the code says. */
|
|
57
|
+
function float32(value) {
|
|
58
|
+
for (let digits = 1; digits < 10; digits++) {
|
|
59
|
+
const candidate = Number(value.toPrecision(digits));
|
|
60
|
+
if (Math.fround(candidate) === Math.fround(value)) return candidate;
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
function flag(value) {
|
|
65
|
+
return value.kind === "number" ? value.value === 0 ? 0 : 1 : null;
|
|
66
|
+
}
|
|
67
|
+
function blockBehaviour(registration, extraction, overrides = null) {
|
|
68
|
+
const props = registration.props;
|
|
69
|
+
if (!props) return null;
|
|
70
|
+
const failures = [];
|
|
71
|
+
const behaviour = {
|
|
72
|
+
hardness: 0,
|
|
73
|
+
resistance: 0
|
|
74
|
+
};
|
|
75
|
+
const mapColor = statedMapColor(props);
|
|
76
|
+
const material = materialOf(props);
|
|
77
|
+
if (material) {
|
|
78
|
+
if (num(field(material, "replaceable")) === 1) behaviour.replaceable = true;
|
|
79
|
+
if (num(field(material, "liquid")) === 1) behaviour.liquid = true;
|
|
80
|
+
if (num(field(material, "flammable")) === 1) behaviour.flammable = true;
|
|
81
|
+
if (num(field(material, "alwaysDestroyable")) === 0) behaviour.requiresTool = true;
|
|
82
|
+
const reaction = enumName(field(material, "pushReaction"));
|
|
83
|
+
if (reaction && PUSH_REACTIONS.has(reaction)) behaviour.pushReaction = reaction;
|
|
84
|
+
}
|
|
85
|
+
for (const handle of lineage(props)) for (const call of handle.calls ?? []) {
|
|
86
|
+
const [first, second] = call.args;
|
|
87
|
+
switch (call.name) {
|
|
88
|
+
case "strength":
|
|
89
|
+
behaviour.hardness = float32(num(first) ?? behaviour.hardness);
|
|
90
|
+
behaviour.resistance = float32(num(second ?? first) ?? behaviour.resistance);
|
|
91
|
+
break;
|
|
92
|
+
case "destroyTime":
|
|
93
|
+
behaviour.hardness = float32(num(first) ?? behaviour.hardness);
|
|
94
|
+
break;
|
|
95
|
+
case "explosionResistance":
|
|
96
|
+
behaviour.resistance = float32(num(first) ?? behaviour.resistance);
|
|
97
|
+
break;
|
|
98
|
+
case "instabreak":
|
|
99
|
+
behaviour.hardness = 0;
|
|
100
|
+
behaviour.resistance = 0;
|
|
101
|
+
break;
|
|
102
|
+
case "noCollission":
|
|
103
|
+
case "noCollision":
|
|
104
|
+
behaviour.collision = false;
|
|
105
|
+
behaviour.occludes = false;
|
|
106
|
+
break;
|
|
107
|
+
case "noOcclusion":
|
|
108
|
+
behaviour.occludes = false;
|
|
109
|
+
break;
|
|
110
|
+
case "replaceable":
|
|
111
|
+
behaviour.replaceable = true;
|
|
112
|
+
break;
|
|
113
|
+
case "air":
|
|
114
|
+
behaviour.air = true;
|
|
115
|
+
break;
|
|
116
|
+
case "liquid":
|
|
117
|
+
behaviour.liquid = true;
|
|
118
|
+
break;
|
|
119
|
+
case "ignitedByLava":
|
|
120
|
+
behaviour.flammable = true;
|
|
121
|
+
break;
|
|
122
|
+
case "requiresCorrectToolForDrops":
|
|
123
|
+
behaviour.requiresTool = true;
|
|
124
|
+
break;
|
|
125
|
+
case "randomTicks":
|
|
126
|
+
behaviour.randomTicks = true;
|
|
127
|
+
break;
|
|
128
|
+
case "pushReaction": {
|
|
129
|
+
const reaction = enumName(first);
|
|
130
|
+
if (reaction === "normal") delete behaviour.pushReaction;
|
|
131
|
+
else if (reaction && PUSH_REACTIONS.has(reaction)) behaviour.pushReaction = reaction;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "friction":
|
|
135
|
+
case "speedFactor":
|
|
136
|
+
case "jumpFactor": {
|
|
137
|
+
const value = num(first);
|
|
138
|
+
if (value !== null) behaviour[call.name] = float32(value);
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (mapColor?.kind === "lambda") {
|
|
144
|
+
const folded = extraction.tabulate(mapColor, mapColorId);
|
|
145
|
+
if ("failure" in folded) failures.push(`map colour: ${folded.failure}`);
|
|
146
|
+
else behaviour.mapColor = folded.value;
|
|
147
|
+
} else if (mapColor !== void 0) {
|
|
148
|
+
const id = mapColorId(mapColor);
|
|
149
|
+
if (id === null) failures.push("map colour is a value the interpreter could not identify");
|
|
150
|
+
else behaviour.mapColor = id;
|
|
151
|
+
}
|
|
152
|
+
const answer = (names, read) => {
|
|
153
|
+
const method = overrides?.of(names) ?? null;
|
|
154
|
+
if (!method) return null;
|
|
155
|
+
const folded = extraction.tabulateMethod(registration, method, read);
|
|
156
|
+
if ("failure" in folded) {
|
|
157
|
+
failures.push(`${names[0]}: ${folded.failure}`);
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
return folded.value;
|
|
161
|
+
};
|
|
162
|
+
const shape = answer(["useShapeForLightOcclusion"], flag);
|
|
163
|
+
if (shape === 1) behaviour.lightShape = true;
|
|
164
|
+
else if (shape !== null && typeof shape === "object") behaviour.lightShape = shape;
|
|
165
|
+
const lightBlock = answer(["getLightBlock", "getLightDampening"], (value) => value.kind === "number" ? value.value : null);
|
|
166
|
+
if (lightBlock !== null) behaviour.lightBlock = lightBlock;
|
|
167
|
+
const fluidMethod = overrides?.of(["getFluidState"]);
|
|
168
|
+
const fluid = fluidMethod && overrides ? overrides.fluid(fluidMethod) : null;
|
|
169
|
+
if (fluid) behaviour.fluid = fluid;
|
|
170
|
+
const renderShape = overrides?.of(["getRenderShape"]);
|
|
171
|
+
if (renderShape && overrides?.invisible(renderShape)) behaviour.invisible = true;
|
|
172
|
+
if (overrides?.of(["skipRendering"])) behaviour.hidesSharedFaces = true;
|
|
173
|
+
if (answer(["isAir"], flag) === 1) behaviour.air = true;
|
|
174
|
+
return {
|
|
175
|
+
behaviour,
|
|
176
|
+
failures
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { statedMapColor as n, blockBehaviour as t };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { n as instructions } from "./entity-sizes-DspxgSUA.js";
|
|
2
|
+
//#region src/blocks/block-overrides.ts
|
|
3
|
+
/**
|
|
4
|
+
* Where a block's own class answers a question itself, rather than leaving it to its `Properties`.
|
|
5
|
+
*
|
|
6
|
+
* Some of what a block does is a method override, not a builder call: a stair or a slab tests its
|
|
7
|
+
* shape for light (`useShapeForLightOcclusion`), tinted glass stops all light (`getLightBlock`), kelp is
|
|
8
|
+
* always under water (`getFluidState`), and before 1.16.2 an air block said so by overriding `isAir`.
|
|
9
|
+
* The override is found by walking the block's class chain for a method of that original name, and it
|
|
10
|
+
* only counts where a class below the base declares it: the base's own is the default answer.
|
|
11
|
+
*/
|
|
12
|
+
/** `getstatic`, `invokevirtual` and `invokeinterface`: the instructions whose target says what code reads. */
|
|
13
|
+
const READS = /* @__PURE__ */ new Set([
|
|
14
|
+
178,
|
|
15
|
+
182,
|
|
16
|
+
185
|
|
17
|
+
]);
|
|
18
|
+
/** How far up a block's class chain to look; vanilla's deepest is well under this. */
|
|
19
|
+
const MAX_DEPTH = 16;
|
|
20
|
+
/** The nearest override of one of `names` above `blockType`, or null where only the base declares it. */
|
|
21
|
+
function overrideOf(source, blockType, names) {
|
|
22
|
+
const declarations = [];
|
|
23
|
+
let at = source.resolve(blockType);
|
|
24
|
+
for (let depth = 0; at && depth < MAX_DEPTH; depth++) {
|
|
25
|
+
const owner = at.thisClass;
|
|
26
|
+
const method = at.methods.find((candidate) => candidate.code && names.includes(source.nameOf({
|
|
27
|
+
owner,
|
|
28
|
+
name: candidate.name,
|
|
29
|
+
descriptor: candidate.descriptor
|
|
30
|
+
}, false)));
|
|
31
|
+
if (method) declarations.push({
|
|
32
|
+
owner,
|
|
33
|
+
name: method.name,
|
|
34
|
+
descriptor: method.descriptor
|
|
35
|
+
});
|
|
36
|
+
at = at.superClass ? source.resolve(at.superClass) : null;
|
|
37
|
+
}
|
|
38
|
+
return declarations.length > 1 ? declarations[0] : null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The constants an override reads, by original name, and whether it reads a block property: enough to
|
|
42
|
+
* answer from its code without running it. Kelp's `getFluidState` reads `Fluids.WATER` and nothing
|
|
43
|
+
* else; a barrier's `getRenderShape` reads `RenderShape.INVISIBLE`. One that reads a property
|
|
44
|
+
* (`waterlogged`) answers per state, which the state already says.
|
|
45
|
+
*/
|
|
46
|
+
function constantsReadBy(source, method) {
|
|
47
|
+
const classFile = source.resolve(method.owner);
|
|
48
|
+
const code = classFile?.methods.find((candidate) => candidate.name === method.name && candidate.descriptor === method.descriptor)?.code;
|
|
49
|
+
if (!classFile || !code) return null;
|
|
50
|
+
const statics = /* @__PURE__ */ new Set();
|
|
51
|
+
let readsState = false;
|
|
52
|
+
for (const { op, index } of instructions(code)) {
|
|
53
|
+
const reference = READS.has(op) ? classFile.reference(index) : null;
|
|
54
|
+
if (!reference) continue;
|
|
55
|
+
const name = source.nameOf(reference, op === 178);
|
|
56
|
+
if (op === 178) statics.add(name);
|
|
57
|
+
else if (name === "getValue") readsState = true;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
statics,
|
|
61
|
+
readsState
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** The fluid an override of `getFluidState` holds in every state, or null where it depends on one. */
|
|
65
|
+
function constantFluidOf(source, method) {
|
|
66
|
+
const read = constantsReadBy(source, method);
|
|
67
|
+
if (!read || read.readsState) return null;
|
|
68
|
+
if (read.statics.has("WATER")) return "water";
|
|
69
|
+
return read.statics.has("LAVA") ? "lava" : null;
|
|
70
|
+
}
|
|
71
|
+
/** Whether an override of `getRenderShape` always answers `INVISIBLE`, as a barrier's and a light block's do. */
|
|
72
|
+
function alwaysInvisible(source, method) {
|
|
73
|
+
const read = constantsReadBy(source, method);
|
|
74
|
+
return read !== null && !read.readsState && read.statics.has("INVISIBLE") && !read.statics.has("MODEL");
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { overrideOf as i, constantFluidOf as n, constantsReadBy as r, alwaysInvisible as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "../atlas-pack-
|
|
1
|
+
import { a as PackedRect, i as PackedPage, n as PackOptions, o as packAtlas, r as PackedAtlas, t as PackEntry } from "../atlas-pack-BUadroKy.js";
|
|
2
2
|
export { PackEntry, PackOptions, PackedAtlas, PackedPage, PackedRect, packAtlas };
|
package/dist/blocks/biomes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as buildBiomeClimates, i as
|
|
2
|
-
export { BiomeClimate, BiomeClimatePack, DEFAULT_WATER_COLOR, VANILLA_BIOME_CLIMATES, buildBiomeClimates, parseBiomeClimate };
|
|
1
|
+
import { a as LegacyBiome, c as buildBiomeClimates, i as LEGACY_BIOMES, l as parseBiomeClimate, n as BiomeClimatePack, o as PRE_JAR_BIOMES, r as DEFAULT_WATER_COLOR, s as VANILLA_BIOME_CLIMATES, t as BiomeClimate, u as vanillaBiomesFor } from "../biomes-CnnhDCnk.js";
|
|
2
|
+
export { BiomeClimate, BiomeClimatePack, DEFAULT_WATER_COLOR, LEGACY_BIOMES, LegacyBiome, PRE_JAR_BIOMES, VANILLA_BIOME_CLIMATES, buildBiomeClimates, parseBiomeClimate, vanillaBiomesFor };
|
package/dist/blocks/biomes.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { DEFAULT_WATER_COLOR, VANILLA_BIOME_CLIMATES, buildBiomeClimates, parseBiomeClimate };
|
|
1
|
+
import { a as buildBiomeClimates, i as VANILLA_BIOME_CLIMATES, n as LEGACY_BIOMES, o as parseBiomeClimate, r as PRE_JAR_BIOMES, s as vanillaBiomesFor, t as DEFAULT_WATER_COLOR } from "../biomes-BGOF6gRM.js";
|
|
2
|
+
export { DEFAULT_WATER_COLOR, LEGACY_BIOMES, PRE_JAR_BIOMES, VANILLA_BIOME_CLIMATES, buildBiomeClimates, parseBiomeClimate, vanillaBiomesFor };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import { i as TextureLoader } from "../loader-
|
|
3
|
-
import { t as ModelLoader } from "../loader-
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
2
|
+
import { i as TextureLoader } from "../loader-C4gsX_wO.js";
|
|
3
|
+
import { t as ModelLoader } from "../loader-BYyPIs9f.js";
|
|
4
4
|
//#region src/blocks/block-entities.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* What the table is allowed to look at. The vanilla families are a lookup, but
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { d as MemberReference } from "../block-behaviour-BBslelpW.js";
|
|
2
|
+
import { t as ClassFile } from "../classfile-Dzn0gW9M.js";
|
|
3
|
+
//#region src/blocks/block-overrides.d.ts
|
|
4
|
+
interface OverrideSource {
|
|
5
|
+
resolve: (internalName: string) => ClassFile | null;
|
|
6
|
+
/** A member's original name, for a jar that spells the game's own obfuscated. */
|
|
7
|
+
nameOf: (reference: MemberReference, field: boolean) => string;
|
|
8
|
+
}
|
|
9
|
+
/** The nearest override of one of `names` above `blockType`, or null where only the base declares it. */
|
|
10
|
+
declare function overrideOf(source: OverrideSource, blockType: string, names: readonly string[]): MemberReference | null;
|
|
11
|
+
/**
|
|
12
|
+
* The constants an override reads, by original name, and whether it reads a block property: enough to
|
|
13
|
+
* answer from its code without running it. Kelp's `getFluidState` reads `Fluids.WATER` and nothing
|
|
14
|
+
* else; a barrier's `getRenderShape` reads `RenderShape.INVISIBLE`. One that reads a property
|
|
15
|
+
* (`waterlogged`) answers per state, which the state already says.
|
|
16
|
+
*/
|
|
17
|
+
declare function constantsReadBy(source: OverrideSource, method: MemberReference): {
|
|
18
|
+
statics: Set<string>;
|
|
19
|
+
readsState: boolean;
|
|
20
|
+
} | null;
|
|
21
|
+
/** The fluid an override of `getFluidState` holds in every state, or null where it depends on one. */
|
|
22
|
+
declare function constantFluidOf(source: OverrideSource, method: MemberReference): 'water' | 'lava' | null;
|
|
23
|
+
/** Whether an override of `getRenderShape` always answers `INVISIBLE`, as a barrier's and a light block's do. */
|
|
24
|
+
declare function alwaysInvisible(source: OverrideSource, method: MemberReference): boolean;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { OverrideSource, alwaysInvisible, constantFluidOf, constantsReadBy, overrideOf };
|
package/dist/blocks/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as runBlocksCli } from "../cli-
|
|
1
|
+
import { t as runBlocksCli } from "../cli-DwMPoX0I.js";
|
|
2
2
|
export { runBlocksCli };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import {
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
2
|
+
import { P as BlockPackModel } from "../block-behaviour-BBslelpW.js";
|
|
3
3
|
//#region src/blocks/ender-storage.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Ender Storage feeds this OBJ through CodeChickenLib's `swapYZ`, translates it almost exactly onto
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import { i as TextureLoader } from "../loader-
|
|
3
|
-
import {
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
2
|
+
import { i as TextureLoader } from "../loader-C4gsX_wO.js";
|
|
3
|
+
import { q as EntityPackEntry } from "../block-behaviour-BBslelpW.js";
|
|
4
4
|
//#region src/blocks/entities.d.ts
|
|
5
5
|
interface EntityPackResult {
|
|
6
6
|
entities: Record<string, EntityPackEntry>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import { D as EquipmentPack, T as EntityPackModel } from "../pack-format-BqWf-DNc.js";
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
3
2
|
import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
3
|
+
import { J as EntityPackModel, X as EquipmentPack } from "../block-behaviour-BBslelpW.js";
|
|
4
|
+
import { t as Mappings } from "../mappings-DhOPQTgV.js";
|
|
5
|
+
import { t as ModelCode } from "../model-code-BclYt1do.js";
|
|
6
6
|
//#region src/blocks/entity-models.d.ts
|
|
7
7
|
interface EntityGeometryResult {
|
|
8
8
|
/** Model id (the class it came from) → geometry. */
|
|
@@ -53,15 +53,6 @@ declare function collectEntityGeometry(options: CollectEntityGeometryOptions): P
|
|
|
53
53
|
* lowest to highest precedence, matching atlas source resolution when packs extend the vanilla file.
|
|
54
54
|
*/
|
|
55
55
|
declare function collectArmourTrims(resources: ResourceManager, spriteIds: Set<string>): Promise<EquipmentPack['trims']>;
|
|
56
|
-
/**
|
|
57
|
-
* Worn armour for the pack: one humanoid mesh, the sheets each material is drawn with, and which
|
|
58
|
-
* item is which.
|
|
59
|
-
*
|
|
60
|
-
* Materials are discovered from the sheets the version actually ships rather than listed, so a
|
|
61
|
-
* version that adds one — copper, in the 26 line — needs no edit here. The item ids are the one part
|
|
62
|
-
* the assets cannot answer, since nothing in them maps `iron_helmet` to `iron`: they follow the
|
|
63
|
-
* game's own naming, and each is confirmed against a real item model before being claimed.
|
|
64
|
-
*/
|
|
65
56
|
declare function collectEquipment(names: readonly string[], mappings: Mappings, read: (internal: string) => Promise<Uint8Array | null>, code: ModelCode, resources: ResourceManager | undefined, models: Record<string, EntityPackModel>, spriteIds: Set<string>): Promise<EquipmentPack | null>;
|
|
66
57
|
//#endregion
|
|
67
58
|
export { CollectEntityGeometryOptions, EntityGeometryResult, collectArmourTrims, collectEntityGeometry, collectEquipment };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectEntityGeometry, r as collectEquipment, t as collectArmourTrims } from "../entity-models-
|
|
1
|
+
import { n as collectEntityGeometry, r as collectEquipment, t as collectArmourTrims } from "../entity-models-vFl_EwfA.js";
|
|
2
2
|
export { collectArmourTrims, collectEntityGeometry, collectEquipment };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { t as ClassSource } from "../jar-classes-CSRrPAUy.js";
|
|
2
|
+
//#region src/blocks/entity-sizes.d.ts
|
|
3
|
+
interface Instruction {
|
|
4
|
+
op: number;
|
|
5
|
+
/** The pool index a two-byte operand names, for the loads and invokes this reads. */
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
/** Every instruction of a method, in order. */
|
|
9
|
+
declare function instructions(code: Uint8Array): Generator<Instruction>;
|
|
10
|
+
interface EntitySizeResult {
|
|
11
|
+
/** Entity id → [width, height], in blocks. */
|
|
12
|
+
sizes: Map<string, [number, number]>;
|
|
13
|
+
failures: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
declare function collectEntitySizes(options: {
|
|
19
|
+
classes: ClassSource;
|
|
20
|
+
version: string;
|
|
21
|
+
cacheDir: string;
|
|
22
|
+
entityIds: readonly string[];
|
|
23
|
+
}): Promise<EntitySizeResult>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { EntitySizeResult, collectEntitySizes, instructions };
|
package/dist/blocks/export.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-
|
|
1
|
+
import { i as exportBlockPack, n as BlockPackResult, r as ExportBlockPackOptions, t as BlockPackFailure } from "../export-CqeTinYL.js";
|
|
2
2
|
export { BlockPackFailure, BlockPackResult, ExportBlockPackOptions, exportBlockPack };
|
package/dist/blocks/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as exportBlockPack } from "../export-
|
|
1
|
+
import { t as exportBlockPack } from "../export-ArMmWuCC.js";
|
|
2
2
|
export { exportBlockPack };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import {
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
2
|
+
import { P as BlockPackModel } from "../block-behaviour-BBslelpW.js";
|
|
3
3
|
//#region src/blocks/geo-blocks.d.ts
|
|
4
4
|
interface GeoBlockOverride {
|
|
5
5
|
model: BlockPackModel;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ResourceManager } from "../manager-
|
|
2
|
-
import { i as TextureLoader } from "../loader-
|
|
3
|
-
import { t as ModelLoader } from "../loader-
|
|
4
|
-
import {
|
|
1
|
+
import { a as ResourceManager } from "../manager-Ct0dEOMg.js";
|
|
2
|
+
import { i as TextureLoader } from "../loader-C4gsX_wO.js";
|
|
3
|
+
import { t as ModelLoader } from "../loader-BYyPIs9f.js";
|
|
4
|
+
import { Q as ItemPackEntry } from "../block-behaviour-BBslelpW.js";
|
|
5
5
|
//#region src/blocks/item-sprites.d.ts
|
|
6
6
|
interface ItemSpriteFailure {
|
|
7
7
|
id: string;
|
|
@@ -1,174 +1,2 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
|
|
3
|
-
//#region src/blocks/light-bytecode.d.ts
|
|
4
|
-
/** A member reference as the constant pool spells it. */
|
|
5
|
-
interface MemberReference {
|
|
6
|
-
owner: string;
|
|
7
|
-
name: string;
|
|
8
|
-
descriptor: string;
|
|
9
|
-
}
|
|
10
|
-
/** What the caller supplies: how to find code, and how to rename a reference before looking. */
|
|
11
|
-
interface LightCodeSource {
|
|
12
|
-
/** The parsed class, or null for anything outside the jars (the JDK, a loader). */
|
|
13
|
-
resolve: (internalName: string) => ClassFile | null;
|
|
14
|
-
/**
|
|
15
|
-
* A reference as the jar spells it. A mod names the game's classes and members by their original
|
|
16
|
-
* names; against an obfuscated client those have to be renamed before they can be found.
|
|
17
|
-
*/
|
|
18
|
-
remap: (reference: MemberReference, field: boolean) => MemberReference;
|
|
19
|
-
remapClass: (internalName: string) => string;
|
|
20
|
-
/** Classes that are a block `Properties` builder, in every spelling the jars use. */
|
|
21
|
-
propsClasses: ReadonlySet<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Whether a class is the game's rather than a mod's. A mod export runs the game's own `Blocks` too,
|
|
24
|
-
* for the properties mods copy, and its registrations must not answer for a mod block that happens
|
|
25
|
-
* to share a name — `immersiveengineering:lantern` is not `minecraft:lantern`.
|
|
26
|
-
*/
|
|
27
|
-
isVanillaClass: (internalName: string) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Methods a block class may override to answer its own light: the game's `getLightValue(state)`
|
|
30
|
-
* before 1.16, when a lit furnace was an override rather than a lambda, and a loader's
|
|
31
|
-
* `getLightEmission(state, level, pos)`. `root` is the class whose implementation is the plain
|
|
32
|
-
* property read, so a call resolving there — `super.getLightValue(state)` — is answered from the
|
|
33
|
-
* block's `Properties`.
|
|
34
|
-
*/
|
|
35
|
-
lightGetters: ReadonlyArray<LightGetter>;
|
|
36
|
-
}
|
|
37
|
-
interface LightGetter {
|
|
38
|
-
name: string;
|
|
39
|
-
/** Empty to match by name alone: a loader method whose parameter types the jar does not spell. */
|
|
40
|
-
descriptor: string;
|
|
41
|
-
root: string | null;
|
|
42
|
-
}
|
|
43
|
-
/** How a block's light is stated, before it is evaluated. */
|
|
44
|
-
type LightSpec = {
|
|
45
|
-
kind: 'constant';
|
|
46
|
-
level: number;
|
|
47
|
-
} |
|
|
48
|
-
/** A `ToIntFunction<BlockState>`, to be run per state. */
|
|
49
|
-
{
|
|
50
|
-
kind: 'function';
|
|
51
|
-
fn: LambdaValue;
|
|
52
|
-
} |
|
|
53
|
-
/** A block class's own light method: a 1.13–1.15 `getLightValue` override, or a loader's `getLightEmission`. */
|
|
54
|
-
{
|
|
55
|
-
kind: 'method';
|
|
56
|
-
owner: string;
|
|
57
|
-
getter: LightGetter;
|
|
58
|
-
receiver: Handle | null;
|
|
59
|
-
} |
|
|
60
|
-
/** A light function the interpreter could not identify — one built from a value it never saw. */
|
|
61
|
-
{
|
|
62
|
-
kind: 'opaque';
|
|
63
|
-
reason: string;
|
|
64
|
-
};
|
|
65
|
-
interface Handle {
|
|
66
|
-
id: number;
|
|
67
|
-
/** Internal class name, from `new` or the declared return type of the opaque call that made it. */
|
|
68
|
-
type: string | null;
|
|
69
|
-
/** Strings that flowed into this object: the name a registration key or a property was made from. */
|
|
70
|
-
strings: string[];
|
|
71
|
-
numbers: number[];
|
|
72
|
-
/** Class literals that flowed in: the value class of an enum property. */
|
|
73
|
-
classes: string[];
|
|
74
|
-
fields: Map<string, Value>;
|
|
75
|
-
isProps: boolean;
|
|
76
|
-
light: LightSpec | null;
|
|
77
|
-
/** For a block: the `Properties` it was constructed with. */
|
|
78
|
-
props: Handle | null;
|
|
79
|
-
ctorArgs: Value[] | null;
|
|
80
|
-
/** `StringBuilder` parts, for the pre-Java 9 way of building a name. */
|
|
81
|
-
builder?: Array<string | number>;
|
|
82
|
-
origin?: string;
|
|
83
|
-
/** Entries of a map the code filled, for a lookup table of properties by direction. */
|
|
84
|
-
map?: Array<{
|
|
85
|
-
key: Value;
|
|
86
|
-
value: Value;
|
|
87
|
-
}>;
|
|
88
|
-
/** Elements of a list or set the code filled, for a table of names a mod registers in a loop. */
|
|
89
|
-
items?: Value[];
|
|
90
|
-
/** An iterator over a list: what it walks and where it is. */
|
|
91
|
-
iterator?: {
|
|
92
|
-
items: Value[];
|
|
93
|
-
at: number;
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
interface LambdaValue {
|
|
97
|
-
kind: 'lambda';
|
|
98
|
-
owner: string;
|
|
99
|
-
name: string;
|
|
100
|
-
descriptor: string;
|
|
101
|
-
captured: Value[];
|
|
102
|
-
}
|
|
103
|
-
/** A `BlockState` during evaluation of a light function: a bag of property values being read. */
|
|
104
|
-
interface StateProbe {
|
|
105
|
-
values: Map<string, string>;
|
|
106
|
-
domains: Map<string, PropertyDomain>;
|
|
107
|
-
reads: Set<string>;
|
|
108
|
-
failure: string | null;
|
|
109
|
-
}
|
|
110
|
-
interface PropertyDomain {
|
|
111
|
-
name: string;
|
|
112
|
-
values: string[];
|
|
113
|
-
/** The enum constant per serialized value, for a property whose values are an enum. */
|
|
114
|
-
constants?: Map<string, Handle>;
|
|
115
|
-
}
|
|
116
|
-
type Value = LambdaValue | {
|
|
117
|
-
kind: 'number';
|
|
118
|
-
value: number;
|
|
119
|
-
wide?: boolean;
|
|
120
|
-
} | {
|
|
121
|
-
kind: 'string';
|
|
122
|
-
value: string;
|
|
123
|
-
} | {
|
|
124
|
-
kind: 'object';
|
|
125
|
-
handle: Handle;
|
|
126
|
-
} | {
|
|
127
|
-
kind: 'array';
|
|
128
|
-
items: Value[];
|
|
129
|
-
} | {
|
|
130
|
-
kind: 'class';
|
|
131
|
-
name: string;
|
|
132
|
-
} | {
|
|
133
|
-
kind: 'null';
|
|
134
|
-
} | {
|
|
135
|
-
kind: 'state';
|
|
136
|
-
probe: StateProbe;
|
|
137
|
-
} | {
|
|
138
|
-
kind: 'unknown';
|
|
139
|
-
};
|
|
140
|
-
/** One registration this found: which `Properties` a name was registered with, and the block if seen. */
|
|
141
|
-
interface Registration {
|
|
142
|
-
props: Handle | null;
|
|
143
|
-
block: Handle | null;
|
|
144
|
-
/** The block's class, when a factory method reference named it. */
|
|
145
|
-
blockType: string | null;
|
|
146
|
-
/** The call that registered it, for a person chasing a wrong answer. */
|
|
147
|
-
site: string;
|
|
148
|
-
/** Made by the game's own code, which a mod's block of the same bare name must not inherit. */
|
|
149
|
-
vanilla: boolean;
|
|
150
|
-
}
|
|
151
|
-
/** What one run over a set of registry classes found. */
|
|
152
|
-
interface LightExtraction {
|
|
153
|
-
registrations: Map<string, Registration>;
|
|
154
|
-
notes: string[];
|
|
155
|
-
/** The light a block emits, or why it could not be worked out. */
|
|
156
|
-
lightOf: (blockId: string) => {
|
|
157
|
-
light: BlockPackLight;
|
|
158
|
-
} | {
|
|
159
|
-
failure: string;
|
|
160
|
-
};
|
|
161
|
-
/** What was recorded for a block, for a person chasing a failure. */
|
|
162
|
-
describe: (blockId: string) => string;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Runs the registry code of a set of classes and answers, per block, what it emits.
|
|
166
|
-
*
|
|
167
|
-
* `roots` are the classes whose methods register blocks; every method of each is run, because where
|
|
168
|
-
* the registrations sit differs by era and mod — `<clinit>` for a modern registry, a static
|
|
169
|
-
* `registerBlocks()` in 1.13, an instance `init()` in a mod. The order is `<clinit>` first, since the
|
|
170
|
-
* others read what it set up.
|
|
171
|
-
*/
|
|
172
|
-
declare function extractBlockLight(roots: readonly ClassFile[], source: LightCodeSource): LightExtraction;
|
|
173
|
-
//#endregion
|
|
174
|
-
export { LightCodeSource, LightExtraction, LightGetter, LightSpec, MemberReference, PropertyDomain, Registration, StateProbe, extractBlockLight };
|
|
1
|
+
import { _ as extractBlockLight, a as Handle, c as LightExtraction, d as MemberReference, f as PropertyDomain, g as Value, h as StateProbe, l as LightGetter, m as Registration, o as LambdaValue, p as PropsCall, s as LightCodeSource, u as LightSpec } from "../block-behaviour-BBslelpW.js";
|
|
2
|
+
export { Handle, LambdaValue, LightCodeSource, LightExtraction, LightGetter, LightSpec, MemberReference, PropertyDomain, PropsCall, Registration, StateProbe, Value, extractBlockLight };
|