All Projects → EngineHub → SchematicWebViewer

EngineHub / SchematicWebViewer

Licence: MIT license
An NPM package to facilitate importing and viewing of modern Minecraft schematics.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to SchematicWebViewer

Router.cr
Minimum High Performance Middleware for Crystal Web Server.
Stars: ✭ 231 (+425%)
Mutual labels:  renderer
EasyEdit
A feature-rich World Editor for PocketMine-MP
Stars: ✭ 26 (-40.91%)
Mutual labels:  worldedit
WorldEditCUI
WorldEdit client interface for Minecraft, running on Fabric
Stars: ✭ 187 (+325%)
Mutual labels:  worldedit
copper
An open source PCB editor in rust
Stars: ✭ 26 (-40.91%)
Mutual labels:  schematic
BuilderTools
🪓 Powerful World Editor plugin for PocketMine servers
Stars: ✭ 74 (+68.18%)
Mutual labels:  worldedit
MagicWE2
[MagicWE2] Lag free asynchronous world editor for PMMP with plenty of options
Stars: ✭ 109 (+147.73%)
Mutual labels:  worldedit
Blenderseed
appleseed plugin for Blender
Stars: ✭ 214 (+386.36%)
Mutual labels:  renderer
Lambda
Physically based renderer written in C++
Stars: ✭ 26 (-40.91%)
Mutual labels:  renderer
FastAsyncVoxelSniper
Voxel Sniper fork for modern Minecraft versions utilizing the improvements of FastAsyncWorldEdit
Stars: ✭ 38 (-13.64%)
Mutual labels:  worldedit
BTE-tools
Awesome tools and scripts to enhance your experience on the Build The Earth project!
Stars: ✭ 12 (-72.73%)
Mutual labels:  worldedit
nbtschematic
A simple schematic file reader for nbtlib
Stars: ✭ 12 (-72.73%)
Mutual labels:  schematic
libschematic
Create and manipulate MCEdit Schematic files in PocketMine-MP plugins.
Stars: ✭ 20 (-54.55%)
Mutual labels:  schematic
BlockSniper
An advanced (brush) world editing plugin for PocketMine-MP
Stars: ✭ 77 (+75%)
Mutual labels:  worldedit
Vqengine
DirectX 11 Renderer written in C++11
Stars: ✭ 250 (+468.18%)
Mutual labels:  renderer
WorldEdit-BE
A Minecraft Bedrock addon port of the famous WorldEdit mod for Minecraft: Java Edition.
Stars: ✭ 45 (+2.27%)
Mutual labels:  worldedit
Renderer
Simple, lightweight and faster response (JSON, JSONP, XML, YAML, HTML, File) rendering package for Go
Stars: ✭ 220 (+400%)
Mutual labels:  renderer
minecraft-worldedit-bedrock
World Edit for Minecraft bedrock
Stars: ✭ 48 (+9.09%)
Mutual labels:  worldedit
ngrx-entity-schematic
Angular schematic for quickly scaffolding NgRx Entities
Stars: ✭ 26 (-40.91%)
Mutual labels:  schematic
Worldedit
🗺️ Minecraft map editor and mod
Stars: ✭ 2,288 (+5100%)
Mutual labels:  worldedit
WorldEditSelectionVisualizer
Visualize your WorldEdit selection with particles and without any mod.
Stars: ✭ 31 (-29.55%)
Mutual labels:  worldedit

SchematicWebViewer

An NPM package to facilitate importing and viewing of modern Minecraft schematics.

Originally by cpdt and was available here.

Usage

This library requires a complete Minecraft resource pack in order to function. This means a resource pack that include all models, blockstates, and textures. As most resource packs only include what they have changed, they do not fit this criteria. Luckily, the Minecraft client jar file is formatted in the same way as a resource pack.

To use this on your site, create a canvas element in your HTML that is able to be queried in the JavaScript.

<canvas id="schematicRenderer" , width="500," height="500"></canvas>
renderSchematic(document.querySelector('#schematicRenderer'), SCHEMATIC_FILE, {
    size: 500,
    renderArrow: false,
    renderBars: false,
    corsBypassUrl: 'https://url-to-cors-anywhere/',
});

The renderSchematic function takes a few options.

The first argument is the canvas element to render to.

The second argument is a schematic file encoded in Base64. The schematic format must be supported by SchematicJS.

The final argument is an options object that allows configuring various settings about how the schematic is rendered. The following properties are on the object,

interface SchematicRenderOptions {
    /**
     * Usage as number is deprecated and will be removed
     */
    size?: number | { width: number; height: number };
    /**
     * A url of a cors-anywhere instance to allow access to MC server jars. Required by the default `getClientJarUrl` function
     */
    corsBypassUrl?: string;
    /**
     * A function that returns the url of the client jar to use. Defaults to using the EngineHub Cassette Deck service
     */
    getClientJarUrl?: (props: GetClientJarUrlProps) => Promise<string>;
    /**
     * A list of resource pack URLs in priority order
     */
    resourcePacks?: string[];
    /**
     * Whether a grid should be rendered
     */
    renderBars?: boolean;
    /**
     * Whether an arrow to show direction should be rendered
     */
    renderArrow?: boolean;
    /**
     * Whether the view should automatically rotate when not being dragged by the user
     */
    orbit?: boolean;
    /**
     * The speed at which the view should orbit (default: 0.02)
     */
    orbitSpeed?: number;
    /**
     * Whether antialiasing should be enabled
     */
    antialias?: boolean;
    /**
     * Background color of the canvas (default: 0xffffff), or if it should be transparent
     */
    backgroundColor?: number | 'transparent';
    /**
     * Whether to enable further debug information
     */
    debug?: boolean;
    /**
     * Only update the view when {@link SchematicHandles#render} is called. This is useful if you want to control the rendering yourself
     */
    disableAutoRender?: boolean;
}

Notes on Cors-Anywhere

Due to the way this works, it must have access to a Minecraft jar file. As redistribution of this file would be a breach of the license, and Mojang uses CORS on their download site, a cors-anywhere instance must be used to allow access to these jar files.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].