diff --git a/src/app/Router.ts b/src/app/Router.ts index 818e1e7b..4f6b3d91 100644 --- a/src/app/Router.ts +++ b/src/app/Router.ts @@ -1,4 +1,4 @@ -import { App, Models } from './App'; +import { App, checkVersion, Models } from './App'; import { View } from './views/View'; import { Home } from './views/Home' import { FieldSettings } from './views/FieldSettings' @@ -42,7 +42,10 @@ const router = async () => { } } - document.title = locale('title.suffix', [title]) + const versions = config.versions + .filter(v => checkVersion(v.id, App.model.get()?.minVersion)) + .map(v => v.id).join(', ') + document.title = `${title} Minecraft ${versions}` App.mobilePanel.set(panel) const view = new View() view.mount(target, renderer(view), true) diff --git a/src/app/preview/DecoratorPreview.ts b/src/app/preview/DecoratorPreview.ts index 2e5f80b2..acaa1ffa 100644 --- a/src/app/preview/DecoratorPreview.ts +++ b/src/app/preview/DecoratorPreview.ts @@ -203,6 +203,14 @@ export class DecoratorPreview extends Preview { } return new Array(count).fill(pos) }, + count_multilayer: (config, pos) => { + return new Array(this.sampleUniformInt(config?.count ?? 1)).fill(pos) + .map(p => [ + p[0] + this.nextInt(16), + p[1], + p[2] + this.nextInt(16) + ]) + }, count_noise: (config, pos) => { const noise = this.biomeInfoNoise.getValue(pos[0] / 200, 0, pos[2] / 200) const count = noise < config.noise_level ? config.below_noise : config.above_noise diff --git a/src/index.html b/src/index.html index 3ef63d53..6ef14436 100644 --- a/src/index.html +++ b/src/index.html @@ -21,7 +21,6 @@ - <%= htmlWebpackPlugin.options.title %> diff --git a/src/locales/en.json b/src/locales/en.json index 6c2fcac9..888662e6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -26,7 +26,6 @@ "share": "Share", "title.generator": "%0% Generator", "title.home": "Data Pack Generators", - "title.suffix": "%0% Minecraft 1.15, 1.16, 1.17", "presets": "Presets", "preview": "Visualize", "preview.show_density": "Show Density", diff --git a/src/locales/zh-cn.json b/src/locales/zh-cn.json index 1987b9c1..c7d2f67e 100644 --- a/src/locales/zh-cn.json +++ b/src/locales/zh-cn.json @@ -22,7 +22,6 @@ "share": "分享", "title.generator": "%0% 生成器", "title.home": "数据包生成器", - "title.suffix": "%0% Minecraft 1.15, 1.16, 1.17", "undo": "撤销", "world": "世界设置", "worldgen/biome": "生物群系", diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json index 275f9c59..020d286c 100644 --- a/src/locales/zh-tw.json +++ b/src/locales/zh-tw.json @@ -22,7 +22,6 @@ "share": "分享", "title.generator": "%0% 生成器", "title.home": "資料包生成器", - "title.suffix": "%0% Minecraft 1.15, 1.16, 1.17", "undo": "復原", "world": "世界設定", "worldgen/biome": "生態域", diff --git a/webpack.config.js b/webpack.config.js index aa5c6713..09b74b46 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -55,9 +55,15 @@ module.exports = (env, argv) => ({ template: 'src/index.html' }), ...config.models.map(m => new HtmlWebpackPlugin({ - title: `${m.name} Generator${m.category === true ? 's' : ''} Minecraft 1.15, 1.16, 1.17`, + title: getTitle(m), filename: `${m.id}/index.html`, template: 'src/index.html' })) ] }) + +function getTitle(m) { + const minVersion = Math.max(0, config.versions.findIndex(v => m.minVersion === v.id)) + const versions = config.versions.slice(minVersion).map(v => v.id).join(', ') + return `${m.name} Generator${m.category === true ? 's' : ''} Minecraft ${versions}` +}