minerender 2.1.0-alpha.63 → 2.1.0-alpha.65
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/dist/browser/index.d.mts +5 -1
- package/dist/browser/index.d.ts +5 -1
- package/dist/browser/index.js +18 -6
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +19 -7
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +18 -6
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +5 -1
- package/dist/node/index.d.ts +5 -1
- package/dist/node/index.js +18 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +19 -7
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -851,7 +851,7 @@ var init_Textures = __esm({
|
|
|
851
851
|
});
|
|
852
852
|
|
|
853
853
|
// src/Materials.ts
|
|
854
|
-
import { Color, CustomBlending, DoubleSide, OneFactor, RepeatWrapping, FrontSide, MeshBasicMaterial, MeshStandardMaterial, ShaderChunk, ShaderMaterial
|
|
854
|
+
import { Color, CustomBlending, DoubleSide, OneFactor, OneMinusSrcAlphaFactor, RepeatWrapping, FrontSide, MeshBasicMaterial, MeshStandardMaterial, ShaderChunk, ShaderMaterial } from "three";
|
|
855
855
|
var Materials;
|
|
856
856
|
var init_Materials = __esm({
|
|
857
857
|
"src/Materials.ts"() {
|
|
@@ -943,8 +943,15 @@ var init_Materials = __esm({
|
|
|
943
943
|
material.blending = CustomBlending;
|
|
944
944
|
material.blendSrc = OneFactor;
|
|
945
945
|
material.blendDst = OneFactor;
|
|
946
|
-
material.blendSrcAlpha =
|
|
947
|
-
material.blendDstAlpha =
|
|
946
|
+
material.blendSrcAlpha = OneFactor;
|
|
947
|
+
material.blendDstAlpha = OneMinusSrcAlphaFactor;
|
|
948
|
+
material.onBeforeCompile = (shader) => {
|
|
949
|
+
shader.fragmentShader = shader.fragmentShader.replace(
|
|
950
|
+
"#include <dithering_fragment>",
|
|
951
|
+
"gl_FragColor.a = max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b));\n#include <dithering_fragment>"
|
|
952
|
+
);
|
|
953
|
+
};
|
|
954
|
+
material.customProgramCacheKey = () => "energy_swirl";
|
|
948
955
|
material.color.set(8421504);
|
|
949
956
|
break;
|
|
950
957
|
case "water_mask":
|
|
@@ -11246,7 +11253,11 @@ var legacyBlocks_default = {
|
|
|
11246
11253
|
|
|
11247
11254
|
// src/model/multiblock/SchematicParser.ts
|
|
11248
11255
|
var SchematicParser = class {
|
|
11249
|
-
|
|
11256
|
+
/**
|
|
11257
|
+
* Parses a legacy schematic using custom mappings before the bundled defaults.
|
|
11258
|
+
* Keys are `id:metadata`; values are block states such as `minecraft:oak_log[axis=x]`.
|
|
11259
|
+
*/
|
|
11260
|
+
static async parse(nbt, customMappings = {}) {
|
|
11250
11261
|
const tags = nbt.value;
|
|
11251
11262
|
if (tags.Materials?.type !== "string" || tags.Materials.value !== "Alpha") {
|
|
11252
11263
|
throw new MineRenderError("Schematic Materials must be Alpha");
|
|
@@ -11288,15 +11299,16 @@ var SchematicParser = class {
|
|
|
11288
11299
|
const high = packed >> (index & 1) * 4 & 15;
|
|
11289
11300
|
const id = high << 8 | ids.value[index] & 255;
|
|
11290
11301
|
const metadata = data.value[index] & 255;
|
|
11291
|
-
const
|
|
11302
|
+
const key = `${id}:${metadata}`;
|
|
11303
|
+
const mapped = customMappings[key] ?? mapping[key];
|
|
11292
11304
|
if (!mapped) throw new MineRenderError(`Unsupported legacy block ${id}:${metadata} at schematic index ${index}`);
|
|
11293
11305
|
const [type, state] = mapped.split("[");
|
|
11294
11306
|
if (type === "minecraft:air") continue;
|
|
11295
11307
|
const properties = {};
|
|
11296
11308
|
if (state) {
|
|
11297
11309
|
for (const property of state.slice(0, -1).split(",")) {
|
|
11298
|
-
const [
|
|
11299
|
-
properties[
|
|
11310
|
+
const [key2, value] = property.split("=");
|
|
11311
|
+
properties[key2] = value;
|
|
11300
11312
|
}
|
|
11301
11313
|
}
|
|
11302
11314
|
blocks.push({
|