mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
🔥 Nuke all mcschema related code
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { DataModel } from '@mcschema/core'
|
||||
import { Identifier, ItemStack } from 'deepslate'
|
||||
import { useEffect, useMemo, useRef, useState } from 'preact/hooks'
|
||||
import { useLocale } from '../../contexts/index.js'
|
||||
import { useLocale, useVersion } from '../../contexts/index.js'
|
||||
import { useAsync } from '../../hooks/useAsync.js'
|
||||
import type { VersionId } from '../../services/index.js'
|
||||
import { checkVersion, fetchAllPresets } from '../../services/index.js'
|
||||
@@ -12,8 +11,9 @@ import type { PreviewProps } from './index.js'
|
||||
|
||||
const ANIMATION_TIME = 1000
|
||||
|
||||
export const RecipePreview = ({ data, version }: PreviewProps) => {
|
||||
export const RecipePreview = ({ model }: PreviewProps) => {
|
||||
const { locale } = useLocale()
|
||||
const { version } = useVersion()
|
||||
const [advancedTooltips, setAdvancedTooltips] = useState(true)
|
||||
const [animation, setAnimation] = useState(0)
|
||||
const overlay = useRef<HTMLDivElement>(null)
|
||||
@@ -29,7 +29,7 @@ export const RecipePreview = ({ data, version }: PreviewProps) => {
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
|
||||
const recipe = DataModel.unwrapLists(data)
|
||||
const recipe = model.data
|
||||
const state = JSON.stringify(recipe)
|
||||
const items = useMemo<Map<Slot, ItemStack>>(() => {
|
||||
return placeItems(version, recipe, animation, itemTags ?? new Map())
|
||||
|
||||
Reference in New Issue
Block a user