Support 1.18 (experimental) snapshots (#158)

* Half support 1.18-experimental-snapshot-1

* Fetch 1.18 presets and improve rendering of lists

* Noise preview with deepslate

* Biome preview with deepslate

* Generalize canvas logic in one hook

* Simplify useCanvas

* Use mcschema for 1.18

* Improve noise settings preview controls

* Fix build

* Update deepslate and improve preview caching

* Cleanup, remove old preview code

* Couple seed between model and preview

* Limit output to improve performance + copy feedback
For the vanilla overworld dimension (200K lines),
it took 2+ seconds to write the output to the textarea

Now capped at 10K chars

* Add surface_relative_threshold to decorator preview

* Improve fixed list errors
This commit is contained in:
Misode
2021-09-23 03:04:52 +02:00
committed by GitHub
parent eb085737a3
commit 3b80334e2e
33 changed files with 812 additions and 639 deletions

View File

@@ -2,6 +2,7 @@ import { render } from 'preact'
import type { RouterOnChangeArgs } from 'preact-router'
import { Router } from 'preact-router'
import { useEffect, useState } from 'preact/hooks'
import config from '../config.json'
import '../styles/global.css'
import '../styles/nodes.css'
import { Analytics } from './Analytics'
@@ -12,6 +13,8 @@ import type { VersionId } from './Schemas'
import { Store } from './Store'
import { cleanUrl } from './Utils'
const VERSIONS_IN_TITLE = 3
function Main() {
const [lang, setLanguage] = useState<string>('en')
const changeLanguage = async (language: string) => {
@@ -51,7 +54,9 @@ function Main() {
}
const [title, setTitle] = useState<string>(locale(lang, 'title.home'))
const changeTitle = (title: string, versions = ['1.15', '1.16', '1.17']) => {
const changeTitle = (title: string, versions?: VersionId[]) => {
versions ??= config.versions.map(v => v.id as VersionId)
versions.splice(0, versions.length - VERSIONS_IN_TITLE)
document.title = `${title} Minecraft ${versions.join(', ')}`
setTitle(title)
}