Skip to content

Commit

Permalink
chore: switch to external schematicjs package
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Nov 26, 2020
1 parent ea5f983 commit aebefd9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 167 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"homepage": "https://github.com/EngineHub/SchematicWebViewer#readme",
"dependencies": {
"@enginehub/schematicjs": "^0.0.1",
"gzip-js": "^0.3.2",
"nbt-ts": "^1.3.3",
"patch-package": "^6.2.2",
Expand Down
24 changes: 13 additions & 11 deletions src/renderer/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'three';
import { decode, Tag } from 'nbt-ts';
import { unzip } from 'gzip-js';
import { loadSchematic, Schematic } from '../schematic';
import { loadSchematic, Schematic } from '@enginehub/schematicjs';
import { SchematicHandles } from '.';
import { SchematicRenderOptions } from './types';
import TextureManager from './textureManager';
Expand Down Expand Up @@ -135,7 +135,9 @@ export async function renderSchematic(
camera.lookAt(0, 0, 0);

if (options.renderArrow ?? true) {
const arrowMaterial = new MeshBasicMaterial({ color: new Color(0x000000) });
const arrowMaterial = new MeshBasicMaterial({
color: new Color(0x000000)
});
const arrowGeometry = new CylinderGeometry(
cameraOffset / 4,
cameraOffset / 4,
Expand All @@ -156,16 +158,16 @@ export async function renderSchematic(
scene.add(worldLight);
scene.add(new AmbientLight(new Color(), 0.5));

const gridGeom = new CylinderGeometry(
cameraOffset / 400,
cameraOffset / 400,
1,
3,
1,
false
);

if (options.renderBars ?? true) {
const gridGeom = new CylinderGeometry(
cameraOffset / 400,
cameraOffset / 400,
1,
3,
1,
false
);

const gridMaterial = new MeshBasicMaterial({
color: new Color(0x000000),
opacity: 0.2,
Expand Down
2 changes: 0 additions & 2 deletions src/schematic/index.ts

This file was deleted.

61 changes: 0 additions & 61 deletions src/schematic/loader.ts

This file was deleted.

83 changes: 0 additions & 83 deletions src/schematic/types.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/util/array.ts

This file was deleted.

11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,17 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@enginehub/schematicjs@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@enginehub/schematicjs/-/schematicjs-0.0.1.tgz#6eb809bbeec1e0d7087b03eb789a35ef31ea1e5a"
integrity sha512-nBiBynwGXzm93lnAKJPIxjOLE+I+4ZRM5hBn1v9/sYZjaqBp7GLc1L/KMmlMiely9d3W2OEJd4GPIaXtb9kAVQ==
dependencies:
gzip-js "^0.3.2"
nbt-ts "^1.3.3"
patch-package "^6.2.2"
postinstall-postinstall "^2.1.0"
zlibt "^0.0.5"

"@iarna/toml@^2.2.0":
version "2.2.5"
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c"
Expand Down

0 comments on commit aebefd9

Please sign in to comment.